preparation test jury

This commit is contained in:
Aurélien Plancke 2021-06-11 16:04:32 +02:00
parent 568f6f3813
commit 34216fda92

View File

@ -23,6 +23,11 @@ from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.support.ui import Select, WebDriverWait from selenium.webdriver.support.ui import Select, WebDriverWait
from selenium.webdriver.support.select import Select from selenium.webdriver.support.select import Select
URL_ETUDIANT = ""
URL_DECISION = ""
class PythonOrgSearch(unittest.TestCase): class PythonOrgSearch(unittest.TestCase):
# Permet de se connecter et se remettre sur la page d'accueil avant chaque test # Permet de se connecter et se remettre sur la page d'accueil avant chaque test
def setUp(self): def setUp(self):
@ -42,10 +47,160 @@ class PythonOrgSearch(unittest.TestCase):
+ "force_admin_authentication" + "force_admin_authentication"
) )
def test_010_decision_modifiable_sur_fiche_etudiant(self): def test_010_etudiantS1_assidu_avec_moy_admis(self):
driver = self.driver
url = self.url
driver.get(url)
searchBar = driver.find_element_by_id("in-expnom")
searchBar.send_keys("EID1")
searchBar.submit()
time.sleep(5)
URL_ETUDIANT = driver.current_url
driver.find_element_by_xpath("//a[contains(text(),'Scolarité')]").click()
driver.find_element_by_xpath(
"//a[contains(@href,'formsemestre_validation_etud_form?')]"
).click()
self.wait.until(EC.url_changes(URL_ETUDIANT))
URL_DECISION = driver.current_url
# TODOOOOO
driver.find_element_by_id("subut").click()
driver.get(URL_ETUDIANT)
assertTrue("ADM" in driver.find_elements_by_id("rcp_dec"))
def test_020_etudiantS1_non_assidu_avec_moy_semestre_non_valide(self):
driver = self.driver
url = self.url
driver.get(url)
searchBar = driver.find_element_by_id("in-expnom")
searchBar.send_keys("EID1")
searchBar.submit()
time.sleep(5)
URL_ETUDIANT = driver.current_url
driver.find_element_by_xpath("//a[contains(text(),'Scolarité')]").click()
driver.find_element_by_xpath(
"//a[contains(@href,'formsemestre_validation_etud_form?')]"
).click()
self.wait.until(EC.url_changes(URL_ETUDIANT))
URL_DECISION = driver.current_url
# TODOOOOO
driver.find_element_by_id("subut").click()
driver.get(URL_ETUDIANT)
assertTrue("ATJ" in driver.find_elements_by_id("rcp_dec"))
def test_030_etudiantS1_assidu_sous_la_moy_semestre_valide(self):
driver = self.driver
url = self.url
driver.get(url)
searchBar = driver.find_element_by_id("in-expnom")
searchBar.send_keys("EID4")
searchBar.submit()
time.sleep(5)
URL_ETUDIANT = driver.current_url
driver.find_element_by_xpath("//a[contains(text(),'Scolarité')]").click()
driver.find_element_by_xpath(
"//a[contains(@href,'formsemestre_validation_etud_form?')]"
).click()
self.wait.until(EC.url_changes(URL_ETUDIANT))
URL_DECISION = driver.current_url
# TODOOOOOOOO
driver.find_element_by_id("subut").click()
driver.get(URL_ETUDIANT)
assertTrue("ATB" in driver.find_elements_by_id("rcp_dec"))
driver.find_element_by_xpath("//a[contains(text(),'Scolarité')]").click()
driver.find_element_by_xpath(
"//a[contains(@href,'formsemestre_validation_etud_form?')]"
).click()
self.wait.until(EC.url_changes(URL_ETUDIANT))
URL_DECISION = driver.current_url
# TODOOOOOOOO
driver.find_element_by_id("subut").click()
driver.get(URL_ETUDIANT)
assertTrue("ATB" in driver.find_elements_by_id("rcp_dec"))
def test_040_etudiantS1_non_assidu_sous_la_moy_semestre_valide(self):
driver = self.driver
url = self.url
driver.get(url)
searchBar = driver.find_element_by_id("in-expnom")
searchBar.send_keys("EID4")
searchBar.submit()
time.sleep(5)
URL_ETUDIANT = driver.current_url
driver.find_element_by_xpath("//a[contains(text(),'Scolarité')]").click()
driver.find_element_by_xpath(
"//a[contains(@href,'formsemestre_validation_etud_form?')]"
).click()
self.wait.until(EC.url_changes(URL_ETUDIANT))
URL_DECISION = driver.current_url
# TODOOOOOOOO
driver.find_element_by_id("subut").click()
driver.get(URL_ETUDIANT)
assertTrue("ATJ" in driver.find_elements_by_id("rcp_dec"))
driver.find_element_by_xpath("//a[contains(text(),'Scolarité')]").click()
driver.find_element_by_xpath(
"//a[contains(@href,'formsemestre_validation_etud_form?')]"
).click()
self.wait.until(EC.url_changes(URL_ETUDIANT))
URL_DECISION = driver.current_url
# TODOOOOOOOO
driver.find_element_by_id("subut").click()
driver.get(URL_ETUDIANT)
assertTrue("ATB" in driver.find_elements_by_id("rcp_dec"))
def test_050_calcul_automatiqueS2_jury(self):
driver = self.driver
url = self.url
driver.get(url)
driver.find_element_by_link_text("semestre 2").click()
self.wait.until(EC.url_changes(url))
urlTmp = driver.current_url
driver.find_element_by_xpath("//a[contains(text(),'Jury')]").click()
driver.find_element_by_xpath(
"//a[contains(@href,'formsemestre_recapcomplet?')]"
).click()
self.wait.until(EC.url_changes(urlTmp))
urlTmp = driver.current_url
driver.find_element_by_xpath(
"//a[contains(@href,'formsemestre_validation_auto?')]"
).click()
self.wait.until(EC.url_changes(urlTmp))
urlTmp = driver.current_url
driver.find_element_by_xpath("//input[@type='submit']").click()
self.wait.until(EC.url_changes(urlTmp))
searchBar = driver.find_element_by_id("in-expnom")
searchBar.send_keys("EID7")
searchBar.submit()
time.sleep(5)
assertTrue("ADM" in driver.find_elements_by_id("rcp_dec"))
searchBar = driver.find_element_by_id("in-expnom")
searchBar.send_keys("EID10")
searchBar.submit()
time.sleep(5)
assertTrue("en cours" in driver.find_elements_by_id("rcp_dec"))
def test_060_declarer_defaillance(self):
driver = self.driver
url = self.url
driver.get(url)
searchBar = driver.find_element_by_id("in-expnom")
searchBar.send_keys("EID10")
searchBar.submit()
time.sleep(5)
URL_ETUDIANT = driver.current_url
driver.find_element_by_xpath("//a[contains(text(),'Scolarité')]").click()
driver.find_element_by_xpath("//a[contains(@href,'formDef?')]").click()
self.wait.until(EC.url_changes(URL_ETUDIANT))
input = driver.find_element_by_name("event_date")
input.clear()
input.send_keys("11/06/2021")
driver.find_element_by_xpath("//input[@type='submit']").click()
driver.get(URL_ETUDIANT)
self.assertTrue("Défaillant" in driver.page_source)
def tearDown(self): def tearDown(self):
self.driver.close() self.driver.close()
if __name__ == "__main__": if __name__ == "__main__":
cmdProcess = ["./scriptCreationDepartement.sh", LINK_SCODOC_SERVER, NOM_DPT] cmdProcess = ["./scriptCreationDepartement.sh", LINK_SCODOC_SERVER, NOM_DPT]
process = subprocess.Popen(cmdProcess) process = subprocess.Popen(cmdProcess)