diff --git a/01_creation_departement_test.py b/01_creation_departement_test.py index 6093b7c..39a39f4 100644 --- a/01_creation_departement_test.py +++ b/01_creation_departement_test.py @@ -3,6 +3,10 @@ import unittest import time import subprocess import HtmlTestRunner +import createDepartement +import creationSiteDepartement +import deleteDepartement +import suppressionSiteDepartement from setting import ( SCODOC_ADMIN_ID, SCODOC_ADMIN_PASS, @@ -66,25 +70,20 @@ class PythonOrgSearch(unittest.TestCase): driver.find_element_by_id("DeleteDept").submit() driver.get(BASE_URL) self.assertTrue(NOM_DPT not in driver.page_source) - cmdProcess = [ - "./scriptDeleteDepartement.sh", - LINK_SCODOC_SERVER, - NOM_DPT, - ] - process = subprocess.Popen(cmdProcess) - process.wait() # ferme la fenetre à chaque fin de test - def tearDown(self): self.driver.close() if __name__ == "__main__": - cmdProcess = ["./scriptDeleteDepartement.sh", LINK_SCODOC_SERVER, NOM_DPT] - process = subprocess.Popen(cmdProcess) - process.wait() - cmdProcess = ["./scriptCreationDepartement.sh", LINK_SCODOC_SERVER, NOM_DPT] - process = subprocess.Popen(cmdProcess) - process.wait() - unittest.main(testRunner=HtmlTestRunner.HTMLTestRunner(output="./output")) \ No newline at end of file + deleteDepartement.main() + createDepartement.main() + suppressionSiteDepartement.main() + unittest.main( + testRunner=HtmlTestRunner.HTMLTestRunner( + report_name="01_création département", + output="./ResultatTest", + combine_reports=True, + ) + ) diff --git a/02_creation_formation_test.py b/02_creation_formation_test.py index 5288d9f..08eedf6 100644 --- a/02_creation_formation_test.py +++ b/02_creation_formation_test.py @@ -3,6 +3,9 @@ import unittest import time import subprocess import HtmlTestRunner +import createDepartement +import creationSiteDepartement +import deleteDepartement from setting import ( SCODOC_ADMIN_ID, SCODOC_ADMIN_PASS, @@ -251,32 +254,14 @@ class PythonOrgSearch(unittest.TestCase): if __name__ == "__main__": - cmdProcess = ["./scriptDeleteDepartement.sh", LINK_SCODOC_SERVER, NOM_DPT] - process = subprocess.Popen(cmdProcess) - process.wait() - cmdProcess = ["./scriptCreationDepartement.sh", LINK_SCODOC_SERVER, NOM_DPT] - process = subprocess.Popen(cmdProcess) - process.wait() - if NAVIGATEUR == "firefox": - driver = webdriver.Firefox() - else: - driver = webdriver.Chrome() - driver.get( - "https://" - + SCODOC_ADMIN_ID - + ":" - + SCODOC_ADMIN_PASS - + "@" - + BASE_NOT_SECURED_URL - + "force_admin_authentication" + deleteDepartement.main() + createDepartement.main() + creationSiteDepartement.main() + + unittest.main( + testRunner=HtmlTestRunner.HTMLTestRunner( + report_name="02_creation_formation_test", + output="./ResultatTest", + combine_reports=True, + ) ) - driver.get(BASE_URL + "scodoc_admin") - time.sleep(2) - select = Select(driver.find_element_by_id("CreateDept")) - select.select_by_visible_text(NOM_DPT) - driver.find_element_by_name("DeptId").submit() - time.sleep(1) - driver.find_element_by_id("tf_submit").click() - time.sleep(1) - driver.close() - unittest.main(testRunner=HtmlTestRunner.HTMLTestRunner(output="./output")) diff --git a/03_etudiant_test.py b/03_etudiant_test.py index d602d25..93b9a2c 100644 --- a/03_etudiant_test.py +++ b/03_etudiant_test.py @@ -2,6 +2,9 @@ import unittest import time import HtmlTestRunner import subprocess +import createDepartement +import creationSiteDepartement +import deleteDepartement from setting import ( SCODOC_ADMIN_ID, SCODOC_ADMIN_PASS, @@ -137,7 +140,6 @@ class PythonOrgSearch(unittest.TestCase): except: boutonInscrireIsNotPresent = True self.assertTrue(boutonInscrireIsNotPresent) - # Test Supprime un étudiant # @expected : Lors d'une recherche sur le nom de l'étudiant, aucun résultat apparait @@ -182,12 +184,9 @@ class PythonOrgSearch(unittest.TestCase): if __name__ == "__main__": - cmdProcess = ["./scriptDeleteDepartement.sh", LINK_SCODOC_SERVER, NOM_DPT] - process = subprocess.Popen(cmdProcess) - process.wait() - cmdProcess = ["./scriptCreationDepartement.sh", LINK_SCODOC_SERVER, NOM_DPT] - process = subprocess.Popen(cmdProcess) - process.wait() + deleteDepartement.main() + createDepartement.main() + creationSiteDepartement.main() cmdProcess = [ "./scriptExecution.sh", LINK_SCODOC_SERVER, @@ -196,4 +195,10 @@ if __name__ == "__main__": ] process = subprocess.Popen(cmdProcess) process.wait() - unittest.main(testRunner=HtmlTestRunner.HTMLTestRunner(output="./output")) \ No newline at end of file + unittest.main( + testRunner=HtmlTestRunner.HTMLTestRunner( + report_name="03_Etudiant_test", + output="./ResultatTest", + combine_reports=True, + ) + ) diff --git a/04_creation_absence_test.py b/04_creation_absence_test.py index 36c7bea..248a61d 100644 --- a/04_creation_absence_test.py +++ b/04_creation_absence_test.py @@ -3,6 +3,9 @@ import time import urllib.parse as urlparse import subprocess import HtmlTestRunner +import createDepartement +import creationSiteDepartement +import deleteDepartement from setting import ( SCODOC_ADMIN_ID, SCODOC_ADMIN_PASS, @@ -151,12 +154,9 @@ class PythonOrgSearch(unittest.TestCase): if __name__ == "__main__": - cmdProcess = ["./scriptDeleteDepartement.sh", LINK_SCODOC_SERVER, NOM_DPT] - process = subprocess.Popen(cmdProcess) - process.wait() - cmdProcess = ["./scriptCreationDepartement.sh", LINK_SCODOC_SERVER, NOM_DPT] - process = subprocess.Popen(cmdProcess) - process.wait() + deleteDepartement.main() + createDepartement.main() + creationSiteDepartement.main() cmdProcess = [ "./scriptExecution.sh", LINK_SCODOC_SERVER, @@ -165,4 +165,10 @@ if __name__ == "__main__": ] process = subprocess.Popen(cmdProcess) process.wait() - unittest.main(testRunner=HtmlTestRunner.HTMLTestRunner(output="./output")) \ No newline at end of file + unittest.main( + testRunner=HtmlTestRunner.HTMLTestRunner( + report_name="04_Absences tests", + output="./ResultatTest", + combine_reports=True, + ) + ) diff --git a/05_saisie_note_test.py b/05_saisie_note_test.py index 93667ac..848f9b9 100644 --- a/05_saisie_note_test.py +++ b/05_saisie_note_test.py @@ -3,6 +3,9 @@ import time import subprocess import urllib.parse as urlparse import HtmlTestRunner +import createDepartement +import creationSiteDepartement +import deleteDepartement from setting import ( SCODOC_ADMIN_ID, SCODOC_ADMIN_PASS, @@ -334,12 +337,9 @@ if __name__ == "__main__": driver = webdriver.Firefox() else: driver = webdriver.Chrome() - cmdProcess = ["./scriptDeleteDepartement.sh", LINK_SCODOC_SERVER, NOM_DPT] - process = subprocess.Popen(cmdProcess) - process.wait() - cmdProcess = ["./scriptCreationDepartement.sh", LINK_SCODOC_SERVER, NOM_DPT] - process = subprocess.Popen(cmdProcess) - process.wait() + deleteDepartement.main() + createDepartement.main() + creationSiteDepartement.main() cmdProcess = [ "./scriptExecution.sh", LINK_SCODOC_SERVER, @@ -396,4 +396,10 @@ if __name__ == "__main__": driver.find_element_by_id("tf_submit").click() driver.find_element_by_id("utilisateurs_Vue").click() driver.close() - unittest.main(testRunner=HtmlTestRunner.HTMLTestRunner(output="./output")) + unittest.main( + testRunner=HtmlTestRunner.HTMLTestRunner( + report_name="05_Saisie note tests", + output="./ResultatTest", + combine_reports=True, + ) + ) diff --git a/06_test_moyenne.py b/06_test_moyenne.py index 88e3042..72bddd9 100644 --- a/06_test_moyenne.py +++ b/06_test_moyenne.py @@ -3,6 +3,9 @@ import time import subprocess import urllib.parse as urlparse import HtmlTestRunner +import createDepartement +import creationSiteDepartement +import deleteDepartement from setting import ( SCODOC_ADMIN_ID, SCODOC_ADMIN_PASS, @@ -84,7 +87,7 @@ class PythonOrgSearch(unittest.TestCase): self.wait.until(EC.url_changes(URL)) driver.get(URL_SEMESTRE) noteBonne = True - #print(listeEtudiant) + # print(listeEtudiant) for etudiant in listeEtudiant: searchBar = driver.find_element_by_id("in-expnom") searchBar.send_keys(etudiant) @@ -335,12 +338,12 @@ class PythonOrgSearch(unittest.TestCase): float(MOY_UE1_EXC) * COEFF_UE1 + ((float(MOY_UE2) + float(moyenneBonusEtudiant1)) * COEFF_UE2) ) / (COEFF_UE1 + COEFF_UE2) - #print(format(moyEtudiant1, "2.2f")) - #print( + # print(format(moyEtudiant1, "2.2f")) + # print( # format( # float(driver.find_element_by_class_name("rcp_moy").text), "2.2f" # ) - #) + # ) if format(moyEtudiant1, "2.2f") != format( float(driver.find_element_by_class_name("rcp_moy").text), "2.2f" ): @@ -431,12 +434,9 @@ class PythonOrgSearch(unittest.TestCase): if __name__ == "__main__": - cmdProcess = ["./scriptDeleteDepartement.sh", LINK_SCODOC_SERVER, NOM_DPT] - process = subprocess.Popen(cmdProcess) - process.wait() - cmdProcess = ["./scriptCreationDepartement.sh", LINK_SCODOC_SERVER, NOM_DPT] - process = subprocess.Popen(cmdProcess) - process.wait() + deleteDepartement.main() + createDepartement.main() + creationSiteDepartement.main() cmdProcess = [ "./scriptExecution.sh", LINK_SCODOC_SERVER, @@ -445,4 +445,10 @@ if __name__ == "__main__": ] process = subprocess.Popen(cmdProcess) process.wait() - unittest.main(testRunner=HtmlTestRunner.HTMLTestRunner(output="./output")) \ No newline at end of file + unittest.main( + testRunner=HtmlTestRunner.HTMLTestRunner( + report_name="06_Moyenne tests", + output="./ResultatTest", + combine_reports=True, + ) + ) diff --git a/07_test_admission.py b/07_test_admission.py index 314b19e..0daf547 100644 --- a/07_test_admission.py +++ b/07_test_admission.py @@ -3,6 +3,9 @@ import time import subprocess import urllib.parse as urlparse import HtmlTestRunner +import createDepartement +import creationSiteDepartement +import deleteDepartement from setting import ( SCODOC_ADMIN_ID, SCODOC_ADMIN_PASS, @@ -219,12 +222,9 @@ class PythonOrgSearch(unittest.TestCase): if __name__ == "__main__": - cmdProcess = ["./scriptDeleteDepartement.sh", LINK_SCODOC_SERVER, NOM_DPT] - process = subprocess.Popen(cmdProcess) - process.wait() - cmdProcess = ["./scriptCreationDepartement.sh", LINK_SCODOC_SERVER, NOM_DPT] - process = subprocess.Popen(cmdProcess) - process.wait() + deleteDepartement.main() + createDepartement.main() + creationSiteDepartement.main() cmdProcess = [ "./scriptExecution.sh", LINK_SCODOC_SERVER, @@ -233,4 +233,10 @@ if __name__ == "__main__": ] process = subprocess.Popen(cmdProcess) process.wait() - unittest.main(testRunner=HtmlTestRunner.HTMLTestRunner(output="./output")) \ No newline at end of file + unittest.main( + testRunner=HtmlTestRunner.HTMLTestRunner( + report_name="07_Admission et passages tests", + output="./ResultatTest", + combine_reports=True, + ) + ) diff --git a/ResultatTest/01_création département_2021-06-24_15-02-41.html b/ResultatTest/01_création département_2021-06-24_15-02-41.html new file mode 100644 index 0000000..2ef3d2d --- /dev/null +++ b/ResultatTest/01_création département_2021-06-24_15-02-41.html @@ -0,0 +1,84 @@ + + +
+Start Time: 2021-06-24 15:02:41
+Duration: 39.96 s
+Summary: Total: 3, Pass: 3
+__main__.PythonOrgSearch | +Status | ++ |
---|---|---|
test_connexion_admin | ++ Pass + | ++ | +
test_create_departement | ++ Pass + | ++ | +
test_delete_departement | ++ Pass + | ++ | +
+ Total: 3, Pass: 3 -- Duration: 39.96 s + | +