PageLogin.resource 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. *** Settings ***
  2. Library SeleniumLibrary
  3. *** Variables ***
  4. ${PAGE_LOGIN_HEADER_LOCATOR}= css=h1
  5. ${EMAIL_TEXTBOX_LOCATOR}= id=email
  6. ${PASSWORD_TEXTBOX_LOCATOR}= id=password
  7. ${LOGIN_BUTTON_LOCATOR}= xpath=//*[@id="root"]/div/div/div/div/form/div[2]/button
  8. ${CREATE_ACCOUNT_LINK_LOCATOR}= xpath=//*[@id="root"]/div/div/div/div/div[3]/a
  9. ${FORGOT_PASSWORD_LINK_LOCATOR}= id=forgotPasswordLink
  10. ${MESSAGE_ALERTE_INCORRECT_LOGIN_LOCATOR}= xpath=//*[@id="root"]/div/div/div/div/div[1]/div/div/div
  11. ${MESSAGE_PWDREQUIRED_LOCATOR}= xpath=//*[@id="root"]/div/div/div/div/form/div[1]/div[2]/div
  12. ${MESSAGE_EMAILFORMAT_LOCATOR}= xpath=//*[@id="root"]/div/div/div/div/form/div[1]/div[1]/div
  13. *** Keywords ***
  14. Vérifier l'affichage de la page "Login"
  15. ${Page_login_header_text}= Get Text ${PAGE_LOGIN_HEADER_LOCATOR}
  16. Should Be Equal As Strings ${Page_login_header_text} Login ignore_case=true
  17. Remplir le formulaire de login
  18. [Arguments] @{Donnees_Login}
  19. Input Text ${EMAIL_TEXTBOX_LOCATOR} ${Donnees_Login}[0]
  20. Input Text ${PASSWORD_TEXTBOX_LOCATOR} ${Donnees_Login}[1]
  21. Soumettre le formulaire de Login
  22. Click Button ${LOGIN_BUTTON_LOCATOR}
  23. Cliquer sur le lien "Create a free account"
  24. Click Element ${CREATE_ACCOUNT_LINK_LOCATOR}
  25. Cliquer sur le lien "Forgot Password"
  26. Click Element ${FORGOT_PASSWORD_LINK_LOCATOR}
  27. Vérifier Login KO - email ou pwd incorrect
  28. ${Current_Page_Url}= Get Location
  29. Should Be Equal As Strings ${Current_Page_Url} https://practice.expandtesting.com/notes/app/login
  30. Wait Until Element Is Visible ${MESSAGE_ALERTE_INCORRECT_LOGIN_LOCATOR}
  31. ${Text_message_alerte}= Get Text ${MESSAGE_ALERTE_INCORRECT_LOGIN_LOCATOR}
  32. Should Be Equal As Strings ${Text_message_alerte} Incorrect email address or password ignorecase=true
  33. Vérifier Login KO - champ pwd vide
  34. ${Current_Page_Url}= Get Location
  35. Should Be Equal As Strings ${Current_Page_Url} https://practice.expandtesting.com/notes/app/login
  36. Wait Until Element Is Visible ${MESSAGE_PWDREQUIRED_LOCATOR}
  37. ${Text_message_alerte}= Get Text ${MESSAGE_PWDREQUIRED_LOCATOR}
  38. Should Be Equal As Strings ${Text_message_alerte} Password is required ignorecase=true
  39. Vérifier Login KO - pwd lenght KO
  40. ${Current_Page_Url}= Get Location
  41. Should Be Equal As Strings ${Current_Page_Url} https://practice.expandtesting.com/notes/app/login
  42. Wait Until Element Is Visible ${MESSAGE_PWDREQUIRED_LOCATOR}
  43. ${Text_message_alerte}= Get Text ${MESSAGE_PWDREQUIRED_LOCATOR}
  44. Should Be Equal As Strings ${Text_message_alerte} Password should be between 6 and 30 characters ignorecase=true
  45. Vérifier Login KO - format email invalide
  46. ${Current_Page_Url}= Get Location
  47. Should Be Equal As Strings ${Current_Page_Url} https://practice.expandtesting.com/notes/app/login
  48. Wait Until Element Is Visible ${MESSAGE_EMAILFORMAT_LOCATOR}
  49. ${Text_message_alerte}= Get Text ${MESSAGE_EMAILFORMAT_LOCATOR}
  50. Should Be Equal As Strings ${Text_message_alerte} Email address is invalid ignorecase=true