correction idé

This commit is contained in:
Aurélien Plancke 2021-06-25 00:45:50 +02:00
parent 177aa06f38
commit 137bc378b8
8 changed files with 24 additions and 24 deletions

View File

@ -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)

View File

@ -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)

View File

@ -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)

View File

@ -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)

View File

@ -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(

View File

@ -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()

View File

@ -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:

View File

@ -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()