From 812a55f18515481c77c55d1cf5f89f124ef35799 Mon Sep 17 00:00:00 2001 From: aurelien Date: Tue, 1 Jun 2021 17:02:25 +0200 Subject: [PATCH] creation utilisateurs chef et enseignant pour tests --- .env | 11 ----------- .gitignore | 5 ++++- 05_saisie_note_test.py | 30 ++++++++++++++++++++++++++---- readme.md | 2 +- 4 files changed, 31 insertions(+), 17 deletions(-) delete mode 100644 .env diff --git a/.env b/.env deleted file mode 100644 index 47347ca..0000000 --- a/.env +++ /dev/null @@ -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" \ No newline at end of file diff --git a/.gitignore b/.gitignore index f80aa32..9bd5751 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,5 @@ settings.json -.vscode \ No newline at end of file +.vscode +.env +*__pycache__* +*__pycache__/* \ No newline at end of file diff --git a/05_saisie_note_test.py b/05_saisie_note_test.py index 2f008a5..2487f6f 100644 --- a/05_saisie_note_test.py +++ b/05_saisie_note_test.py @@ -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() diff --git a/readme.md b/readme.md index 891af63..9bd0708 100644 --- a/readme.md +++ b/readme.md @@ -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)