*Setting*
Library  SeleniumLibrary  \  \  4455  ${JARPATH}  NONE
Library  Collections
Library  OperatingSystem


*Variable*
${SERVER}  localhost:7272
${BROWSER}  *firefox
${ROOT}  http://${SERVER}/html
${FRONT PAGE}  ${ROOT}/
${SPEED}  0
${JARPATH}=  ${NONE}


*Keyword*
Open Browser To Start Page
  [Documentation]  This keyword also tests 'Set Selenium Speed' and 'Set Selenium Timeout' against all reason.
  ${default speed}  ${default timeout} =
  ...  Open Browser To Start Page Without Testing Default Options
  Should Be Equal  ${default speed}  0 seconds
  Should Be Equal  ${default timeout}  5 seconds

Open Browser To Start Page Without Testing Default Options
  Open Browser  ${FRONT PAGE}  ${BROWSER}
  ${orig speed} =  Set Selenium Speed  ${SPEED}
  ${orig timeout} =  Set Selenium Timeout  10 seconds
  [Return]  ${orig speed}  ${orig timeout}

Cannot Be Executed In IE
  ${runsInIE}=  Set Variable If  "${BROWSER}".replace(' ', '').lower() in ['ie', '*iexplore', 'internetexplorer']  ${TRUE}
  Run Keyword If   ${runsInIE}  Set Tags  ie-incompatible
  Run Keyword If   ${runsInIE}  Fail And Set Non-Critical  This test does not work in Internet Explorer

Fail And Set Non-Critical
  [Arguments]  ${msg}
  Remove Tags  regression
  Fail  ${msg}

Go to Front Page
  Go To  ${FRONT PAGE}

Go To Page "${relative url}"
  Go To  ${ROOT}/${relative url}

Set ${level} Loglevel
  Set Log Level  ${level}

Verify Location Is "${relative url}"
  Location Should Be  ${ROOT}/${relative url}
