*** Settings ***

Library  OperatingSystem
Library  Selenium2Library  timeout=10  implicit_wait=0.5
Library  robotsuite.tests.test_robot.Keywords

Suite Setup  Start browser
Suite Teardown  Close all browsers

*** Variables ***

${HTTP_PORT} =

*** Test Cases ***

Log in
    ${TEST_USER_NAME} =  Get test user name
    ${TEST_USER_PASSWORD} =  Get test user password
    Go to  http://localhost:${HTTP_PORT}/plone/login_form
    Page should contain element  __ac_name
    Input text  __ac_name  ${TEST_USER_NAME}
    Input text  __ac_password  ${TEST_USER_PASSWORD}
    Click button  Log in
    Page should not contain button  Log in
    Page should contain element  css=#user-name

*** Keywords ***

Start browser
    ${HTTP_PORT} =  Get environment variable  ZSERVER_PORT  55001
    Set suite variable  ${HTTP_PORT}  ${HTTP_PORT}
    Open browser  http://localhost:${HTTP_PORT}/plone/
