From a64a4e1053c4588bc7864b5b33fd99c1db563b61 Mon Sep 17 00:00:00 2001 From: Ibrahim <1525200991@qq.com> Date: Sat, 27 Nov 2021 23:02:44 +0800 Subject: [PATCH 1/4] Update 1: test cases 00-04 --- Admin.php | 20 +++++----- Header.php | 2 +- index.php | 8 ++-- signup.php | 14 +++---- test/SeleniumIbrahim/test_kit/admin.py | 26 ++++++------- test/SeleniumIbrahim/test_kit/utility.py | 49 ++++++++++++++++-------- 6 files changed, 69 insertions(+), 50 deletions(-) diff --git a/Admin.php b/Admin.php index 563dcdf..ea0bfac 100644 --- a/Admin.php +++ b/Admin.php @@ -51,11 +51,11 @@ if ($_SESSION['user_type'] != "Lecturer") { @@ -66,7 +66,7 @@ if ($_SESSION['user_type'] != "Lecturer") {

Create Lecturer/TA Accounts -
+ Full_Name @@ -76,9 +76,9 @@ if ($_SESSION['user_type'] != "Lecturer") { Passport_Number / ID (Used as Intial Password)
User Type : - Lecturer - T/A -
+ Lecturer + T/A +
Reset"; if ($row['Status'] == "Active") { $newstatus = "Blocked"; - $btnBlock = ""; + $btnBlock = ""; } else { $newstatus = "Active"; - $btnBlock = ""; + $btnBlock = ""; } echo "" . $row['User_ID'] . "" . $row['Full_Name'] . "" . $row['Email'] . " " . $row['Passport_Number'] . "$btn$btnBlock"; @@ -138,11 +138,11 @@ if ($_SESSION['user_type'] != "Lecturer") {
diff --git a/Header.php b/Header.php index 86ac5ce..cc5d2d5 100644 --- a/Header.php +++ b/Header.php @@ -64,7 +64,7 @@ if (mysqli_connect_errno()) {  Admin "; + echo "     Admin "; } ?> diff --git a/index.php b/index.php index 9d4a499..d5fed03 100644 --- a/index.php +++ b/index.php @@ -33,18 +33,18 @@ if (isset($_SESSION["user_fullname"])) {
Student ID / Instructor Email - +
Password - +
-
+

Reset my password

Don't have an account? - Sign Up + Sign Up
diff --git a/signup.php b/signup.php index 95bdfe3..b4dcd34 100644 --- a/signup.php +++ b/signup.php @@ -17,24 +17,24 @@ include 'Header.php';
- + Full Name - + Student ID - + Email - + Password (must include uppercase and lowercase letters, digits and special characters) - + Confirm Password - +
- + Date: Mon, 29 Nov 2021 02:19:37 +0800 Subject: [PATCH 2/4] Update 2: test cases 05-07 --- Courses.php | 34 ++++++++++----------- test/SeleniumIbrahim/test_kit/instructor.py | 19 ++++++------ test/SeleniumIbrahim/test_kit/student.py | 6 ++-- 3 files changed, 29 insertions(+), 30 deletions(-) diff --git a/Courses.php b/Courses.php index 8db2318..9ba60e7 100644 --- a/Courses.php +++ b/Courses.php @@ -190,7 +190,7 @@ New Date/Time
Post new Lab Assignment - + @@ -205,11 +205,11 @@ New Date/Time
Title - + Instructions - + Marks - + Attachment 1 @@ -222,11 +222,11 @@ New Date/Time

- Submission Type Individual + Submission Type Individual - Group + Group
-
+




Course Name - + Course Code - + URL (Leave blank to use Course Code & Year) Academic Year - + Faculty
- + Verify Joining Students - Yes - No + Yes + No
-
+
@@ -529,7 +529,7 @@ if ($_SESSION['user_type'] == "Student") { } echo "
- [$code] $name
($url)
$msg2 + [$code] $name
($url)
$msg2
Faculty: $faculty | Year: $academic | Lecturer: $lecturer
$msg
"; } @@ -578,7 +578,7 @@ INNER JOIN course_students_table on course_students_table.Course_ID=courses_tabl
Find course by Code - +
List courses by faculty @@ -597,7 +597,7 @@ List courses by faculty

- +
diff --git a/test/SeleniumIbrahim/test_kit/instructor.py b/test/SeleniumIbrahim/test_kit/instructor.py index a738c2d..762b7c5 100644 --- a/test/SeleniumIbrahim/test_kit/instructor.py +++ b/test/SeleniumIbrahim/test_kit/instructor.py @@ -60,26 +60,25 @@ class Instructor(Actor): #wait until the lab submission form shows up wait2 = WebDriverWait(driver, 10) - new_lab_assignment_form = wait2.until(EC.presence_of_element_located((By.XPATH, "//form[@id='nlaf']"))) + new_lab_assignment_form = wait2.until(EC.presence_of_element_located((By.ID, "newlab_frm"))) #Fill the required form fields and submit. - lab_date = new_lab_assignment_form.find_element(By.XPATH, "//input[@id='date'][@name='deadlinedate']") - timeStr = self.utility.getTodayDate() - lab_date.send_keys(timeStr) - lab_title = new_lab_assignment_form.find_element(By.XPATH, "//form[@id='nlaf']/input[@id='ltitle']") + lab_date = new_lab_assignment_form.find_element(By.ID, "date") + lab_date.send_keys(dateStr) + lab_title = new_lab_assignment_form.find_element(By.ID, "lab_title") lab_title.send_keys("TESTASSIGNMENT"+str(dateStr)) - lab_instructions = new_lab_assignment_form.find_element(By.XPATH, "//form[@id='nlaf']/textarea[@id='linstruct']") + lab_instructions = new_lab_assignment_form.find_element(By.ID, "lab_inst") lab_instructions.send_keys("TESTINSTRUCTIONS"+str(dateStr)) - lab_marks = new_lab_assignment_form.find_element(By.XPATH, "//form[@id='nlaf']/input[@id='lmark']") + lab_marks = new_lab_assignment_form.find_element(By.ID, "lab_mark") lab_marks.send_keys("4") #if group == 0 select individual submission, if group == 1 select group submission if group == 0: - submission_type = new_lab_assignment_form.find_element(By.XPATH, "//form[@id='nlaf']/input[@id='lindi']") + submission_type = new_lab_assignment_form.find_element(By.ID, "lab_ind") elif group == 1: - submission_type = new_lab_assignment_form.find_element(By.XPATH, "//form[@id='nlaf']/input[@id='lgrp']") + submission_type = new_lab_assignment_form.find_element(By.ID, "lab_grp") submission_type.click() - submit = new_lab_assignment_form.find_element(By.XPATH, "//form[@id='nlaf']/input[@id='lbtn']") + submit = new_lab_assignment_form.find_element(By.ID, "submit_btn") submit.click() return 0 except: diff --git a/test/SeleniumIbrahim/test_kit/student.py b/test/SeleniumIbrahim/test_kit/student.py index acbe814..e51a67e 100644 --- a/test/SeleniumIbrahim/test_kit/student.py +++ b/test/SeleniumIbrahim/test_kit/student.py @@ -55,10 +55,10 @@ class Student(Actor): #Wait until the course is found, and join. wait2 = WebDriverWait(driver, 10) - course_card = wait.until(EC.element_to_be_clickable((By.LINK_TEXT, str("Join Course")))) - course_card.click() + join_btn = wait2.until(EC.element_to_be_clickable((By.ID, "join_btn"))) + join_btn.click() - #If the joined course successfully, proceed. + #If joined course successfully, proceed. wait3 = WebDriverWait(driver, 10).until(EC.presence_of_element_located((By.XPATH, "/html/body/div[1]/div[1]/span"))) return 0 -- 2.17.1 From 93a76611032c879518bb10a9433eeffe0908ed58 Mon Sep 17 00:00:00 2001 From: Lan Hui <1348141770@qq.com> Date: Tue, 30 Nov 2021 21:49:51 +0800 Subject: [PATCH 3/4] Repalce ex_acc with existing_accounts_tab. Why? Less vague. --- Admin.php | 2 +- test/SeleniumIbrahim/test_kit/admin.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Admin.php b/Admin.php index ea0bfac..9e6865a 100644 --- a/Admin.php +++ b/Admin.php @@ -55,7 +55,7 @@ if ($_SESSION['user_type'] != "Lecturer") { diff --git a/test/SeleniumIbrahim/test_kit/admin.py b/test/SeleniumIbrahim/test_kit/admin.py index cd25934..47e3e5c 100644 --- a/test/SeleniumIbrahim/test_kit/admin.py +++ b/test/SeleniumIbrahim/test_kit/admin.py @@ -144,7 +144,7 @@ class Admin(Actor): #Navigate to "Exisitin Accounts" table wait2 = WebDriverWait(driver, 10) - exist_acc_tab = wait2.until(EC.presence_of_element_located((By.ID, "ex_acc"))) + exist_acc_tab = wait2.until(EC.presence_of_element_located((By.ID, "existing_accounts_tab"))) exist_acc_tab.click() #Alternate between block and activate @@ -211,4 +211,4 @@ class Admin(Actor): self.utility.log_error(err_msg) print("Treminating session") self.utility.killSession(driver) - return 1 \ No newline at end of file + return 1 -- 2.17.1 From cf11ed40adc60f96073e0edb795e362894bdfd22 Mon Sep 17 00:00:00 2001 From: Ibrahim <1525200991@qq.com> Date: Fri, 3 Dec 2021 10:58:07 +0800 Subject: [PATCH 4/4] Update 2.5: Replaced some ID names --- Admin.php | 14 ++++++------- Courses.php | 20 +++++++++---------- Header.php | 2 +- index.php | 8 ++++---- signup.php | 12 +++++------ test/SeleniumIbrahim/test_kit/admin.py | 22 ++++++++++----------- test/SeleniumIbrahim/test_kit/instructor.py | 20 +++++++++---------- test/SeleniumIbrahim/test_kit/utility.py | 20 +++++++++---------- 8 files changed, 59 insertions(+), 59 deletions(-) diff --git a/Admin.php b/Admin.php index 9e6865a..5c494d9 100644 --- a/Admin.php +++ b/Admin.php @@ -66,7 +66,7 @@ if ($_SESSION['user_type'] != "Lecturer") {

Create Lecturer/TA Accounts -
+ Full_Name @@ -76,8 +76,8 @@ if ($_SESSION['user_type'] != "Lecturer") { Passport_Number / ID (Used as Intial Password)
User Type : - Lecturer - T/A + Lecturer + T/A
Reset"; if ($row['Status'] == "Active") { $newstatus = "Blocked"; - $btnBlock = ""; + $btnBlock = ""; } else { $newstatus = "Active"; - $btnBlock = ""; + $btnBlock = ""; } echo "" . $row['User_ID'] . "" . $row['Full_Name'] . "" . $row['Email'] . " " . $row['Passport_Number'] . "$btn$btnBlock"; @@ -138,11 +138,11 @@ if ($_SESSION['user_type'] != "Lecturer") {
diff --git a/Courses.php b/Courses.php index 9ba60e7..f4722a2 100644 --- a/Courses.php +++ b/Courses.php @@ -190,7 +190,7 @@ New Date/Time
Post new Lab Assignment -
+ @@ -207,7 +207,7 @@ New Date/Time
Instructions - + Marks Attachment 1 @@ -222,9 +222,9 @@ New Date/Time

- Submission Type Individual + Submission Type Individual - Group + Group





@@ -431,25 +431,25 @@ WHERE Lecturer_User_ID=$lecturer_id and course_students_table.Status='Pending'" Course Name - + Course Code - + URL (Leave blank to use Course Code & Year) Academic Year - + Faculty
- + Verify Joining Students - Yes - No + Yes + No

diff --git a/Header.php b/Header.php index cc5d2d5..a302d24 100644 --- a/Header.php +++ b/Header.php @@ -64,7 +64,7 @@ if (mysqli_connect_errno()) {  Admin "; + echo "     Admin "; } ?> diff --git a/index.php b/index.php index d5fed03..fd8c17a 100644 --- a/index.php +++ b/index.php @@ -33,18 +33,18 @@ if (isset($_SESSION["user_fullname"])) {
Student ID / Instructor Email - +
Password - +
-
+

Reset my password

Don't have an account? - Sign Up + Sign Up
diff --git a/signup.php b/signup.php index b4dcd34..97d78b4 100644 --- a/signup.php +++ b/signup.php @@ -17,24 +17,24 @@ include 'Header.php';
- + Full Name - + Student ID - + Email Password (must include uppercase and lowercase letters, digits and special characters) - + Confirm Password - +
- +