From 137bc378b8c5a9dea20ab6dd7737cce3241ec760 Mon Sep 17 00:00:00 2001 From: aurelien Date: Fri, 25 Jun 2021 00:45:50 +0200 Subject: [PATCH] =?UTF-8?q?correction=20id=C3=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 01_creation_departement_test.py | 6 +++--- 02_creation_formation_test.py | 6 +++--- 03_etudiant_test.py | 2 +- 04_creation_absence_test.py | 12 ++++++------ 05_saisie_note_test.py | 10 +++++----- 06_test_moyenne.py | 2 +- UserStoryNew.yaml | 6 +++--- suppressionSiteDepartement.py | 4 ++-- 8 files changed, 24 insertions(+), 24 deletions(-) diff --git a/01_creation_departement_test.py b/01_creation_departement_test.py index 2137922..c5e3954 100644 --- a/01_creation_departement_test.py +++ b/01_creation_departement_test.py @@ -52,7 +52,7 @@ class PythonOrgSearch(unittest.TestCase): driver = self.driver driver.get(BASE_URL + "/scodoc_admin") time.sleep(2) - select = Select(driver.find_element_by_id("CreateDept")) + select = Select(driver.find_element_by_id("create-dept")) select.select_by_visible_text(NOM_DPT) driver.find_element_by_name("DeptId").submit() time.sleep(1) @@ -65,9 +65,9 @@ class PythonOrgSearch(unittest.TestCase): def test_delete_departement(self): driver = self.driver driver.get(BASE_URL + "/scodoc_admin") - select = Select(driver.find_element_by_id("DeleteDept")) + select = Select(driver.find_element_by_id("delete-dept")) select.select_by_visible_text(NOM_DPT) - driver.find_element_by_id("DeleteDept").submit() + select.submit() driver.get(BASE_URL) self.assertTrue(NOM_DPT not in driver.page_source) diff --git a/02_creation_formation_test.py b/02_creation_formation_test.py index 08eedf6..1c3f028 100644 --- a/02_creation_formation_test.py +++ b/02_creation_formation_test.py @@ -53,9 +53,9 @@ class PythonOrgSearch(unittest.TestCase): driver = self.driver global URL driver.get(URL) - driver.find_element_by_id("ProgrammesLink").click() + driver.find_element_by_id("link-programmes").click() URL = driver.current_url - driver.find_element_by_id("create_formation_link").click() + driver.find_element_by_id("link-create-formation").click() self.wait.until(EC.url_changes(URL)) driver.find_element_by_id("tf_acronyme").send_keys(ACRONYME_FORMATION) driver.find_element_by_id("tf_titre").send_keys("TEST") @@ -107,7 +107,7 @@ class PythonOrgSearch(unittest.TestCase): driver.find_element_by_id("tf_titre_officiel").send_keys("formation de test") driver.find_element_by_id("tf_submit").click() try: - driver.find_element_by_id("errorMessage") + driver.find_element_by_class_name("error-message") except NoSuchElementException: self.assertFalse(True) self.assertTrue(True) diff --git a/03_etudiant_test.py b/03_etudiant_test.py index 93b9a2c..fed8d4c 100644 --- a/03_etudiant_test.py +++ b/03_etudiant_test.py @@ -57,7 +57,7 @@ class PythonOrgSearch(unittest.TestCase): def test_01_creation_etudiant(self): driver = self.driver global URL - driver.find_element_by_id("link_create_etudident").click() + driver.find_element_by_id("link-create-student").click() self.wait.until(EC.url_changes(URL)) URL = driver.current_url driver.find_element_by_id("tf_nom").send_keys(nomEtu) diff --git a/04_creation_absence_test.py b/04_creation_absence_test.py index 8a4ce5e..ac6b395 100644 --- a/04_creation_absence_test.py +++ b/04_creation_absence_test.py @@ -65,7 +65,7 @@ class PythonOrgSearch(unittest.TestCase): def test_020_ajout_absence_non_justifiee(self): driver = self.driver global URL - driver.find_element_by_id("ajout_Absence").click() + driver.find_element_by_id("add-absence").click() driver.find_element_by_name("datedebut").send_keys(dateDebutAbsenceNonJustifiee) driver.find_element_by_id("butsubmit").submit() time.sleep(1) @@ -87,7 +87,7 @@ class PythonOrgSearch(unittest.TestCase): def test_021_ajout_absence_justifiee(self): driver = self.driver global URL - driver.find_element_by_id("ajout_Absence").click() + driver.find_element_by_id("add-absence").click() driver.find_element_by_name("datedebut").send_keys(dateDebutAbsenceJustifiee) driver.find_element_by_name("estjust").click() driver.find_element_by_id("butsubmit").submit() @@ -107,7 +107,7 @@ class PythonOrgSearch(unittest.TestCase): def test_022_ajout_justification(self): driver = self.driver global URL - driver.find_element_by_id("justifier_Absence").click() + driver.find_element_by_id("justify-absence").click() driver.find_element_by_name("datedebut").send_keys(dateDebutAbsenceJustifiee) driver.find_element_by_name("description").send_keys("Un test selenium") driver.find_element_by_xpath("//input[@value='Envoyer']").click() @@ -129,16 +129,16 @@ class PythonOrgSearch(unittest.TestCase): def test_024_supprimer_absence(self): driver = self.driver global URL - driver.find_element_by_id("supprimer_Absence").click() + driver.find_element_by_id("delete-absence").click() driver.find_element_by_name("datedebut").send_keys(dateDebutAbsenceJustifiee) driver.find_element_by_xpath("//input[@value='Supprimer les absences']").click() self.wait.until(EC.url_changes(URL)) self.assertTrue("Annulation sur 2 demi-journées " in driver.page_source) - driver.find_element_by_id("supprimer_Absence").click() + driver.find_element_by_id("delete-absence").click() driver.find_element_by_name("datedebut").send_keys(dateDebutAbsenceNonJustifiee) driver.find_element_by_xpath("//input[@value='Supprimer les absences']").click() self.wait.until(EC.url_changes(URL)) - driver.find_element_by_id("afficher_Liste_Absence").click() + driver.find_element_by_id("display-list-absence").click() self.assertTrue("Pas d'absences justifiées" in driver.page_source) self.assertTrue("Pas d'absences non justifiées" in driver.page_source) diff --git a/05_saisie_note_test.py b/05_saisie_note_test.py index c35c018..da736fb 100644 --- a/05_saisie_note_test.py +++ b/05_saisie_note_test.py @@ -359,7 +359,7 @@ if __name__ == "__main__": + "force_admin_authentication" ) driver.get(BASE_URL + NOM_DPT + "/Scolarite") - driver.find_element_by_id("utilisateurs_Vue").click() + driver.find_element_by_id("link-view-users").click() time.sleep(5) noms = driver.find_elements_by_class_name("nom_fmt") chefCree = False @@ -372,7 +372,7 @@ if __name__ == "__main__": if not chefCree: time.sleep(2) constructValue = "Ens" + NOM_DPT - driver.find_element_by_id("creer_Utilisateur").click() + driver.find_element_by_id("create-user").click() driver.find_element_by_id("tf_nom").send_keys(SCODOC_CHEF_ID) driver.find_element_by_id("tf_user_name").send_keys(SCODOC_CHEF_ID) driver.find_element_by_id("tf_prenom").send_keys("chef") @@ -381,11 +381,11 @@ if __name__ == "__main__": driver.find_element_by_xpath("//input[@value='" + constructValue + "']").click() driver.find_element_by_xpath("//input[@name='force:list']").click() driver.find_element_by_id("tf_submit").click() - driver.find_element_by_id("utilisateurs_Vue").click() + driver.find_element_by_id("link-view-users").click() if not ensCree: time.sleep(2) constructValue = "Ens" + NOM_DPT - driver.find_element_by_id("creer_Utilisateur").click() + driver.find_element_by_id("create-user").click() driver.find_element_by_id("tf_nom").send_keys(SCODOC_ENS_ID) driver.find_element_by_id("tf_user_name").send_keys(SCODOC_ENS_ID) driver.find_element_by_id("tf_prenom").send_keys(PRENOM_ENS) @@ -394,7 +394,7 @@ if __name__ == "__main__": driver.find_element_by_xpath("//input[@value='" + constructValue + "']").click() driver.find_element_by_xpath("//input[@name='force:list']").click() driver.find_element_by_id("tf_submit").click() - driver.find_element_by_id("utilisateurs_Vue").click() + driver.find_element_by_id("link-view-users").click() driver.close() unittest.main( testRunner=HtmlTestRunner.HTMLTestRunner( diff --git a/06_test_moyenne.py b/06_test_moyenne.py index b3e666e..f075746 100644 --- a/06_test_moyenne.py +++ b/06_test_moyenne.py @@ -166,7 +166,7 @@ class PythonOrgSearch(unittest.TestCase): driver = self.driver url = self.url driver.get(url) - driver.find_element_by_id("ProgrammesLink").click() + driver.find_element_by_id("link-programmes").click() driver.find_element_by_id("titre_DUT Info").click() driver.find_element_by_xpath("//span[contains(text(),'M1101')]").click() driver.find_element_by_id("tf_coefficient").clear() diff --git a/UserStoryNew.yaml b/UserStoryNew.yaml index 1155ba8..c5fce02 100644 --- a/UserStoryNew.yaml +++ b/UserStoryNew.yaml @@ -144,7 +144,7 @@ test9: champsModifie: null champsInteractions: [ - link_create_etudident, + link-create-student, tf_nom, tf_prenom, tf_annee, @@ -246,7 +246,7 @@ test17: etat: *EtudiantCreated page: *Absence champsModifie: null - champsInteractions: [justifier_Absence, datedebut, description] + champsInteractions: [justify-absence, datedebut, description] role: *Secretaire createur: Aurélien test18: @@ -256,7 +256,7 @@ test18: etat: *EtudiantCreated page: *Absence champsModifie: null - champsInteractions: [supprimer_Absence, datedebut, afficher_Liste_Absence] + champsInteractions: [delete-absence, datedebut, display-list-absence] role: *Secretaire createur: Aurélien test19: diff --git a/suppressionSiteDepartement.py b/suppressionSiteDepartement.py index 12d79e1..13d08cb 100644 --- a/suppressionSiteDepartement.py +++ b/suppressionSiteDepartement.py @@ -42,9 +42,9 @@ def main(): driver.get(BASE_URL + "scodoc_admin") time.sleep(2) try: - select = Select(driver.find_element_by_id("DeleteDept")) + select = Select(driver.find_element_by_id("delete-dept")) select.select_by_visible_text(NOM_DPT) - driver.find_element_by_id("DeleteDept").submit() + driver.find_element_by_id("delete-dept").submit() driver.close() except NoSuchElementException: driver.close() \ No newline at end of file