Ver código fonte

modification des pages accueil et login

Axel S 1 ano atrás
pai
commit
64e24a0cd4

+ 10 - 5
Resources/Page Object/PageAccueil.resource

@@ -3,22 +3,27 @@ Library    SeleniumLibrary
 Library       XML
 
 *** Variables ***
-${LOGIN_BUTTON_LOCATOR}=    xpath=//*[@id="root"]/div/div/div/div[1]/div[1]/a[1]
+${LOGIN_BUTTON_LOCATOR_ACCUEIL}=    xpath=//*[@id="root"]/div/div/div/div[1]/div[1]/a[1]
 ${CREATE_ACCOUNT_BUTTON_LOCATOR}=    xpath=//*[@id="root"]/div/div/div/div[1]/div[1]/a[2]
-
+${LOGOUT_BUTTON_LOCATOR}=    xpath=//*[@id="navbarSupportedContent"]/ul/li[2]/button
 *** Keywords ***
 
 Valider l'affichage de la page "Accueil" - non connecté
     ${page_url} =    Get Location
     Should Be Equal As Strings    ${page_url}    https://practice.expandtesting.com/notes/app/
-    Wait Until Element Is Visible    ${LOGIN_BUTTON_LOCATOR}
+    Wait Until Element Is Visible    ${LOGIN_BUTTON_LOCATOR_ACCUEIL}
     #Element Should Exist     ${LOGIN_BUTTON_LOCATOR}
     #Element Should Exist    ${CREATE_ACCOUNT_BUTTON_LOCATOR}
 
+Valider l'affichage de la page "Accueil" - connecté
+    Wait Until Element Is Visible    ${LOGOUT_BUTTON_LOCATOR}
+    ${page_url} =    Get Location
+    Should Be Equal As Strings    ${page_url}    https://practice.expandtesting.com/notes/app
+    
 Cliquer sur "Login"
 
-    Click Element    ${LOGIN_BUTTON_LOCATOR}
+    Click Element    ${LOGIN_BUTTON_LOCATOR_ACCUEIL}
 
 Cliquer sur "Create an account"
     Click Element    ${CREATE_ACCOUNT_BUTTON_LOCATOR}
-        
+        

+ 9 - 2
Resources/Page Object/PageLogin.resource

@@ -5,9 +5,10 @@ Library    SeleniumLibrary
 ${PAGE_LOGIN_HEADER_LOCATOR}=    css=h1
 ${EMAIL_TEXTBOX_LOCATOR}=    id=email
 ${PASSWORD_TEXTBOX_LOCATOR}=   id=password 
-${LOGIN_BUTTON_LOCATOR}=    xpath=//*[@id="root"]/div/div/div/div/form/div[2]/button
+${LOGIN_BUTTON_LOCATOR}=    xpath=//*[@id="root"]/div/div/div/div/form/div[2]/button  
 ${CREATE_ACCOUNT_LINK_LOCATOR}=    xpath=//*[@id="root"]/div/div/div/div/div[3]/a
 ${FORGOT_PASSWORD_LINK_LOCATOR}=    id=forgotPasswordLink
+${MESSAGE_ALERTE_INCORRECT_LOGIN_LOCATOR}=    xpath=//*[@id="root"]/div/div/div/div/div[1]/div/div/div
 
 *** Keywords ***
 Vérifier l'affichage de la page "Login"
@@ -28,4 +29,10 @@ Cliquer sur le lien "Create a free account"
 Cliquer sur le lien "Forgot Password"
     Click Element    ${FORGOT_PASSWORD_LINK_LOCATOR}
 
-    
+    
+Vérifier Login KO 
+    ${Current_Page_Url}=    Get Location
+    Should Be Equal As Strings    ${Current_Page_Url}    https://practice.expandtesting.com/notes/app/login
+    Wait Until Element Is Visible    ${MESSAGE_ALERTE_INCORRECT_LOGIN_LOCATOR}
+    ${Text_message_alerte}=    Get Text    ${MESSAGE_ALERTE_INCORRECT_LOGIN_LOCATOR}
+    Should Be Equal As Strings    ${MESSAGE_ALERTE_INCORRECT_LOGIN_LOCATOR}    Incorrect email address or password    ignorecase=true