ScodocTestClient/07_test_admission.py

61 lines
1.8 KiB
Python
Raw Normal View History

import unittest
import time
import subprocess
import urllib.parse as urlparse
from setting import (
SCODOC_ADMIN_ID,
SCODOC_ADMIN_PASS,
BASE_URL,
BASE_NOT_SECURED_URL,
LINK_SCODOC_SERVER,
NOM_DPT,
SCODOC_ENS_ID,
SCODOC_ENS_PASS,
SCODOC_CHEF_ID,
SCODOC_CHEF_PASS,
NAVIGATEUR,
)
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
class PythonOrgSearch(unittest.TestCase):
# Permet de se connecter et se remettre sur la page d'accueil avant chaque test
def setUp(self):
if NAVIGATEUR == "firefox":
self.driver = webdriver.Firefox()
elif NAVIGATEUR == "chrome":
self.driver = webdriver.Chrome()
self.url = BASE_URL + NOM_DPT + "/Scolarite"
self.wait = WebDriverWait(self.driver, 10)
self.driver.get(
"https://"
+ SCODOC_ADMIN_ID
+ ":"
+ SCODOC_ADMIN_PASS
+ "@"
+ BASE_NOT_SECURED_URL
+ "force_admin_authentication"
)
def test_010_decision_modifiable_sur_fiche_etudiant(self):
def tearDown(self):
self.driver.close()
if __name__ == "__main__":
cmdProcess = ["./scriptCreationDepartement.sh", LINK_SCODOC_SERVER, NOM_DPT]
process = subprocess.Popen(cmdProcess)
process.wait()
cmdProcess = [
"./scriptExecution.sh",
LINK_SCODOC_SERVER,
NOM_DPT,
"test_scenario4_formation.py",
]
process = subprocess.Popen(cmdProcess)
process.wait()
unittest.main(warnings="ignore")