*** Settings ***

Documentation  A resource file containing the application specific keywords
...            that create our own domain specific language. This resource
...            implements keywords for testing Flex version of the test
...            application. Keywords for HTML version are in flex_resource.txt
...            and common_resource.txt is used to select which one to use.


*** Variables ***

${LOGIN URL}             http://${SERVER}/flex/
${LOGIN FAILED LOCATOR}  chain=name:Alert*/name:AlertForm*/name:UITextField*


*** Keywords ***

Open Browser To Login Page
    Open Browser  ${LOGIN URL}  ${BROWSER}
    Maximize Browser Window
    Set Selenium Speed  ${DELAY}
    Title Should Be  Login Page
    Select Flex Application  loginApp

Go To Login Page
    Go To  ${LOGIN URL}
    Title Should Be  Login Page
    Select Flex Application  loginApp

Input Username  [Arguments]  ${username}
    Input Text Into Flex Element  username_field  ${username}

Input Password  [Arguments]  ${password}
    Input Text Into Flex Element  password_field  ${password}

Submit Credentials
    Click Flex Element  login_button

Welcome Page Should Be Open
    Flex Element Should Exist  welcome_text

Login Should Have Failed
    Flex Element Text Should Be  ${LOGIN FAILED LOCATOR}  Incorrect credentials
    Click Flex Element  name=OK
