diff --git a/02_creation_formation_test.py b/02_creation_formation_test.py index 13a88b9..adde629 100644 --- a/02_creation_formation_test.py +++ b/02_creation_formation_test.py @@ -38,10 +38,10 @@ class PythonOrgSearch(unittest.TestCase): else: self.driver = webdriver.Chrome() auth_page = SCHEMA + "://" + BASE_SSH_URL + "auth/login?next=%2F" + next_page - driver.get(auth_page) - driver.find_element_by_id("user_name").send_keys(SCODOC_ADMIN_ID) - driver.find_element_by_id("password").send_keys(SCODOC_ADMIN_PASS) - driver.find_element_by_id("submit").click() + self.driver.get(auth_page) + self.driver.find_element_by_id("user_name").send_keys(SCODOC_ADMIN_ID) + self.driver.find_element_by_id("password").send_keys(SCODOC_ADMIN_PASS) + self.driver.find_element_by_id("submit").click() self.driver.get(SCHEMA + "://" + BASE_URL) # Test Creer une formation diff --git a/03_etudiant_test.py b/03_etudiant_test.py index b04e3d0..3e953d3 100644 --- a/03_etudiant_test.py +++ b/03_etudiant_test.py @@ -42,10 +42,10 @@ class PythonOrgSearch(unittest.TestCase): else: self.driver = webdriver.Chrome() auth_page = SCHEMA + "://" + BASE_SSH_URL + "auth/login?next=%2F" + next_page - driver.get(auth_page) - driver.find_element_by_id("user_name").send_keys(SCODOC_ADMIN_ID) - driver.find_element_by_id("password").send_keys(SCODOC_ADMIN_PASS) - driver.find_element_by_id("submit").click() + self.driver.get(auth_page) + self.driver.find_element_by_id("user_name").send_keys(SCODOC_ADMIN_ID) + self.driver.find_element_by_id("password").send_keys(SCODOC_ADMIN_PASS) + self.driver.find_element_by_id("submit").click() self.driver.get(SCHEMA + "://" + BASE_URL) # Test : creer un etudiant et verifie si sa fiche etudiante est creee diff --git a/04_creation_absence_test.py b/04_creation_absence_test.py index f8e20ca..15b4eab 100644 --- a/04_creation_absence_test.py +++ b/04_creation_absence_test.py @@ -39,10 +39,10 @@ class PythonOrgSearch(unittest.TestCase): else: self.driver = webdriver.Chrome() auth_page = SCHEMA + "://" + BASE_SSH_URL + "auth/login?next=%2F" + next_page - driver.get(auth_page) - driver.find_element_by_id("user_name").send_keys(SCODOC_ADMIN_ID) - driver.find_element_by_id("password").send_keys(SCODOC_ADMIN_PASS) - driver.find_element_by_id("submit").click() + self.driver.get(auth_page) + self.driver.find_element_by_id("user_name").send_keys(SCODOC_ADMIN_ID) + self.driver.find_element_by_id("password").send_keys(SCODOC_ADMIN_PASS) + self.driver.find_element_by_id("submit").click() self.driver.get(SCHEMA + "://" + BASE_URL) def test_010_trouver_etudiant(self): diff --git a/05_saisie_note_test.py b/05_saisie_note_test.py index 2b79657..ce70d57 100644 --- a/05_saisie_note_test.py +++ b/05_saisie_note_test.py @@ -40,37 +40,25 @@ isEns = False class PythonOrgSearch(unittest.TestCase): # Permet de se connecter et se remettre sur la page d'accueil avant chaque test def setUp(self): + next_page = "" if NAVIGATEUR == "firefox": self.driver = webdriver.Firefox() else: self.driver = webdriver.Chrome() self.wait = WebDriverWait(self.driver, 10) + auth_page = SCHEMA + "://" + BASE_SSH_URL + "auth/login?next=%2F" + next_page + self.driver.get(auth_page) if isAdmin: - self.driver.get( - SCHEMA - + "://" - + SCODOC_ADMIN_ID - + ":" - + SCODOC_ADMIN_PASS - + "@" - + BASE_SSH_URL - + "force_admin_authentication" - ) - else: - self.driver.get(SCHEMA + "://" + BASE_URL + NOM_DPT + "/Scolarite") - if isChef: - self.driver.find_element_by_name("__ac_name").send_keys(SCODOC_CHEF_ID) - self.driver.find_element_by_name("__ac_password").send_keys( - SCODOC_CHEF_PASS - ) - time.sleep(3) - self.driver.find_element_by_name("submit").click() - elif isEns: - self.driver.find_element_by_name("__ac_name").send_keys(SCODOC_ENS_ID) - self.driver.find_element_by_name("__ac_password").send_keys( - SCODOC_ENS_PASS - ) - self.driver.find_element_by_name("submit").click() + self.driver.find_element_by_id("user_name").send_keys(SCODOC_ADMIN_ID) + self.driver.find_element_by_id("password").send_keys(SCODOC_ADMIN_PASS) + elif isChef: + self.driver.find_element_by_id("user_name").send_keys(SCODOC_CHEF_ID) + self.driver.find_element_by_id("password").send_keys(SCODOC_CHEF_PASS) + elif isEns: + self.driver.find_element_by_id("user_name").send_keys(SCODOC_ENS_ID) + self.driver.find_element_by_id("password").send_keys(SCODOC_ENS_PASS) + self.driver.find_element_by_id("submit").click() + self.driver.get(SCHEMA + "://" + BASE_URL) # Test : VĂ©rifie s'il y a un semestre en cours # @expected : La class listesems n'est pas vide et contient "Session en cours"