import unittest import time import urllib.parse as urlparse from urllib.parse import parse_qs from selenium import webdriver from selenium.webdriver.common.keys import Keys from selenium.webdriver.support import expected_conditions as EC from selenium.webdriver.support.ui import Select, WebDriverWait from selenium.webdriver.support.select import Select SCODOC_ID = "enseignantUS" SCODOC_PASS = "enseignant@" nomDPT = "AurelienUS" class PythonOrgSearch(unittest.TestCase): # Permet de se connecter et se remettre sur la page d'accueil avant chaque test def setUp(self): self.driver = webdriver.Firefox() self.wait = WebDriverWait(self.driver, 10) self.driver.get("https://scodoc-dev-iutinfo.univ-lille.fr/ScoDoc/") self.driver.find_element_by_id("name").send_keys(SCODOC_ID) self.driver.find_element_by_id("password").send_keys(SCODOC_PASS) self.driver.find_element_by_id("submit").click() def test_semestre_en_cours(self): driver = self.driver driver.get( "https://scodoc-dev-iutinfo.univ-lille.fr/ScoDoc/" + nomDPT + "/Scolarite" ) time.sleep(10) self.assertTrue("Sessions en cours" in driver.find_element_by_name("listsems")) # def test_entree_note(self): # ferme la fenetre def tearDown(self): self.driver.close() if __name__ == "__main__": unittest.main()