*** Settings ***
Library                                             SeleniumLibrary

*** Variables ***
${SIGNIN_HEADER_LABEL}=                             Login
${SIGNIN_EMAIL_TEXTBOX}=                            id=email-id
${SIGNIN_PASSWORD_TEXTBOX}=                         id=password
${SIGNIN_SUBMIT_BUTTON}=                            id=submit-id
${EMAIL_ERROR_POPUP}=                               @
${SELECT_REMEMBER_BOX}=                                 id=remember

*** Keywords ***
Verify Page Loaded
    Wait Until Page Contains                        ${SIGNIN_HEADER_LABEL}

Login With Valid Credentials
    [Arguments]                                     ${Email}  ${Password}
    Fill Email Field                                ${Email}
    Fill Password Field                             ${Password}
    Click Submit Field

Login With remember checkbox
    [Arguments]                                     ${Email}  ${Password}
    Fill Email Field                                ${Email}
    Fill Password Field                             ${Password}
    Click Checkbox
    Click Submit Field

Verify Page Loaded Credentials
    Wait Until Page Contains                        ${SIGNIN_HEADER_LABEL}

Login With Invalid Credentials
    [Arguments]                                     ${Email}
    Fill Email Field                                ${Email}
    Click Submit Field
    Wait Until Element Is Visible                   ${SIGNIN_EMAIL_TEXTBOX}
                                                    ${email_check}=    Get Value    ${SIGNIN_EMAIL_TEXTBOX}
    Should Not Contain                              ${email_check}    @


Fill Email Field
    [Arguments]                                     ${Email}
    Input Text                                      ${SIGNIN_EMAIL_TEXTBOX}   ${Email}

Fill Password Field
    [Arguments]                                     ${Password}
    Input Text                                      ${SIGNIN_PASSWORD_TEXTBOX}  ${Password}

Click Submit Field
    Click Button                                    ${SIGNIN_SUBMIT_BUTTON}

Click Checkbox
    Select Checkbox                                 ${SELECT_REMEMBER_BOX}
