From dcd0e522c7c95e2c7580e88857f7a2d41484c64f Mon Sep 17 00:00:00 2001 From: newtech7j Date: Tue, 7 May 2024 12:45:03 +0100 Subject: [PATCH 1/3] updated code tha uses fixture to restore the database. make sure the link of the database sql file is set nomally. this is the demo video https://cloud.zjnu.edu.cn/share/5d5a595aa863203768489383cd --- Admin.php | 2 +- test/SeleniumNeil/conftest.py | 48 +++++++++++++++++++++ test/SeleniumNeil/test_cases.py | 76 ++++++++++++++++++--------------- 3 files changed, 90 insertions(+), 36 deletions(-) create mode 100644 test/SeleniumNeil/conftest.py diff --git a/Admin.php b/Admin.php index 103a480..fd4dfbe 100644 --- a/Admin.php +++ b/Admin.php @@ -72,7 +72,7 @@ if ($_SESSION['user_type'] != "Lecturer" && $_SESSION['user_type'] != "Admin") { Email
Initial password (Enter a strong password or leave it empty to let LRR generate one) -
+
User type: Date: Wed, 8 May 2024 15:42:56 +0100 Subject: [PATCH 2/3] udpdate that includes database restore make sure the original database link is ok in the case of error --- test/SeleniumNeil/test_cases.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/test/SeleniumNeil/test_cases.py b/test/SeleniumNeil/test_cases.py index c1607c1..7e166ee 100644 --- a/test/SeleniumNeil/test_cases.py +++ b/test/SeleniumNeil/test_cases.py @@ -11,8 +11,6 @@ from selenium.webdriver.support.wait import WebDriverWait from selenium.webdriver.support import expected_conditions as EC -from .conftest import restore_database - def test_function_1(restore_database): assert restore_database is None From f600f2bc24709e67ef1586a5558a4232b27a8de4 Mon Sep 17 00:00:00 2001 From: newtech7j Date: Wed, 8 May 2024 15:48:49 +0100 Subject: [PATCH 3/3] this is the demo video link https://cloud.zjnu.edu.cn/share/5d5a595aa863203768489383cd a second live demonsatration would be made in class --- test/SeleniumNeil/test_cases.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/test/SeleniumNeil/test_cases.py b/test/SeleniumNeil/test_cases.py index 7e166ee..c15e17b 100644 --- a/test/SeleniumNeil/test_cases.py +++ b/test/SeleniumNeil/test_cases.py @@ -10,8 +10,6 @@ from selenium.webdriver.common.by import By from selenium.webdriver.support.wait import WebDriverWait from selenium.webdriver.support import expected_conditions as EC - - def test_function_1(restore_database): assert restore_database is None @pytest.mark.skip(reason="function to be used in the test_scripts")