Compare commits

..

No commits in common. "491c50ebc0d372052a22de461775d61d84885373" and "545be29ac69a9151e9e58b32ef30ac7e9556a17b" have entirely different histories.

9 changed files with 51 additions and 39 deletions

3
.gitignore vendored
View File

@ -3,5 +3,4 @@ settings.json
.env
*__pycache__*
*__pycache__/*
geckodriver.log
*/output/*
geckodriver.log

View File

@ -2,7 +2,6 @@
import unittest
import time
import subprocess
import HtmlTestRunner
from setting import (
SCODOC_ADMIN_ID,
SCODOC_ADMIN_PASS,
@ -87,4 +86,4 @@ if __name__ == "__main__":
cmdProcess = ["./scriptCreationDepartement.sh", LINK_SCODOC_SERVER, NOM_DPT]
process = subprocess.Popen(cmdProcess)
process.wait()
unittest.main(testRunner=HtmlTestRunner.HTMLTestRunner(output="./output"))
unittest.main()

View File

@ -2,7 +2,6 @@
import unittest
import time
import subprocess
import HtmlTestRunner
from setting import (
SCODOC_ADMIN_ID,
SCODOC_ADMIN_PASS,
@ -119,14 +118,17 @@ class PythonOrgSearch(unittest.TestCase):
driver.find_element_by_id(idTitre).click()
self.wait.until(EC.url_changes(URL))
driver.find_element_by_xpath("//a[contains(@href,'ue_create?')]").click()
driver.find_element_by_id("tf_titre").send_keys("UE TEST")
driver.find_element_by_id("tf_acronyme").send_keys("TEST")
driver.find_element_by_id("tf_submit").click()
driver.find_element_by_id('tf_titre').send_keys("UE TEST")
driver.find_element_by_id('tf_acronyme').send_keys("TEST")
driver.find_element_by_id('tf_submit').click()
time.sleep(1)
driver.get(URL)
driver.find_element_by_id(idTitre).click()
self.wait.until(EC.url_changes(URL))
self.assertTrue("TEST UE TEST" in driver.page_source)
self.assertTrue(
"TEST UE TEST"
in driver.page_source
)
driver.get(URL)
# Test : Ajout d'une matière dans la formation
@ -136,19 +138,16 @@ class PythonOrgSearch(unittest.TestCase):
global URL
nomMat = "unematieretest"
driver.get(URL)
time.sleep(3)
idTitre = "titre_" + ACRONYME_FORMATION
driver.find_element_by_id(idTitre).click()
self.wait.until(EC.url_changes(URL))
time.sleep(3)
driver.find_element_by_xpath("//a[contains(@href,'matiere_create?')]").click()
driver.find_element_by_id("tf_titre").send_keys(nomMat)
driver.find_element_by_id("tf_numero").send_keys("1")
driver.find_element_by_id("tf_submit").click()
time.sleep(3)
driver.find_element_by_id('tf_titre').send_keys(nomMat)
driver.find_element_by_id('tf_numero').send_keys("1")
driver.find_element_by_id('tf_submit').click()
time.sleep(1)
driver.get(URL)
driver.find_element_by_id(idTitre).click()
time.sleep(3)
self.wait.until(EC.url_changes(URL))
elements = driver.find_elements_by_xpath("//a[contains(@href,'matiere_edit?')]")
matIsPresent = False
@ -179,7 +178,6 @@ class PythonOrgSearch(unittest.TestCase):
driver.get(URL)
self.assertTrue((NOM_DPT.upper() + "-" + "DUT" + "--") in driver.page_source)
# Test : Dupplique une formation sous une nouvelle version
# @expected : La formation est dupliquée et à la version "2"
def test_017_creer_nouvelle_version_formation(self):
@ -190,19 +188,16 @@ class PythonOrgSearch(unittest.TestCase):
driver.find_element_by_id(idTitre).click()
self.wait.until(EC.url_changes(URL))
tmpurl = driver.current_url
driver.find_element_by_xpath(
"//a[contains(@href,'formation_create_new_version?')]"
).click()
driver.find_element_by_xpath("//a[contains(@href,'formation_create_new_version?')]").click()
self.wait.until(EC.url_changes(tmpurl))
self.assertTrue("Nouvelle version !" in driver.page_source)
driver.get(URL)
driver.get(URL)
elements = driver.find_elements_by_class_name("version")
versionIsPresent = False
for element in elements:
if element.text == "2":
if element.text == '2':
versionIsPresent = True
self.assertTrue(versionIsPresent)
# Test : Supprime une formation après avoir supprimé les semestres qui y sont rattachés
# @expected : La formation n'apparait plus dans le tableau des formations
def test_020_delete_formation(self):
@ -257,4 +252,22 @@ if __name__ == "__main__":
cmdProcess = ["./scriptCreationDepartement.sh", LINK_SCODOC_SERVER, NOM_DPT]
process = subprocess.Popen(cmdProcess)
process.wait()
unittest.main(testRunner=HtmlTestRunner.HTMLTestRunner(output="./output"))
#driver = webdriver.Firefox()
#driver.get(
# "https://"
# + SCODOC_ADMIN_ID
# + ":"
# + SCODOC_ADMIN_PASS
# + "@"
# + BASE_NOT_SECURED_URL
# + "force_admin_authentication"
# )
#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()
#driver.close()
unittest.main()

View File

@ -1,6 +1,5 @@
import unittest
import time
import HtmlTestRunner
import subprocess
from setting import (
SCODOC_ADMIN_ID,
@ -196,4 +195,4 @@ if __name__ == "__main__":
]
process = subprocess.Popen(cmdProcess)
process.wait()
unittest.main(testRunner=HtmlTestRunner.HTMLTestRunner(output="./output"))
unittest.main()

View File

@ -2,7 +2,6 @@ import unittest
import time
import urllib.parse as urlparse
import subprocess
import HtmlTestRunner
from setting import (
SCODOC_ADMIN_ID,
SCODOC_ADMIN_PASS,
@ -165,4 +164,4 @@ if __name__ == "__main__":
]
process = subprocess.Popen(cmdProcess)
process.wait()
unittest.main(testRunner=HtmlTestRunner.HTMLTestRunner(output="./output"))
unittest.main()

View File

@ -2,7 +2,6 @@ import unittest
import time
import subprocess
import urllib.parse as urlparse
import HtmlTestRunner
from setting import (
SCODOC_ADMIN_ID,
SCODOC_ADMIN_PASS,
@ -396,4 +395,4 @@ 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(warnings="ignore")

View File

@ -2,7 +2,6 @@ import unittest
import time
import subprocess
import urllib.parse as urlparse
import HtmlTestRunner
from setting import (
SCODOC_ADMIN_ID,
SCODOC_ADMIN_PASS,
@ -445,4 +444,4 @@ if __name__ == "__main__":
]
process = subprocess.Popen(cmdProcess)
process.wait()
unittest.main(testRunner=HtmlTestRunner.HTMLTestRunner(output="./output"))
unittest.main(warnings="ignore")

View File

@ -2,7 +2,6 @@ import unittest
import time
import subprocess
import urllib.parse as urlparse
import HtmlTestRunner
from setting import (
SCODOC_ADMIN_ID,
SCODOC_ADMIN_PASS,
@ -233,4 +232,4 @@ if __name__ == "__main__":
]
process = subprocess.Popen(cmdProcess)
process.wait()
unittest.main(testRunner=HtmlTestRunner.HTMLTestRunner(output="./output"))
unittest.main(warnings="ignore")

View File

@ -589,22 +589,28 @@ test48:
page: *Notes
champsModifie: null
champsInteractions:
[id:tf_titre, id:tf_acronyme, id:tf_submit, link:ue_create]
[
id:tf_titre,
id:tf_acronyme,
id:tf_submit,
link:ue_create
]
role: *AdminDPT
createur: Aurélien
test49:
intitulé: Ajout d'une matière à la formation créée
intitulé: Ajout d'une matière à l'UE créée
operation: Soumettre le formulaire d'ajout de matière
resultat: La page sur laquelle on est dirigée contient la classe notes_matiere_list et l'intitulé de la matière est présent
resultat: La page sur laquelle on est dirigée contient la classe notes_matiere_list et un de ses enfants contient Systeme
etat: *MatiereCreated
page: *Notes
champsModifie: null
champsInteractions: [
champsInteractions:
[
id:tf_titre,
id:tf_acronyme,
id:tf_submit,
link:matiere_create
link:matiere_edit,
link:matiere_edit
]
role: *AdminDPT
createur: Aurélien