diff --git a/.gitignore b/.gitignore index c3d3a20..f80aa32 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ -settings.json \ No newline at end of file +settings.json +.vscode \ No newline at end of file diff --git a/06_saisie_note_test.py b/06_saisie_note_test.py index b7e1507..1e42241 100644 --- a/06_saisie_note_test.py +++ b/06_saisie_note_test.py @@ -1,7 +1,16 @@ import unittest import time import urllib.parse as urlparse -from setup import SCODOC_ADMIN_ID,SCODOC_ADMIN_PASS,BASE_URL,NOM_DPT,SCODOC_ENS_ID,SCODOC_ENS_PASS,SCODOC_CHEF_ID,SCODOC_CHEF_PASS +from setup import ( + SCODOC_ADMIN_ID, + SCODOC_ADMIN_PASS, + BASE_URL, + NOM_DPT, + SCODOC_ENS_ID, + SCODOC_ENS_PASS, + SCODOC_CHEF_ID, + SCODOC_CHEF_PASS, +) from urllib.parse import parse_qs from selenium import webdriver from selenium.webdriver.common.keys import Keys @@ -10,10 +19,10 @@ from selenium.webdriver.support import expected_conditions as EC from selenium.webdriver.support.ui import Select, WebDriverWait from selenium.webdriver.support.select import Select -urlMatiere = '' - +urlMatiere = "" +#Prérequis class PythonOrgSearch(unittest.TestCase): # Permet de se connecter et se remettre sur la page d'accueil avant chaque test def setUp(self): @@ -87,12 +96,12 @@ class PythonOrgSearch(unittest.TestCase): + SCODOC_ADMIN_PASS + "@scodoc-dev-iutinfo.univ-lille.fr/force_admin_authentication" ) - #driver.get(BASE_URL) - #driver.find_element_by_link_text("déconnecter").click() - #driver.get(BASE_URL) - #driver.find_element_by_id("name").send_keys(SCODOC_CHEF_ID) - #driver.find_element_by_id("password").send_keys(SCODOC_CHEF_PASS) - #driver.find_element_by_id("submit").click() + # driver.get(BASE_URL) + # driver.find_element_by_link_text("déconnecter").click() + # driver.get(BASE_URL) + # driver.find_element_by_id("name").send_keys(SCODOC_CHEF_ID) + # driver.find_element_by_id("password").send_keys(SCODOC_CHEF_PASS) + # driver.find_element_by_id("submit").click() driver.get(urlMatiere) time.sleep(1) driver.find_element_by_link_text("Créer nouvelle évaluation").click() @@ -124,7 +133,7 @@ class PythonOrgSearch(unittest.TestCase): element = driver.find_element_by_class_name("note") element.send_keys("12") driver.find_element_by_id("formnotes_submit").click() - #self.wait.until(EC.url_changes(url)) + # self.wait.until(EC.url_changes(url)) self.assertTrue( driver.find_element_by_link_text("afficher").text in driver.page_source ) @@ -194,6 +203,7 @@ class PythonOrgSearch(unittest.TestCase): time.sleep(1) driver.find_element_by_id("tf_submit").click() self.assertFalse(descriptionInterrogation in driver.page_source) + # Test : Suppression d'un enseignant responsable d'un module # @expected : L'enseignant n'apparait plus comme responsable dans ce module def test_200_suppression_enseignant_sur_module(self): @@ -216,6 +226,8 @@ class PythonOrgSearch(unittest.TestCase): time.sleep(1) self.assertTrue(SCODOC_ENS_ID not in driver.page_source) + # Test : Suppresion du reste des interrogations sans notes + # @expected Tout les interrogation sans notes sont supprimées def test_910_suppresion_interrogation_restante(self): driver = self.driver self.driver.get( @@ -225,10 +237,11 @@ class PythonOrgSearch(unittest.TestCase): + SCODOC_ADMIN_PASS + "@scodoc-dev-iutinfo.univ-lille.fr/force_admin_authentication" ) + driver.get(urlMatiere) time.sleep(1) elements = driver.find_elements_by_class_name("delete_img") - while elements: + while elements: elements[0].click() time.sleep(1) driver.find_element_by_id("tf_submit").click() @@ -236,7 +249,7 @@ class PythonOrgSearch(unittest.TestCase): driver.get(urlMatiere) time.sleep(1) elements = driver.find_elements_by_class_name("delete_img") - + # ferme la fenetre et fais du clean up def tearDown(self): self.driver.close() diff --git a/07_test_moyenne.py b/07_test_moyenne.py new file mode 100644 index 0000000..333f237 --- /dev/null +++ b/07_test_moyenne.py @@ -0,0 +1,44 @@ +import unittest +import time +import urllib.parse as urlparse +from setup import ( + SCODOC_ADMIN_ID, + SCODOC_ADMIN_PASS, + BASE_URL, + NOM_DPT, + SCODOC_ENS_ID, + SCODOC_ENS_PASS, + SCODOC_CHEF_ID, + SCODOC_CHEF_PASS, +) +from urllib.parse import parse_qs +from selenium import webdriver +from selenium.webdriver.common.keys import Keys +from selenium.common.exceptions import NoSuchElementException +from selenium.webdriver.support import expected_conditions as EC +from selenium.webdriver.support.ui import Select, WebDriverWait +from selenium.webdriver.support.select import Select + +urlMatiere = "" + + +class PythonOrgSearch(unittest.TestCase): + # Permet de se connecter et se remettre sur la page d'accueil avant chaque test + def setUp(self): + #chargement du script creation d'interro + self.driver = webdriver.Firefox() + self.url = BASE_URL + NOM_DPT + "/Scolarite" + self.wait = WebDriverWait(self.driver, 10) + self.driver.get(BASE_URL) + self.driver.find_element_by_id("name").send_keys(SCODOC_ENS_ID) + self.driver.find_element_by_id("password").send_keys(SCODOC_ENS_PASS) + self.driver.find_element_by_id("submit").click() + + def test_010_ajout_note_multiple(self): + driver = self.driver() + url = self.url + driver.find_element_by_link_text("DUT Informatique semestre 4").click() + driver.find_element_by_link_text("M4101C").click() + time.sleep(1) + global urlMatiere + urlMatiere = driver.current_url diff --git a/__pycache__/setup.cpython-37.pyc b/__pycache__/setup.cpython-37.pyc new file mode 100644 index 0000000..435c778 Binary files /dev/null and b/__pycache__/setup.cpython-37.pyc differ diff --git a/export_formation.xml b/export_formation.xml new file mode 100644 index 0000000..8baf7a6 --- /dev/null +++ b/export_formation.xml @@ -0,0 +1,205 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/scriptexecution.sh b/scriptexecution.sh new file mode 100755 index 0000000..dac7e09 --- /dev/null +++ b/scriptexecution.sh @@ -0,0 +1,11 @@ +#!/bin/bash +if [ "$#" -ne 2 ]; +then + echo "Pas assez d'arguments" + exit 2 +fi +ssh $1 /bin/bash<< EOF +cd /opt/scodoc/Products/ScoDoc/ +scotests/scointeractive.sh -r test02 scotests/${2} +EOF +ssh $1 'systemctl restart ScoDoc.service'