fix bug ajout enseignant

This commit is contained in:
Aurélien Plancke 2021-06-03 15:34:04 +02:00
parent 9fe52f9960
commit 92f7bda362
2 changed files with 41 additions and 27 deletions

View File

@ -26,7 +26,7 @@ from selenium.webdriver.support.select import Select
URL_MATIERE = ""
URL_SEMESTRE = ""
URL = BASE_URL + NOM_DPT + "/Scolarite"
PRENOM_ENS = "Ens"
# Prérequis
class PythonOrgSearch(unittest.TestCase):
# Permet de se connecter et se remettre sur la page d'accueil avant chaque test
@ -96,9 +96,21 @@ class PythonOrgSearch(unittest.TestCase):
URL_MATIERE = driver.current_url
driver.find_element_by_partial_link_text("modifier les enseignants").click()
time.sleep(1)
driver.find_element_by_id("ens_id").send_keys("ENSEIGNANT Test (enseignantUS)")
constructIDEns = (
SCODOC_ENS_ID.upper()
+ " "
+ PRENOM_ENS
+ " ("
+ SCODOC_ENS_ID.lower()
+ ")"
)
print(constructIDEns)
driver.find_element_by_id("ens_id").send_keys(constructIDEns)
time.sleep(5)
driver.find_element_by_id("tf_submit").click()
time.sleep(1)
driver.get(URL_MATIERE)
self.assertTrue("Enseignants du" in driver.page_source)
self.assertTrue(SCODOC_ENS_ID in driver.page_source)
@ -124,6 +136,7 @@ class PythonOrgSearch(unittest.TestCase):
time.sleep(1)
driver.find_element_by_link_text("Créer nouvelle évaluation").click()
time.sleep(1)
driver.find_element_by_name("jour").clear()
driver.find_element_by_name("jour").send_keys("31/05/2021")
driver.find_element_by_id("tf_description").send_keys(descriptionInterrogation)
driver.find_element_by_id("tf_coefficient").send_keys("2")
@ -148,7 +161,8 @@ class PythonOrgSearch(unittest.TestCase):
driver = self.driver
global URL_MATIERE
driver.get(URL_MATIERE)
time.sleep(1)
print(URL_MATIERE)
time.sleep(10)
driver.find_element_by_class_name("notes_img").click()
time.sleep(1)
element = driver.find_element_by_class_name("note")
@ -312,9 +326,9 @@ if __name__ == "__main__":
chefCree = False
ensCree = False
for nom in noms:
if(nom.text.lower() == SCODOC_CHEF_ID.lower()):
if nom.text.lower() == SCODOC_CHEF_ID.lower():
chefCree = True
if(nom.text.lower() == SCODOC_ENS_ID.lower()):
if nom.text.lower() == SCODOC_ENS_ID.lower():
ensCree = True
if not chefCree:
time.sleep(5)
@ -335,7 +349,7 @@ if __name__ == "__main__":
driver.find_element_by_id("creer_Utilisateur").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("ens")
driver.find_element_by_id("tf_prenom").send_keys(PRENOM_ENS)
driver.find_element_by_id("tf_passwd").send_keys(SCODOC_ENS_PASS)
driver.find_element_by_id("tf_passwd2").send_keys(SCODOC_ENS_PASS)
driver.find_element_by_xpath("//input[@value='" + constructValue + "']").click()
@ -343,4 +357,4 @@ if __name__ == "__main__":
driver.find_element_by_id("tf_submit").click()
driver.find_element_by_id("utilisateurs_Vue").click()
driver.close()
unittest.main(warnings='ignore')
unittest.main(warnings="ignore")

Binary file not shown.