2021-04-21 13:28:58 +02:00
|
|
|
import unittest
|
|
|
|
import time
|
|
|
|
import urllib.parse as urlparse
|
2021-05-12 14:49:00 +02:00
|
|
|
from setup import SCODOC_ADMIN_ID,SCODOC_ADMIN_PASS,BASE_URL,NOM_DPT
|
2021-04-21 13:28:58 +02:00
|
|
|
from urllib.parse import parse_qs
|
|
|
|
from selenium import webdriver
|
|
|
|
from selenium.webdriver.common.keys import Keys
|
|
|
|
from selenium.webdriver.support import expected_conditions as EC
|
|
|
|
from selenium.webdriver.support.ui import Select, WebDriverWait
|
|
|
|
from selenium.webdriver.support.select import Select
|
2021-05-06 08:32:30 +02:00
|
|
|
|
2021-04-21 13:28:58 +02:00
|
|
|
nomEtu = "UnAutreEtudiant"
|
|
|
|
prenomEtu = "Normal"
|
|
|
|
oldnip = "11122234"
|
|
|
|
newnip = "12345678"
|
|
|
|
eid = "EID1"
|
2021-05-06 08:32:30 +02:00
|
|
|
|
|
|
|
|
2021-04-21 13:28:58 +02:00
|
|
|
class PythonOrgSearch(unittest.TestCase):
|
2021-05-06 08:32:30 +02:00
|
|
|
# Permet de se connecter et se remettre sur la page d'accueil avant chaque test
|
2021-04-21 13:28:58 +02:00
|
|
|
def setUp(self):
|
|
|
|
self.driver = webdriver.Firefox()
|
2021-05-06 08:32:30 +02:00
|
|
|
self.wait = WebDriverWait(self.driver, 10)
|
|
|
|
self.driver.get(
|
|
|
|
"https://"
|
|
|
|
+ SCODOC_ADMIN_ID
|
|
|
|
+ ":"
|
|
|
|
+ SCODOC_ADMIN_PASS
|
|
|
|
+ "@scodoc-dev-iutinfo.univ-lille.fr/force_admin_authentication"
|
|
|
|
)
|
2021-04-21 13:28:58 +02:00
|
|
|
self.driver.get("https://scodoc-dev-iutinfo.univ-lille.fr/ScoDoc")
|
|
|
|
|
2021-05-06 08:32:30 +02:00
|
|
|
# Test changer les données d'un étudiant
|
|
|
|
# @expected : Le nip sur la page informations de l'étudiant est mis à jour
|
2021-04-21 13:28:58 +02:00
|
|
|
def test_changement_info_etudiant(self):
|
2021-05-06 08:32:30 +02:00
|
|
|
url = (
|
2021-05-12 14:49:00 +02:00
|
|
|
BASE_URL
|
|
|
|
+ NOM_DPT
|
2021-05-06 08:32:30 +02:00
|
|
|
+ "/Scolarite/etudident_edit_form?etudid="
|
|
|
|
+ eid
|
|
|
|
)
|
2021-04-21 13:28:58 +02:00
|
|
|
driver = self.driver
|
|
|
|
driver.get(url)
|
|
|
|
driver.find_element_by_id("tf_code_nip").clear()
|
|
|
|
driver.find_element_by_id("tf_code_nip").send_keys(newnip)
|
|
|
|
driver.find_element_by_id("tf_submit").click()
|
|
|
|
self.wait.until(EC.url_changes(url))
|
|
|
|
time.sleep(5)
|
|
|
|
self.assertTrue(newnip in driver.page_source)
|
2021-05-06 08:32:30 +02:00
|
|
|
|
|
|
|
# ferme la fenetre
|
2021-04-21 13:28:58 +02:00
|
|
|
def tearDown(self):
|
|
|
|
self.driver.close()
|
|
|
|
|
2021-05-06 08:32:30 +02:00
|
|
|
|
2021-04-21 13:28:58 +02:00
|
|
|
if __name__ == "__main__":
|
2021-05-06 08:32:30 +02:00
|
|
|
unittest.main()
|