浏览代码

Ex8: Réinitialisation du mdp Ok pour un user avec un compte email validee

Diane 1 年之前
父节点
当前提交
554f300402
共有 1 个文件被更改,包括 58 次插入0 次删除
  1. 58 0
      Tests/MyNotes_Test_Ex8.robot

+ 58 - 0
Tests/MyNotes_Test_Ex8.robot

@@ -0,0 +1,58 @@
+*** Settings ***
+Library    String 
+Library    XML  
+Library    SeleniumLibrary
+Resource     ../Resources/Common.robot
+Resource     ../Resources/Page Object/PageAccueil.resource
+Resource     ../Resources/Page Object/PageLogin.resource
+Resource     ../Resources/Page Object/PageCreateAccount.resource
+
+Test Setup    Common.Démarrer Test            
+Test Teardown    Common.Terminer Test
+Documentation    Ex8: Réinitialisation du mdp Ok pour un user avec un compte email validee
+
+*** Variables ***
+
+${email}         dianeteta10@gmail.com
+#${ResetSuccessMsg}    Password reset successful. Check your email for instructions.
+${password}           rutaremara
+
+*** Test Cases ***
+Ex8-CT01 - Réinitialisation du mdp Ok pour un user avec un compte email validee
+    
+    PageAccueil.Cliquer sur "Login"
+    Login attempt    ${email}    ${EMPTY}
+    Resetting the password 
+
+*** Keywords ***
+Login attempt
+    [Arguments]    ${email}    ${password}
+    Input Text    id=email    ${email}
+    Input Text    id=password    ${EMPTY}
+    Click Element    xpath=//*[@id="forgotPasswordLink"]
+
+Resetting the password 
+    #Filling in the Email adress to receive the reset link
+    Input Text    id=email    ${email}
+    Click Button    xpath=//*[@id="forgot-password"]/button
+
+    #Verifying if the alert-info message appeared correctly 
+    #${actual_alert_msg}=    Get Text    xpath=//*[@id="root"]/div/div/div/div/div[2]
+    #Should Contain    ${actual_alert_msg}    An e-mail with a link to reset the password has been sent to dianeteta10@gmail.com    ignore_case=true
+    Wait Until Element Is Visible    data:testid:login-view
+    Page Should Contain    An e-mail with a link to reset the password has been sent to dianeteta10@gmail.com
+
+    #Click to go back to the home page 
+    Click Element    xpath=//*[@id="root"]/div/div/div/div/div[2]/div/a/span
+
+    #Login in once again to fill in the new information (new password after filling in the email)
+    PageAccueil.Cliquer sur "Login"
+
+    #Filling in the login form after the reset
+    Input Text    id=email    ${email}
+    Input Text    id=password    ${password}
+    Click Button    xpath=//*[@id="root"]/div/div/div/div/form/div[2]/button
+
+    Close Browser
+
+