forked from aurelien.plancke/ScodocTestClient
maj readme, test pour les id & script generate report page pour éviter de lire les anciens résumés
This commit is contained in:
parent
6cfa26ca17
commit
23def285c5
@ -74,7 +74,7 @@ class PythonOrgSearch(unittest.TestCase):
|
|||||||
driver = self.driver
|
driver = self.driver
|
||||||
global URL
|
global URL
|
||||||
driver.get(URL)
|
driver.get(URL)
|
||||||
idEditFormation = "edit-formation-" + ACRONYME_FORMATION
|
idEditFormation = "edit-formation-" + ACRONYME_FORMATION.replace(" ","-")
|
||||||
driver.find_element_by_id(idEditFormation).click()
|
driver.find_element_by_id(idEditFormation).click()
|
||||||
self.wait.until(EC.url_changes(URL))
|
self.wait.until(EC.url_changes(URL))
|
||||||
driver.find_element_by_id("tf_acronyme").send_keys(ACRONYME_FORMATION)
|
driver.find_element_by_id("tf_acronyme").send_keys(ACRONYME_FORMATION)
|
||||||
@ -108,9 +108,10 @@ class PythonOrgSearch(unittest.TestCase):
|
|||||||
driver.find_element_by_id("tf_submit").click()
|
driver.find_element_by_id("tf_submit").click()
|
||||||
try:
|
try:
|
||||||
driver.find_element_by_class_name("error-message")
|
driver.find_element_by_class_name("error-message")
|
||||||
|
message_erreur_present = True
|
||||||
except NoSuchElementException:
|
except NoSuchElementException:
|
||||||
self.assertFalse(True)
|
message_erreur_present = False
|
||||||
self.assertTrue(True)
|
self.assertTrue(message_erreur_present)
|
||||||
|
|
||||||
# Test : Ajout d'une UE dans la formation
|
# Test : Ajout d'une UE dans la formation
|
||||||
# @Expected : L'UE est créée et elle apparait désormais dans la liste d'UE de la formation
|
# @Expected : L'UE est créée et elle apparait désormais dans la liste d'UE de la formation
|
||||||
@ -118,7 +119,7 @@ class PythonOrgSearch(unittest.TestCase):
|
|||||||
driver = self.driver
|
driver = self.driver
|
||||||
global URL
|
global URL
|
||||||
driver.get(URL)
|
driver.get(URL)
|
||||||
idTitre = "titre-" + ACRONYME_FORMATION
|
idTitre = "titre-" + ACRONYME_FORMATION.replace(" ", "-")
|
||||||
driver.find_element_by_id(idTitre).click()
|
driver.find_element_by_id(idTitre).click()
|
||||||
self.wait.until(EC.url_changes(URL))
|
self.wait.until(EC.url_changes(URL))
|
||||||
driver.find_element_by_xpath("//a[contains(@href,'ue_create?')]").click()
|
driver.find_element_by_xpath("//a[contains(@href,'ue_create?')]").click()
|
||||||
@ -166,7 +167,7 @@ class PythonOrgSearch(unittest.TestCase):
|
|||||||
driver = self.driver
|
driver = self.driver
|
||||||
global URL
|
global URL
|
||||||
driver.get(URL)
|
driver.get(URL)
|
||||||
idAddSemestre = "add-semestre-" + ACRONYME_FORMATION
|
idAddSemestre = "add-semestre-" + ACRONYME_FORMATION.replace(" ", "-")
|
||||||
driver.find_element_by_id(idAddSemestre).click()
|
driver.find_element_by_id(idAddSemestre).click()
|
||||||
self.wait.until(EC.url_changes(URL))
|
self.wait.until(EC.url_changes(URL))
|
||||||
driver.find_element_by_name("date_debut").send_keys("01/01/2021")
|
driver.find_element_by_name("date_debut").send_keys("01/01/2021")
|
||||||
|
@ -173,10 +173,10 @@ class PythonOrgSearch(unittest.TestCase):
|
|||||||
element.submit()
|
element.submit()
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
try:
|
try:
|
||||||
element = driver.find_element_by_id("titleNoResult")
|
element = driver.find_element_by_id("title-no-result")
|
||||||
self.assertTrue("Aucun résultat" in element.text)
|
self.assertTrue("Aucun résultat" in element.text)
|
||||||
except:
|
except:
|
||||||
self.assertFalse(False)
|
self.assertFalse(True)
|
||||||
|
|
||||||
# ferme la fenetre
|
# ferme la fenetre
|
||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
|
@ -93,7 +93,7 @@ class PythonOrgSearch(unittest.TestCase):
|
|||||||
searchBar.send_keys(etudiant)
|
searchBar.send_keys(etudiant)
|
||||||
searchBar.submit()
|
searchBar.submit()
|
||||||
time.sleep(5)
|
time.sleep(5)
|
||||||
MOY_UE1 = driver.find_element_by_id("ue-" + ue_name).text
|
MOY_UE1 = driver.find_element_by_id("ue-" + ue_name.lower().replace(" ","-")).text
|
||||||
if "12" not in MOY_UE1:
|
if "12" not in MOY_UE1:
|
||||||
noteBonne = False
|
noteBonne = False
|
||||||
self.assertTrue(noteBonne)
|
self.assertTrue(noteBonne)
|
||||||
@ -129,7 +129,7 @@ class PythonOrgSearch(unittest.TestCase):
|
|||||||
searchBar.send_keys(etudiant)
|
searchBar.send_keys(etudiant)
|
||||||
searchBar.submit()
|
searchBar.submit()
|
||||||
time.sleep(5)
|
time.sleep(5)
|
||||||
MOY_UE2 = driver.find_element_by_id("ue-" + ue_name).text
|
MOY_UE2 = driver.find_element_by_id("ue-" + ue_name.lower().replace(" ","-")).text
|
||||||
if "8" not in MOY_UE2:
|
if "8" not in MOY_UE2:
|
||||||
noteBonne = False
|
noteBonne = False
|
||||||
|
|
||||||
@ -167,7 +167,7 @@ class PythonOrgSearch(unittest.TestCase):
|
|||||||
url = self.url
|
url = self.url
|
||||||
driver.get(url)
|
driver.get(url)
|
||||||
driver.find_element_by_id("link-programmes").click()
|
driver.find_element_by_id("link-programmes").click()
|
||||||
driver.find_element_by_id("titre-DUT Info").click()
|
driver.find_element_by_id("titre-dut-info").click()
|
||||||
driver.find_element_by_xpath("//span[contains(text(),'M1101')]").click()
|
driver.find_element_by_xpath("//span[contains(text(),'M1101')]").click()
|
||||||
driver.find_element_by_id("tf_coefficient").clear()
|
driver.find_element_by_id("tf_coefficient").clear()
|
||||||
driver.find_element_by_id("tf_coefficient").send_keys(COEFF_UE1)
|
driver.find_element_by_id("tf_coefficient").send_keys(COEFF_UE1)
|
||||||
@ -350,11 +350,11 @@ class PythonOrgSearch(unittest.TestCase):
|
|||||||
moyenneBonne = False
|
moyenneBonne = False
|
||||||
if ue_name not in ueListText:
|
if ue_name not in ueListText:
|
||||||
affichageMoyenne = False
|
affichageMoyenne = False
|
||||||
MOY_UE1 = driver.find_element_by_id("ue-" + ue_name).text
|
MOY_UE1 = driver.find_element_by_id("ue-" + ue_name.lower().replace(" ","-")).text
|
||||||
if float(0) != float(MOY_UE1):
|
if float(0) != float(MOY_UE1):
|
||||||
noteExcuseeEgaleAZero = False
|
noteExcuseeEgaleAZero = False
|
||||||
elif numeroEtu == 1:
|
elif numeroEtu == 1:
|
||||||
MOY_UE1 = driver.find_element_by_id("ue-" + ue_name).text
|
MOY_UE1 = driver.find_element_by_id("ue-" + ue_name.lower().replace(" ","-")).text
|
||||||
moyEtudiant2 = (
|
moyEtudiant2 = (
|
||||||
float(MOY_UE1) * COEFF_UE1
|
float(MOY_UE1) * COEFF_UE1
|
||||||
+ (float(MOY_UE2) - float(moyenneBonusEtudiant2)) * COEFF_UE2
|
+ (float(MOY_UE2) - float(moyenneBonusEtudiant2)) * COEFF_UE2
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
#Ce script lance en séquence les différents jeux de tests.
|
#Ce script lance en séquence les différents jeux de tests.
|
||||||
if [ "$#" -ne 1 ]
|
if [ "$#" -eq 1 ]
|
||||||
then
|
then
|
||||||
if [ "$1" = "--cleanup" ] || [ "$1" = "--c" ]
|
if [ "$1" = "--cleanup" ] || [ "$1" = "--c" ]
|
||||||
then
|
then
|
||||||
|
13
readme.md
13
readme.md
@ -78,7 +78,16 @@ Alternativement vous pouvez lancer l'ensemble des tests avec la commande
|
|||||||
|
|
||||||
>./lancement_de_tout_les_tests.sh
|
>./lancement_de_tout_les_tests.sh
|
||||||
|
|
||||||
|
L'option --c ou --cleanup est disponible si vous souhaitez effacer tout les rapports précédents
|
||||||
|
|
||||||
###Resultats des tests
|
###Resultats des tests
|
||||||
|
|
||||||
###TODO
|
Les tests sont présentés sur une page HTML qui se trouve dans le dossier ResultatTest, il y a une page HTML par jeux de tests créée. Un récapitulatif est également créé par le biais du script
|
||||||
> Lancer les test en parrallèle
|
|
||||||
|
>./scriptGenerateReportPage.sh
|
||||||
|
|
||||||
|
Celui ci est lancé automatiquement à la fin du script
|
||||||
|
|
||||||
|
>./lancement_de_tout_les_tests.sh
|
||||||
|
|
||||||
|
Vous y retrouverez les liens menant au détails de chaque rapport ainsi qu'un résumé du nombre de test passés/échoués
|
43
scriptGenerateReportPage.sh
Executable file
43
scriptGenerateReportPage.sh
Executable file
@ -0,0 +1,43 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
TIME=$(date +%d%m_%H%M%S)
|
||||||
|
echo '<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
|
<meta name="Author" content="Made by 'tree'">
|
||||||
|
<meta name="GENERATOR" content="$Version: $ tree v1.8.0 (c) 1996 - 2018 by Steve Baker, Thomas Moore, Francesc Rocher, Florian Sesser, Kyosuke Tokoro $">
|
||||||
|
<title>Directory Tree</title>
|
||||||
|
<style type="text/css">
|
||||||
|
<!--
|
||||||
|
BODY { font-family : ariel, monospace, sans-serif; }
|
||||||
|
P { font-weight: normal; font-family : ariel, monospace, sans-serif; color: black; background-color: transparent;}
|
||||||
|
B { font-weight: normal; color: black; background-color: transparent;}
|
||||||
|
A:visited { font-weight : normal; text-decoration : none; background-color : transparent; margin : 0px 0px 0px 0px; padding : 0px 0px 0px 0px; display: inline; }
|
||||||
|
A:link { font-weight : normal; text-decoration : none; margin : 0px 0px 0px 0px; padding : 0px 0px 0px 0px; display: inline; }
|
||||||
|
A:hover { color : #000000; font-weight : normal; text-decoration : underline; background-color : yellow; margin : 0px 0px 0px 0px; padding : 0px 0px 0px 0px; display: inline; }
|
||||||
|
A:active { color : #000000; font-weight: normal; background-color : transparent; margin : 0px 0px 0px 0px; padding : 0px 0px 0px 0px; display: inline; }
|
||||||
|
.VERSION { font-size: small; font-family : arial, sans-serif; }
|
||||||
|
.NORM { color: black; background-color: transparent;}
|
||||||
|
.FIFO { color: purple; background-color: transparent;}
|
||||||
|
.CHAR { color: yellow; background-color: transparent;}
|
||||||
|
.DIR { color: blue; background-color: transparent;}
|
||||||
|
.BLOCK { color: yellow; background-color: transparent;}
|
||||||
|
.LINK { color: aqua; background-color: transparent;}
|
||||||
|
.SOCK { color: fuchsia;background-color: transparent;}
|
||||||
|
.EXEC { color: green; background-color: transparent;}
|
||||||
|
-->
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<h1>Directory Tree</h1><p>
|
||||||
|
<a href="./ResultatTest/">./ResultatTest/</a><br>
|
||||||
|
' >> ./ResultatTest/Résumé_"${TIME}".html
|
||||||
|
for file in ./ResultatTest/*.html; do
|
||||||
|
RESULT=$(cat $file | grep "Summary")
|
||||||
|
BASEFILE=$(basename $file)
|
||||||
|
LINK="$BASEFILE"
|
||||||
|
if [[ $LINK != *"Résumé"* ]] ; then
|
||||||
|
echo "├── <a href=${LINK}>${BASEFILE}</a>${RESULT}<br>" >> ./ResultatTest/Résumé_${TIME}.html
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
echo '<br><br><br><br></body></html>' >> ./ResultatTest/Résumé_"${TIME}".html
|
Loading…
Reference in New Issue
Block a user