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") {
- Existing Accounts
+ Existing Accounts
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") {