forked from aurelien.plancke/ScodocTestClient
add http schema to settings
This commit is contained in:
parent
23def285c5
commit
53fb0159ce
@ -1,4 +1,5 @@
|
|||||||
BASE_URL = "https://scodoc-dev-iutinfo.univ-lille.fr/ScoDoc/"
|
SCHEMA = "https"
|
||||||
|
BASE_URL = "scodoc-dev-iutinfo.univ-lille.fr/ScoDoc/"
|
||||||
NOM_DPT = "test01"
|
NOM_DPT = "test01"
|
||||||
SCODOC_ADMIN_ID = "admin_id"
|
SCODOC_ADMIN_ID = "admin_id"
|
||||||
SCODOC_ADMIN_PASS = "admin_password"
|
SCODOC_ADMIN_PASS = "admin_password"
|
||||||
@ -7,5 +8,5 @@ SCODOC_ENS_PASS = "enseignant_password@10"
|
|||||||
SCODOC_CHEF_ID = "chef_id"
|
SCODOC_CHEF_ID = "chef_id"
|
||||||
SCODOC_CHEF_PASS = "p@ssword42@"
|
SCODOC_CHEF_PASS = "p@ssword42@"
|
||||||
LINK_SCODOC_SERVER = "root@ssh_server_scodoc"
|
LINK_SCODOC_SERVER = "root@ssh_server_scodoc"
|
||||||
BASE_NOT_SECURED_URL = "scodoc-dev-iutinfo.univ-lille.fr/"
|
BASE_SSH_URL = "scodoc-dev-iutinfo.univ-lille.fr/"
|
||||||
NAVIGATEUR = "firefox"
|
NAVIGATEUR = "firefox"
|
@ -10,10 +10,11 @@ import suppressionSiteDepartement
|
|||||||
from setting import (
|
from setting import (
|
||||||
SCODOC_ADMIN_ID,
|
SCODOC_ADMIN_ID,
|
||||||
SCODOC_ADMIN_PASS,
|
SCODOC_ADMIN_PASS,
|
||||||
|
SCHEMA,
|
||||||
BASE_URL,
|
BASE_URL,
|
||||||
NOM_DPT,
|
NOM_DPT,
|
||||||
LINK_SCODOC_SERVER,
|
LINK_SCODOC_SERVER,
|
||||||
BASE_NOT_SECURED_URL,
|
BASE_SSH_URL,
|
||||||
NAVIGATEUR,
|
NAVIGATEUR,
|
||||||
)
|
)
|
||||||
from selenium import webdriver
|
from selenium import webdriver
|
||||||
@ -30,15 +31,15 @@ class PythonOrgSearch(unittest.TestCase):
|
|||||||
else:
|
else:
|
||||||
self.driver = webdriver.Chrome()
|
self.driver = webdriver.Chrome()
|
||||||
self.driver.get(
|
self.driver.get(
|
||||||
"https://"
|
SCHEMA + "://"
|
||||||
+ SCODOC_ADMIN_ID
|
+ SCODOC_ADMIN_ID
|
||||||
+ ":"
|
+ ":"
|
||||||
+ SCODOC_ADMIN_PASS
|
+ SCODOC_ADMIN_PASS
|
||||||
+ "@"
|
+ "@"
|
||||||
+ BASE_NOT_SECURED_URL
|
+ BASE_SSH_URL
|
||||||
+ "force_admin_authentication"
|
+ "force_admin_authentication"
|
||||||
)
|
)
|
||||||
self.driver.get(BASE_URL)
|
self.driver.get(SCHEMA + "://" + BASE_URL)
|
||||||
|
|
||||||
# Test : Verification de la connexion admin effective
|
# Test : Verification de la connexion admin effective
|
||||||
# @expected : "Bonjour admin" est présent sur la page d'accueil
|
# @expected : "Bonjour admin" est présent sur la page d'accueil
|
||||||
@ -50,25 +51,25 @@ class PythonOrgSearch(unittest.TestCase):
|
|||||||
# @expected : Le département est présent sur la page d'accueil
|
# @expected : Le département est présent sur la page d'accueil
|
||||||
def test_02_create_departement(self):
|
def test_02_create_departement(self):
|
||||||
driver = self.driver
|
driver = self.driver
|
||||||
driver.get(BASE_URL + "/scodoc_admin")
|
driver.get(SCHEMA + "://" + BASE_URL + "/scodoc_admin")
|
||||||
time.sleep(2)
|
time.sleep(2)
|
||||||
select = Select(driver.find_element_by_id("create-dept"))
|
select = Select(driver.find_element_by_id("create-dept"))
|
||||||
select.select_by_visible_text(NOM_DPT)
|
select.select_by_visible_text(NOM_DPT)
|
||||||
driver.find_element_by_id("create-dept").submit()
|
driver.find_element_by_id("create-dept").submit()
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
driver.find_element_by_id("tf_submit").click()
|
driver.find_element_by_id("tf_submit").click()
|
||||||
driver.get(BASE_URL)
|
driver.get(SCHEMA + "://" + BASE_URL)
|
||||||
self.assertTrue(NOM_DPT in driver.page_source)
|
self.assertTrue(NOM_DPT in driver.page_source)
|
||||||
|
|
||||||
# Test : Suppresion d'un département, puis lancement d'un script coté serveur pour supprimer sa base de données
|
# Test : Suppresion d'un département, puis lancement d'un script coté serveur pour supprimer sa base de données
|
||||||
# @expected : Le département n'apparait plus sur la page d'accueil
|
# @expected : Le département n'apparait plus sur la page d'accueil
|
||||||
def test_03_delete_departement(self):
|
def test_03_delete_departement(self):
|
||||||
driver = self.driver
|
driver = self.driver
|
||||||
driver.get(BASE_URL + "/scodoc_admin")
|
driver.get(SCHEMA + "://" + BASE_URL + "/scodoc_admin")
|
||||||
select = Select(driver.find_element_by_id("delete-dept"))
|
select = Select(driver.find_element_by_id("delete-dept"))
|
||||||
select.select_by_visible_text(NOM_DPT)
|
select.select_by_visible_text(NOM_DPT)
|
||||||
driver.find_element_by_id("delete-dept").submit()
|
driver.find_element_by_id("delete-dept").submit()
|
||||||
driver.get(BASE_URL)
|
driver.get(SCHEMA + "://" + BASE_URL)
|
||||||
self.assertTrue(NOM_DPT not in driver.page_source)
|
self.assertTrue(NOM_DPT not in driver.page_source)
|
||||||
|
|
||||||
# ferme la fenetre à chaque fin de test
|
# ferme la fenetre à chaque fin de test
|
||||||
|
@ -9,10 +9,11 @@ import deleteDepartement
|
|||||||
from setting import (
|
from setting import (
|
||||||
SCODOC_ADMIN_ID,
|
SCODOC_ADMIN_ID,
|
||||||
SCODOC_ADMIN_PASS,
|
SCODOC_ADMIN_PASS,
|
||||||
|
SCHEMA,
|
||||||
BASE_URL,
|
BASE_URL,
|
||||||
NOM_DPT,
|
NOM_DPT,
|
||||||
LINK_SCODOC_SERVER,
|
LINK_SCODOC_SERVER,
|
||||||
BASE_NOT_SECURED_URL,
|
BASE_SSH_URL,
|
||||||
NAVIGATEUR,
|
NAVIGATEUR,
|
||||||
)
|
)
|
||||||
from selenium import webdriver
|
from selenium import webdriver
|
||||||
@ -23,7 +24,7 @@ from selenium.webdriver.common.keys import Keys
|
|||||||
from selenium.webdriver.support.ui import Select
|
from selenium.webdriver.support.ui import Select
|
||||||
from selenium.webdriver.support.select import Select
|
from selenium.webdriver.support.select import Select
|
||||||
|
|
||||||
URL = BASE_URL + NOM_DPT + "/Scolarite"
|
URL = SCHEMA + "://" + BASE_URL + NOM_DPT + "/Scolarite"
|
||||||
|
|
||||||
ACRONYME_FORMATION = "formationtest"
|
ACRONYME_FORMATION = "formationtest"
|
||||||
|
|
||||||
@ -37,15 +38,16 @@ class PythonOrgSearch(unittest.TestCase):
|
|||||||
self.driver = webdriver.Chrome()
|
self.driver = webdriver.Chrome()
|
||||||
self.wait = WebDriverWait(self.driver, 10)
|
self.wait = WebDriverWait(self.driver, 10)
|
||||||
self.driver.get(
|
self.driver.get(
|
||||||
"https://"
|
SCHEMA
|
||||||
|
+ "://"
|
||||||
+ SCODOC_ADMIN_ID
|
+ SCODOC_ADMIN_ID
|
||||||
+ ":"
|
+ ":"
|
||||||
+ SCODOC_ADMIN_PASS
|
+ SCODOC_ADMIN_PASS
|
||||||
+ "@"
|
+ "@"
|
||||||
+ BASE_NOT_SECURED_URL
|
+ BASE_SSH_URL
|
||||||
+ "force_admin_authentication"
|
+ "force_admin_authentication"
|
||||||
)
|
)
|
||||||
self.driver.get(BASE_URL + "/ScoDoc")
|
self.driver.get(SCHEMA + "://" + BASE_URL + "/ScoDoc")
|
||||||
|
|
||||||
# Test Creer une formation
|
# Test Creer une formation
|
||||||
# @expected : La formation se trouve dans le tableau de la liste des formations
|
# @expected : La formation se trouve dans le tableau de la liste des formations
|
||||||
|
@ -8,10 +8,11 @@ import deleteDepartement
|
|||||||
from setting import (
|
from setting import (
|
||||||
SCODOC_ADMIN_ID,
|
SCODOC_ADMIN_ID,
|
||||||
SCODOC_ADMIN_PASS,
|
SCODOC_ADMIN_PASS,
|
||||||
|
SCHEMA,
|
||||||
BASE_URL,
|
BASE_URL,
|
||||||
NOM_DPT,
|
NOM_DPT,
|
||||||
LINK_SCODOC_SERVER,
|
LINK_SCODOC_SERVER,
|
||||||
BASE_NOT_SECURED_URL,
|
BASE_SSH_URL,
|
||||||
NAVIGATEUR,
|
NAVIGATEUR,
|
||||||
)
|
)
|
||||||
import urllib.parse as urlparse
|
import urllib.parse as urlparse
|
||||||
@ -23,7 +24,7 @@ from selenium.common.exceptions import NoSuchElementException
|
|||||||
from selenium.webdriver.support.ui import Select, WebDriverWait
|
from selenium.webdriver.support.ui import Select, WebDriverWait
|
||||||
from selenium.webdriver.support.select import Select
|
from selenium.webdriver.support.select import Select
|
||||||
|
|
||||||
URL = BASE_URL + NOM_DPT + "/Scolarite"
|
URL = SCHEMA + "://" + BASE_URL + NOM_DPT + "/Scolarite"
|
||||||
nomEtu = "Semestre11"
|
nomEtu = "Semestre11"
|
||||||
prenomEtu = "Etudiant1"
|
prenomEtu = "Etudiant1"
|
||||||
nip = "11122234"
|
nip = "11122234"
|
||||||
@ -41,12 +42,13 @@ class PythonOrgSearch(unittest.TestCase):
|
|||||||
self.driver = webdriver.Chrome()
|
self.driver = webdriver.Chrome()
|
||||||
self.wait = WebDriverWait(self.driver, 10)
|
self.wait = WebDriverWait(self.driver, 10)
|
||||||
self.driver.get(
|
self.driver.get(
|
||||||
"https://"
|
SCHEMA
|
||||||
|
+ "://"
|
||||||
+ SCODOC_ADMIN_ID
|
+ SCODOC_ADMIN_ID
|
||||||
+ ":"
|
+ ":"
|
||||||
+ SCODOC_ADMIN_PASS
|
+ SCODOC_ADMIN_PASS
|
||||||
+ "@"
|
+ "@"
|
||||||
+ BASE_NOT_SECURED_URL
|
+ BASE_SSH_URL
|
||||||
+ "force_admin_authentication"
|
+ "force_admin_authentication"
|
||||||
)
|
)
|
||||||
global URL
|
global URL
|
||||||
@ -146,7 +148,10 @@ class PythonOrgSearch(unittest.TestCase):
|
|||||||
def test_05_suppresion_etudiant(self):
|
def test_05_suppresion_etudiant(self):
|
||||||
driver = self.driver
|
driver = self.driver
|
||||||
urlRecherche = (
|
urlRecherche = (
|
||||||
"https://scodoc-dev-iutinfo.univ-lille.fr/ScoDoc/"
|
SCHEMA
|
||||||
|
+ "://"
|
||||||
|
+ BASE_URL
|
||||||
|
+ "/ScoDoc/"
|
||||||
+ NOM_DPT
|
+ NOM_DPT
|
||||||
+ "/Scolarite/search_etud_in_dept"
|
+ "/Scolarite/search_etud_in_dept"
|
||||||
)
|
)
|
||||||
@ -157,7 +162,10 @@ class PythonOrgSearch(unittest.TestCase):
|
|||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
etudid = driver.find_element_by_id("euid")
|
etudid = driver.find_element_by_id("euid")
|
||||||
url = (
|
url = (
|
||||||
"https://scodoc-dev-iutinfo.univ-lille.fr/ScoDoc/"
|
SCHEMA
|
||||||
|
+ "://"
|
||||||
|
+ BASE_URL
|
||||||
|
+ "/ScoDoc/"
|
||||||
+ NOM_DPT
|
+ NOM_DPT
|
||||||
+ "/Scolarite/etudident_delete?etudid="
|
+ "/Scolarite/etudident_delete?etudid="
|
||||||
+ etudid.text
|
+ etudid.text
|
||||||
|
@ -9,10 +9,11 @@ import deleteDepartement
|
|||||||
from setting import (
|
from setting import (
|
||||||
SCODOC_ADMIN_ID,
|
SCODOC_ADMIN_ID,
|
||||||
SCODOC_ADMIN_PASS,
|
SCODOC_ADMIN_PASS,
|
||||||
|
SCHEMA,
|
||||||
BASE_URL,
|
BASE_URL,
|
||||||
NOM_DPT,
|
NOM_DPT,
|
||||||
LINK_SCODOC_SERVER,
|
LINK_SCODOC_SERVER,
|
||||||
BASE_NOT_SECURED_URL,
|
BASE_SSH_URL,
|
||||||
NAVIGATEUR,
|
NAVIGATEUR,
|
||||||
)
|
)
|
||||||
from urllib.parse import parse_qs
|
from urllib.parse import parse_qs
|
||||||
@ -22,7 +23,7 @@ from selenium.webdriver.support import expected_conditions as EC
|
|||||||
from selenium.webdriver.support.ui import Select, WebDriverWait
|
from selenium.webdriver.support.ui import Select, WebDriverWait
|
||||||
from selenium.webdriver.support.select import Select
|
from selenium.webdriver.support.select import Select
|
||||||
|
|
||||||
URL = BASE_URL + NOM_DPT + "/Scolarite"
|
URL = SCHEMA + "://" + BASE_URL + NOM_DPT + "/Scolarite"
|
||||||
NOM_ETU = "Semestre11"
|
NOM_ETU = "Semestre11"
|
||||||
PRENOM_ETU = "EtudiantNumero1"
|
PRENOM_ETU = "EtudiantNumero1"
|
||||||
dateDebutAbsenceNonJustifiee = "31/05/2021"
|
dateDebutAbsenceNonJustifiee = "31/05/2021"
|
||||||
@ -38,12 +39,12 @@ class PythonOrgSearch(unittest.TestCase):
|
|||||||
self.driver = webdriver.Chrome()
|
self.driver = webdriver.Chrome()
|
||||||
self.wait = WebDriverWait(self.driver, 10)
|
self.wait = WebDriverWait(self.driver, 10)
|
||||||
self.driver.get(
|
self.driver.get(
|
||||||
"https://"
|
SCHEMA + "://"
|
||||||
+ SCODOC_ADMIN_ID
|
+ SCODOC_ADMIN_ID
|
||||||
+ ":"
|
+ ":"
|
||||||
+ SCODOC_ADMIN_PASS
|
+ SCODOC_ADMIN_PASS
|
||||||
+ "@"
|
+ "@"
|
||||||
+ BASE_NOT_SECURED_URL
|
+ BASE_SSH_URL
|
||||||
+ "force_admin_authentication"
|
+ "force_admin_authentication"
|
||||||
)
|
)
|
||||||
global URL
|
global URL
|
||||||
@ -52,7 +53,7 @@ class PythonOrgSearch(unittest.TestCase):
|
|||||||
def test_010_trouver_etudiant(self):
|
def test_010_trouver_etudiant(self):
|
||||||
driver = self.driver
|
driver = self.driver
|
||||||
global URL
|
global URL
|
||||||
self.driver.get(BASE_URL + NOM_DPT + "/Scolarite")
|
self.driver.get(SCHEMA + "://" + BASE_URL + NOM_DPT + "/Scolarite")
|
||||||
element = self.driver.find_element_by_id("in-expnom")
|
element = self.driver.find_element_by_id("in-expnom")
|
||||||
element.send_keys(NOM_ETU)
|
element.send_keys(NOM_ETU)
|
||||||
element.submit()
|
element.submit()
|
||||||
|
@ -9,6 +9,7 @@ import deleteDepartement
|
|||||||
from setting import (
|
from setting import (
|
||||||
SCODOC_ADMIN_ID,
|
SCODOC_ADMIN_ID,
|
||||||
SCODOC_ADMIN_PASS,
|
SCODOC_ADMIN_PASS,
|
||||||
|
SCHEMA,
|
||||||
BASE_URL,
|
BASE_URL,
|
||||||
NOM_DPT,
|
NOM_DPT,
|
||||||
SCODOC_ENS_ID,
|
SCODOC_ENS_ID,
|
||||||
@ -17,7 +18,7 @@ from setting import (
|
|||||||
SCODOC_CHEF_PASS,
|
SCODOC_CHEF_PASS,
|
||||||
NAVIGATEUR,
|
NAVIGATEUR,
|
||||||
LINK_SCODOC_SERVER,
|
LINK_SCODOC_SERVER,
|
||||||
BASE_NOT_SECURED_URL,
|
BASE_SSH_URL,
|
||||||
)
|
)
|
||||||
from urllib.parse import parse_qs
|
from urllib.parse import parse_qs
|
||||||
from selenium import webdriver
|
from selenium import webdriver
|
||||||
@ -29,7 +30,7 @@ from selenium.webdriver.support.select import Select
|
|||||||
|
|
||||||
URL_MATIERE = ""
|
URL_MATIERE = ""
|
||||||
URL_SEMESTRE = ""
|
URL_SEMESTRE = ""
|
||||||
URL = BASE_URL + NOM_DPT + "/Scolarite"
|
URL = SCHEMA + "://" + BASE_URL + NOM_DPT + "/Scolarite"
|
||||||
PRENOM_ENS = "Ens"
|
PRENOM_ENS = "Ens"
|
||||||
PRENOM_CHEF = "Chef"
|
PRENOM_CHEF = "Chef"
|
||||||
isAdmin = True
|
isAdmin = True
|
||||||
@ -46,16 +47,17 @@ class PythonOrgSearch(unittest.TestCase):
|
|||||||
self.wait = WebDriverWait(self.driver, 10)
|
self.wait = WebDriverWait(self.driver, 10)
|
||||||
if isAdmin:
|
if isAdmin:
|
||||||
self.driver.get(
|
self.driver.get(
|
||||||
"https://"
|
SCHEMA
|
||||||
|
+ "://"
|
||||||
+ SCODOC_ADMIN_ID
|
+ SCODOC_ADMIN_ID
|
||||||
+ ":"
|
+ ":"
|
||||||
+ SCODOC_ADMIN_PASS
|
+ SCODOC_ADMIN_PASS
|
||||||
+ "@"
|
+ "@"
|
||||||
+ BASE_NOT_SECURED_URL
|
+ BASE_SSH_URL
|
||||||
+ "force_admin_authentication"
|
+ "force_admin_authentication"
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
self.driver.get(BASE_URL + NOM_DPT + "/Scolarite")
|
self.driver.get(SCHEMA + "://" + BASE_URL + NOM_DPT + "/Scolarite")
|
||||||
if isChef:
|
if isChef:
|
||||||
self.driver.find_element_by_name("__ac_name").send_keys(SCODOC_CHEF_ID)
|
self.driver.find_element_by_name("__ac_name").send_keys(SCODOC_CHEF_ID)
|
||||||
self.driver.find_element_by_name("__ac_password").send_keys(
|
self.driver.find_element_by_name("__ac_password").send_keys(
|
||||||
@ -167,15 +169,16 @@ class PythonOrgSearch(unittest.TestCase):
|
|||||||
driver = self.driver
|
driver = self.driver
|
||||||
global URL_MATIERE
|
global URL_MATIERE
|
||||||
driver.get(
|
driver.get(
|
||||||
"https://"
|
SCHEMA
|
||||||
|
+ "://"
|
||||||
+ SCODOC_ADMIN_ID
|
+ SCODOC_ADMIN_ID
|
||||||
+ ":"
|
+ ":"
|
||||||
+ SCODOC_ADMIN_PASS
|
+ SCODOC_ADMIN_PASS
|
||||||
+ "@scodoc-dev-iutinfo.univ-lille.fr/force_admin_authentication"
|
+ "@scodoc-dev-iutinfo.univ-lille.fr/force_admin_authentication"
|
||||||
)
|
)
|
||||||
# driver.get(BASE_URL)
|
# driver.get(SCHEMA + "://" + BASE_URL)
|
||||||
# driver.find_element_by_link_text("déconnecter").click()
|
# driver.find_element_by_link_text("déconnecter").click()
|
||||||
# driver.get(BASE_URL)
|
# driver.get(SCHEMA + "://" + BASE_URL)
|
||||||
# driver.find_element_by_id("name").send_keys(SCODOC_CHEF_ID)
|
# 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("password").send_keys(SCODOC_CHEF_PASS)
|
||||||
# driver.find_element_by_id("submit").click()
|
# driver.find_element_by_id("submit").click()
|
||||||
@ -354,15 +357,16 @@ if __name__ == "__main__":
|
|||||||
process.wait()
|
process.wait()
|
||||||
time.sleep(5)
|
time.sleep(5)
|
||||||
driver.get(
|
driver.get(
|
||||||
"https://"
|
SCHEMA
|
||||||
|
+ "://"
|
||||||
+ SCODOC_ADMIN_ID
|
+ SCODOC_ADMIN_ID
|
||||||
+ ":"
|
+ ":"
|
||||||
+ SCODOC_ADMIN_PASS
|
+ SCODOC_ADMIN_PASS
|
||||||
+ "@"
|
+ "@"
|
||||||
+ BASE_NOT_SECURED_URL
|
+ BASE_SSH_URL
|
||||||
+ "force_admin_authentication"
|
+ "force_admin_authentication"
|
||||||
)
|
)
|
||||||
driver.get(BASE_URL + NOM_DPT + "/Scolarite")
|
driver.get(SCHEMA + "://" + BASE_URL + NOM_DPT + "/Scolarite")
|
||||||
driver.find_element_by_id("link-view-users").click()
|
driver.find_element_by_id("link-view-users").click()
|
||||||
time.sleep(5)
|
time.sleep(5)
|
||||||
noms = driver.find_elements_by_class_name("nom_fmt")
|
noms = driver.find_elements_by_class_name("nom_fmt")
|
||||||
|
@ -9,8 +9,9 @@ import deleteDepartement
|
|||||||
from setting import (
|
from setting import (
|
||||||
SCODOC_ADMIN_ID,
|
SCODOC_ADMIN_ID,
|
||||||
SCODOC_ADMIN_PASS,
|
SCODOC_ADMIN_PASS,
|
||||||
|
SCHEMA,
|
||||||
BASE_URL,
|
BASE_URL,
|
||||||
BASE_NOT_SECURED_URL,
|
BASE_SSH_URL,
|
||||||
LINK_SCODOC_SERVER,
|
LINK_SCODOC_SERVER,
|
||||||
NOM_DPT,
|
NOM_DPT,
|
||||||
SCODOC_ENS_ID,
|
SCODOC_ENS_ID,
|
||||||
@ -43,15 +44,16 @@ class PythonOrgSearch(unittest.TestCase):
|
|||||||
self.driver = webdriver.Firefox()
|
self.driver = webdriver.Firefox()
|
||||||
elif NAVIGATEUR == "chrome":
|
elif NAVIGATEUR == "chrome":
|
||||||
self.driver = webdriver.Chrome()
|
self.driver = webdriver.Chrome()
|
||||||
self.url = BASE_URL + NOM_DPT + "/Scolarite"
|
self.url = SCHEMA + "://" + BASE_URL + NOM_DPT + "/Scolarite"
|
||||||
self.wait = WebDriverWait(self.driver, 10)
|
self.wait = WebDriverWait(self.driver, 10)
|
||||||
self.driver.get(
|
self.driver.get(
|
||||||
"https://"
|
SCHEMA
|
||||||
|
+ "://"
|
||||||
+ SCODOC_ADMIN_ID
|
+ SCODOC_ADMIN_ID
|
||||||
+ ":"
|
+ ":"
|
||||||
+ SCODOC_ADMIN_PASS
|
+ SCODOC_ADMIN_PASS
|
||||||
+ "@"
|
+ "@"
|
||||||
+ BASE_NOT_SECURED_URL
|
+ BASE_SSH_URL
|
||||||
+ "force_admin_authentication"
|
+ "force_admin_authentication"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -9,8 +9,9 @@ import deleteDepartement
|
|||||||
from setting import (
|
from setting import (
|
||||||
SCODOC_ADMIN_ID,
|
SCODOC_ADMIN_ID,
|
||||||
SCODOC_ADMIN_PASS,
|
SCODOC_ADMIN_PASS,
|
||||||
|
SCHEMA,
|
||||||
BASE_URL,
|
BASE_URL,
|
||||||
BASE_NOT_SECURED_URL,
|
BASE_SSH_URL,
|
||||||
LINK_SCODOC_SERVER,
|
LINK_SCODOC_SERVER,
|
||||||
NOM_DPT,
|
NOM_DPT,
|
||||||
SCODOC_ENS_ID,
|
SCODOC_ENS_ID,
|
||||||
@ -39,15 +40,16 @@ class PythonOrgSearch(unittest.TestCase):
|
|||||||
self.driver = webdriver.Firefox()
|
self.driver = webdriver.Firefox()
|
||||||
elif NAVIGATEUR == "chrome":
|
elif NAVIGATEUR == "chrome":
|
||||||
self.driver = webdriver.Chrome()
|
self.driver = webdriver.Chrome()
|
||||||
self.url = BASE_URL + NOM_DPT + "/Scolarite"
|
self.url = SCHEMA + "://" + BASE_URL + NOM_DPT + "/Scolarite"
|
||||||
self.wait = WebDriverWait(self.driver, 10)
|
self.wait = WebDriverWait(self.driver, 10)
|
||||||
self.driver.get(
|
self.driver.get(
|
||||||
"https://"
|
SCHEMA
|
||||||
|
+ "://"
|
||||||
+ SCODOC_ADMIN_ID
|
+ SCODOC_ADMIN_ID
|
||||||
+ ":"
|
+ ":"
|
||||||
+ SCODOC_ADMIN_PASS
|
+ SCODOC_ADMIN_PASS
|
||||||
+ "@"
|
+ "@"
|
||||||
+ BASE_NOT_SECURED_URL
|
+ BASE_SSH_URL
|
||||||
+ "force_admin_authentication"
|
+ "force_admin_authentication"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -6,10 +6,11 @@ import HtmlTestRunner
|
|||||||
from setting import (
|
from setting import (
|
||||||
SCODOC_ADMIN_ID,
|
SCODOC_ADMIN_ID,
|
||||||
SCODOC_ADMIN_PASS,
|
SCODOC_ADMIN_PASS,
|
||||||
|
SCHEMA,
|
||||||
BASE_URL,
|
BASE_URL,
|
||||||
NOM_DPT,
|
NOM_DPT,
|
||||||
LINK_SCODOC_SERVER,
|
LINK_SCODOC_SERVER,
|
||||||
BASE_NOT_SECURED_URL,
|
BASE_SSH_URL,
|
||||||
NAVIGATEUR,
|
NAVIGATEUR,
|
||||||
)
|
)
|
||||||
from selenium import webdriver
|
from selenium import webdriver
|
||||||
@ -20,7 +21,7 @@ from selenium.webdriver.common.keys import Keys
|
|||||||
from selenium.webdriver.support.ui import Select
|
from selenium.webdriver.support.ui import Select
|
||||||
from selenium.webdriver.support.select import Select
|
from selenium.webdriver.support.select import Select
|
||||||
|
|
||||||
URL = BASE_URL + NOM_DPT + "/Scolarite"
|
URL = SCHEMA + "://" + BASE_URL + NOM_DPT + "/Scolarite"
|
||||||
|
|
||||||
ACRONYME_FORMATION = "FormationTEST"
|
ACRONYME_FORMATION = "FormationTEST"
|
||||||
|
|
||||||
@ -31,15 +32,16 @@ def main():
|
|||||||
else:
|
else:
|
||||||
driver = webdriver.Chrome()
|
driver = webdriver.Chrome()
|
||||||
driver.get(
|
driver.get(
|
||||||
"https://"
|
SCHEMA
|
||||||
|
+ "://"
|
||||||
+ SCODOC_ADMIN_ID
|
+ SCODOC_ADMIN_ID
|
||||||
+ ":"
|
+ ":"
|
||||||
+ SCODOC_ADMIN_PASS
|
+ SCODOC_ADMIN_PASS
|
||||||
+ "@"
|
+ "@"
|
||||||
+ BASE_NOT_SECURED_URL
|
+ BASE_SSH_URL
|
||||||
+ "force_admin_authentication"
|
+ "force_admin_authentication"
|
||||||
)
|
)
|
||||||
driver.get(BASE_URL + "scodoc_admin")
|
driver.get(SCHEMA + "://" + BASE_URL + "scodoc_admin")
|
||||||
time.sleep(2)
|
time.sleep(2)
|
||||||
try:
|
try:
|
||||||
select = Select(driver.find_element_by_id("create-dept"))
|
select = Select(driver.find_element_by_id("create-dept"))
|
||||||
|
@ -20,7 +20,8 @@ ou alternativement avec
|
|||||||
Un modèle de .env est fourni dans ce projet, pour que les tests soient fonctionnel vous devez le remplir et le renommer en .env. Ce dernier servira à remplir différentes informations spécifiques concernant votre environnement Scodoc. Nous allons le voir ici en détail
|
Un modèle de .env est fourni dans ce projet, pour que les tests soient fonctionnel vous devez le remplir et le renommer en .env. Ce dernier servira à remplir différentes informations spécifiques concernant votre environnement Scodoc. Nous allons le voir ici en détail
|
||||||
#### .env
|
#### .env
|
||||||
|
|
||||||
>BASE_URL = "https://scodoc-dev-iutinfo.univ-lille.fr/ScoDoc/"
|
>SCHEMA = "https"
|
||||||
|
>BASE_URL = "scodoc-dev-iutinfo.univ-lille.fr/ScoDoc/"
|
||||||
|
|
||||||
Ici sera le lien vers la page d'accueil de votre Scodoc
|
Ici sera le lien vers la page d'accueil de votre Scodoc
|
||||||
|
|
||||||
@ -56,7 +57,7 @@ Le mot de passe de l'utilisateur précédent, si l'utilisateur précédent n'exi
|
|||||||
|
|
||||||
Le lien vers votre serveur Scodoc, ce dernier servira à lancer des scripts de mise en place sur le serveur. Veillez donc à avoir une connexion avec les droits root sur votre serveur, de préférences avec échange de clef ssh.
|
Le lien vers votre serveur Scodoc, ce dernier servira à lancer des scripts de mise en place sur le serveur. Veillez donc à avoir une connexion avec les droits root sur votre serveur, de préférences avec échange de clef ssh.
|
||||||
|
|
||||||
>BASE_NOT_SECURED_URL = "scodoc-dev-iutinfo.univ-lille.fr/"
|
>BASE_SSH_URL = "scodoc-dev-iutinfo.univ-lille.fr/"
|
||||||
|
|
||||||
Le lien vers la page de choix de département, avec le format précisé.
|
Le lien vers la page de choix de département, avec le format précisé.
|
||||||
|
|
||||||
|
@ -9,4 +9,4 @@ ssh $1 /bin/bash<< EOF
|
|||||||
cd /opt/scodoc/Products/ScoDoc/config
|
cd /opt/scodoc/Products/ScoDoc/config
|
||||||
./delete_dept.sh -n ${2}
|
./delete_dept.sh -n ${2}
|
||||||
EOF
|
EOF
|
||||||
ssh $1 'systemctl restart ScoDoc.service'
|
# ssh $1 'systemctl restart ScoDoc.service'
|
@ -9,4 +9,4 @@ ssh $1 /bin/bash<< EOF
|
|||||||
cd /opt/scodoc/Products/ScoDoc/
|
cd /opt/scodoc/Products/ScoDoc/
|
||||||
scotests/scointeractive.sh -r ${2} scotests/${3}
|
scotests/scointeractive.sh -r ${2} scotests/${3}
|
||||||
EOF
|
EOF
|
||||||
ssh $1 'systemctl restart ScoDoc.service'
|
# ssh $1 'systemctl restart ScoDoc.service'
|
||||||
|
@ -5,6 +5,7 @@ from dotenv import load_dotenv
|
|||||||
dotenv_path = join(dirname(__file__), ".env")
|
dotenv_path = join(dirname(__file__), ".env")
|
||||||
load_dotenv(dotenv_path)
|
load_dotenv(dotenv_path)
|
||||||
|
|
||||||
|
SCHEMA = os.environ.get("SCHEMA")
|
||||||
BASE_URL = os.environ.get("BASE_URL")
|
BASE_URL = os.environ.get("BASE_URL")
|
||||||
NOM_DPT = os.environ.get("NOM_DPT")
|
NOM_DPT = os.environ.get("NOM_DPT")
|
||||||
SCODOC_ADMIN_ID = os.environ.get("SCODOC_ADMIN_ID")
|
SCODOC_ADMIN_ID = os.environ.get("SCODOC_ADMIN_ID")
|
||||||
@ -14,5 +15,5 @@ SCODOC_ENS_PASS = os.environ.get("SCODOC_ENS_PASS")
|
|||||||
SCODOC_CHEF_ID = os.environ.get("SCODOC_CHEF_ID")
|
SCODOC_CHEF_ID = os.environ.get("SCODOC_CHEF_ID")
|
||||||
SCODOC_CHEF_PASS = os.environ.get("SCODOC_CHEF_PASS")
|
SCODOC_CHEF_PASS = os.environ.get("SCODOC_CHEF_PASS")
|
||||||
LINK_SCODOC_SERVER = os.environ.get("LINK_SCODOC_SERVER")
|
LINK_SCODOC_SERVER = os.environ.get("LINK_SCODOC_SERVER")
|
||||||
BASE_NOT_SECURED_URL = os.environ.get("BASE_NOT_SECURED_URL")
|
BASE_SSH_URL = os.environ.get("BASE_SSH_URL")
|
||||||
NAVIGATEUR = os.environ.get("NAVIGATEUR")
|
NAVIGATEUR = os.environ.get("NAVIGATEUR")
|
@ -6,10 +6,11 @@ import HtmlTestRunner
|
|||||||
from setting import (
|
from setting import (
|
||||||
SCODOC_ADMIN_ID,
|
SCODOC_ADMIN_ID,
|
||||||
SCODOC_ADMIN_PASS,
|
SCODOC_ADMIN_PASS,
|
||||||
|
SCHEMA,
|
||||||
BASE_URL,
|
BASE_URL,
|
||||||
NOM_DPT,
|
NOM_DPT,
|
||||||
LINK_SCODOC_SERVER,
|
LINK_SCODOC_SERVER,
|
||||||
BASE_NOT_SECURED_URL,
|
BASE_SSH_URL,
|
||||||
NAVIGATEUR,
|
NAVIGATEUR,
|
||||||
)
|
)
|
||||||
from selenium import webdriver
|
from selenium import webdriver
|
||||||
@ -20,7 +21,7 @@ from selenium.webdriver.common.keys import Keys
|
|||||||
from selenium.webdriver.support.ui import Select
|
from selenium.webdriver.support.ui import Select
|
||||||
from selenium.webdriver.support.select import Select
|
from selenium.webdriver.support.select import Select
|
||||||
|
|
||||||
URL = BASE_URL + NOM_DPT + "/Scolarite"
|
URL = SCHEMA + "://" + BASE_URL + NOM_DPT + "/Scolarite"
|
||||||
|
|
||||||
ACRONYME_FORMATION = "FormationTEST"
|
ACRONYME_FORMATION = "FormationTEST"
|
||||||
|
|
||||||
@ -31,15 +32,16 @@ def main():
|
|||||||
else:
|
else:
|
||||||
driver = webdriver.Chrome()
|
driver = webdriver.Chrome()
|
||||||
driver.get(
|
driver.get(
|
||||||
"https://"
|
SCHEMA
|
||||||
|
+ "://"
|
||||||
+ SCODOC_ADMIN_ID
|
+ SCODOC_ADMIN_ID
|
||||||
+ ":"
|
+ ":"
|
||||||
+ SCODOC_ADMIN_PASS
|
+ SCODOC_ADMIN_PASS
|
||||||
+ "@"
|
+ "@"
|
||||||
+ BASE_NOT_SECURED_URL
|
+ BASE_SSH_URL
|
||||||
+ "force_admin_authentication"
|
+ "force_admin_authentication"
|
||||||
)
|
)
|
||||||
driver.get(BASE_URL + "scodoc_admin")
|
driver.get(SCHEMA + "://" + BASE_URL + "scodoc_admin")
|
||||||
time.sleep(2)
|
time.sleep(2)
|
||||||
try:
|
try:
|
||||||
select = Select(driver.find_element_by_id("delete-dept"))
|
select = Select(driver.find_element_by_id("delete-dept"))
|
||||||
|
Loading…
Reference in New Issue
Block a user