2 Commits cf07ba039c ... 2c88bdba19

Autore SHA1 Messaggio Data
  Axel S 2c88bdba19 Merge branch 'master' of http://178.32.216.95:3000/axels/TP3_MyNotes_Groupe4 1 anno fa
  Axel S d0a677dbf1 exigences 1 et 2 1 anno fa

+ 11 - 0
Resources/Page Object/PageAccueil.resource

@@ -6,6 +6,7 @@ Library       XML
 ${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
+${PAGEACCUEIL_CONNECTED_BUTTON_LOGOUT_LOCATOR} =    xpath=//*[@id="navbarSupportedContent"]/ul/li[2]/button
 *** Keywords ***
 
 Valider l'affichage de la page "Accueil" - non connecté
@@ -27,3 +28,13 @@ Cliquer sur "Login"
 Cliquer sur "Create an account"
     Click Element    ${CREATE_ACCOUNT_BUTTON_LOCATOR}
         
+
+ 
+
+Cliquer sur "Lougout" - user connecté
+    Click Element    ${PAGEACCUEIL_CONNECTED_BUTTON_LOGOUT_LOCATOR}
+   
+Valider l'affichage de la page "Accueil" - user connecté
+    ${page_url} =    Get Location
+    Should Be Equal As Strings    ${page_url}    https://practice.expandtesting.com/notes/app/
+    Wait Until Element Is Visible    ${PAGEACCUEIL_CONNECTED_BUTTON_LOGOUT_LOCATOR}

+ 11 - 1
Resources/Page Object/PageLogin.resource

@@ -9,6 +9,9 @@ ${LOGIN_BUTTON_LOCATOR}=    xpath=//*[@id="root"]/div/div/div/div/form/div[2]/bu
 ${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
+${MESSAGE_PWDREQUIRED_LOCATOR}=    xpath=//*[@id="root"]/div/div/div/div/form/div[1]/div[2]/div
+${MESSAGE_EMAILFORMAT_LOCATOR}=    xpath=//*[@id="root"]/div/div/div/div/form/div[1]/div[1]/div
+
 
 *** Keywords ***
 Vérifier l'affichage de la page "Login"
@@ -30,9 +33,16 @@ Cliquer sur le lien "Forgot Password"
     Click Element    ${FORGOT_PASSWORD_LINK_LOCATOR}
 
     
-Vérifier Login KO 
+Vérifier Login KO - email ou pwd incorrect
     ${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     ${Text_message_alerte}    Incorrect email address or password    ignorecase=true
+
+Vérifier Login KO - champ pwd vide
+    ${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_PWDREQUIRED_LOCATOR}
+    ${Text_message_alerte}=    Get Text    ${MESSAGE_PWDREQUIRED_LOCATOR}
+    Should Be Equal As Strings     ${Text_message_alerte}    Password is required    ignorecase=true

+ 7 - 7
Tests/MyNotes_Test_Ex1.robot

@@ -11,15 +11,15 @@ Documentation    Ex1:Un utilisateur ayant créé un compte avec un email et un m
 
 
 *** Variables ***
-@{LISTE_DONNEES_FORM_CREATION}=    ""    123456    jean artin    123456
+@{LISTE_DONNEES_FORM_CREATION}=    ${EMPTY}    123456    jean artin    123456
 # liste de données utilisées pour créer un compte: e-mail, password, nom, confirm password
 *** Test Cases ***
 Ex1-CT01
     #Authentification ok, user avec compte créé et login et mdp valides: saisie manuelle des identifiants
     [Tags]    CT01
-    ${RANDOM_EMAIL}=    Common.Create Random Email
+    ${Random_Email}=    Common.Create Random Email
     
-    ${LISTE_DONNEES_FORM_CREATION}[0]=  Set Variable     ${RANDOM_EMAIL} 
+    ${LISTE_DONNEES_FORM_CREATION}[0]=  Set Variable     ${Random_Email} 
     #on remplace le champ vide par l'email aleatoire qu'on vient de créer
     PageAccueil.Valider l'affichage de la page "Accueil" - non connecté
     PageCreateAccount.Créer un compte utilisateur avec email    @{LISTE_DONNEES_FORM_CREATION}
@@ -35,8 +35,8 @@ Ex1 - CT02-1
 
     [Tags]    CT02-1
 
-    ${RANDOM_EMAIL}=    Common.Create Random Email
-    ${LISTE_DONNEES_FORM_CREATION}[0]=  Set Variable     ${RANDOM_EMAIL} 
+    ${Random_Email}=    Common.Create Random Email
+    ${LISTE_DONNEES_FORM_CREATION}[0]=  Set Variable     ${Random_Email} 
     PageAccueil.Valider l'affichage de la page "Accueil" - non connecté
     PageCreateAccount.Créer un compte utilisateur avec email    @{LISTE_DONNEES_FORM_CREATION}
     PageCreateAccount.Acceder a la page loggin - compte créé
@@ -48,9 +48,9 @@ Ex1 - CT02-1
 Ex1 - CT02-2
 # Echec authentification: Email inexistant
     [Tags]    CT02-2
-    ${RANDOM_EMAIL}=    Common.Create Random Email
+    ${Random_Email}=    Common.Create Random Email
     #on crée un email qui ne sera associé à aucun compte 
-    @{Login_data}=    Create List     ${RANDOM_EMAIL}    1111111
+    @{Login_data}=    Create List     ${Random_Email}    1111111
 
     PageAccueil.Valider l'affichage de la page "Accueil" - non connecté
     PageAccueil.Cliquer sur "Login"

+ 32 - 0
Tests/MyNotes_Test_Ex2.robot

@@ -0,0 +1,32 @@
+*** Settings ***
+Library    String
+
+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    Ex2: Lors de l'authentification via email, si le champ mot de passe est vide, un message d'erreur est affiché sur le champ
+
+
+
+*** Test Cases ***
+
+Ex2 
+    [Tags]    CT01
+
+    PageAccueil.Valider l'affichage de la page "Accueil" - non connecté
+    PageAccueil.Cliquer sur "Login"
+    ${Random_Email}=    Common.Create Random Email
+    #on crée un email aleatoire juste pour remplir le champ
+    @{Login_data}=    Create List     ${Random_Email}    ${EMPTY}
+
+    PageLogin.Vérifier l'affichage de la page "Login"
+    PageLogin.Remplir le formulaire de login    @{Login_data}
+    
+    #on remplit le formulaire avec un email valide et on laise le champ password vide
+    PageLogin.Soumettre le formulaire de Login
+    PageLogin.Vérifier Login KO - champ pwd vide
+    
+