*** Settings ***
Library  SeleniumLibrary  run_on_failure=Capture Page Screenshot

*** Variables ***

${PLONE_URL} =  http://localhost:${PORT}/Plone

*** Keywords ***

Start browser and wake plone up
    Open browser  ${PLONE_URL}
    Set Selenium timeout  30
    Log in  admin  admin
    Set Selenium timeout  7

Goto homepage
    Go to  ${PLONE_URL}
    Page should contain  Welcome to Plone

Log in
    [Arguments]  ${userid}  ${password}
    Go to  ${PLONE_URL}/login_form
    Page should contain element  __ac_name
    Input text  __ac_name  ${userid}
    Input text  __ac_password  ${password}
    Click Button  Log in
    Go to  ${PLONE_URL}
    Page should contain  ${userid}

Log out
    Go to  ${PLONE_URL}/logout
    Page should contain  logged out
