creation utilisateurs chef et enseignant pour tests

This commit is contained in:
Aurélien Plancke 2021-06-01 17:02:25 +02:00
parent 7d52d21bc1
commit 812a55f185
4 changed files with 31 additions and 17 deletions

11
.env
View File

@ -1,11 +0,0 @@
BASE_URL = "https://scodoc-dev-iutinfo.univ-lille.fr/ScoDoc/"
NOM_DPT = "test01"
SCODOC_ADMIN_ID = "admin"
SCODOC_ADMIN_PASS = "root_pass_42"
SCODOC_ENS_ID = "enseignant"
SCODOC_ENS_PASS = "enseignant@"
SCODOC_CHEF_ID = "chefdesetudes"
SCODOC_CHEF_PASS = "passwordUS42"
LINK_SCODOC_SERVER = "root@scodoc-dev-iutinfo.univ-lille.fr"
BASE_NOT_SECURED_URL = "scodoc-dev-iutinfo.univ-lille.fr/"
NAVIGATEUR = "firefox"

5
.gitignore vendored
View File

@ -1,2 +1,5 @@
settings.json
.vscode
.vscode
.env
*__pycache__*
*__pycache__/*

View File

@ -290,8 +290,30 @@ if __name__ == "__main__":
+ BASE_NOT_SECURED_URL
+ "force_admin_authentication"
)
driver.get(BASE_URL)
driver.find_element_by_id("utilisateur_Vue").click()
if(SCODOC_CHEF_ID not in driver.page_source):
unittest.main()
if SCODOC_CHEF_ID not in driver.page_source:
constructValue = Ens + NOM_DPT
driver.find_element_by_id("creer_Utilisateur").click()
driver.find_element_by_id().send_keys(SCODOC_CHEF_ID)
driver.find_element_by_id().send_keys(SCODOC_CHEF_ID)
driver.find_element_by_id().send_keys("chef")
driver.find_element_by_id().send_keys(SCODOC_CHEF_PASS)
driver.find_element_by_id().send_keys(SCODOC_CHEF_PASS)
driver.find_element_by_xpath("//input[@name='" + constructValue + "]").click()
driver.find_element_by_xpath("//input[@name='force::list").click()
driver.find_element_by_id("tf_submit").click()
driver.find_element_by_id("utilisateur_Vue").click()
if SCODOC_ENS_ID not in driver.page_source:
constructValue = Ens + NOM_DPT
driver.find_element_by_id("creer_Utilisateur").click()
driver.find_element_by_id().send_keys(SCODOC_CHEF_ID)
driver.find_element_by_id().send_keys(SCODOC_CHEF_ID)
driver.find_element_by_id().send_keys("chef")
driver.find_element_by_id().send_keys(SCODOC_CHEF_PASS)
driver.find_element_by_id().send_keys(SCODOC_CHEF_PASS)
driver.find_element_by_xpath("//input[@name='" + constructValue + "]").click()
driver.find_element_by_xpath("//input[@name='force::list").click()
driver.find_element_by_id("tf_submit").click()
driver.find_element_by_id("utilisateur_Vue").click()
unittest.main()

View File

@ -1,4 +1,4 @@
I Configuaration
I Configuration
Environnement de test :
Editer le .envmodel pour remplacer les différentes informations qui permettent d'intéragir avec Scodoc (attention au / dans les liens, il y a des exemples)