-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
userCanAccessAndViewCalendarCOT4MiniTest passing! userAccessingCalendarFS4oMiniTest passing! userCanAccessAndViewCalendarCOT4oTest passing! userAccessCalendarFS4oTest passing! teacherCreatesCourseCOT4oMiniTest passing! teacherCreatesCourseFS4oMiniTest passing! teacherCreateCourseCOT4oTest passing! teacherCreateCourseFS4oTest passing! userAccessCoursesAndViewClassesCOT4oMiniTest passing! userAccessCoursesAndViewClassesFS4oMiniTest passing! userAccessCoursesAndViewClassesCOT4oTest passing! accessCoursesAndViewClassesFS4oTest passing! viewEnrolledCoursesCOT4oMiniTest passing! viewEnrolledCoursesFS4oMiniTest passing! viewEnrolledCoursesCOT4oTest passing! viewEnrolledCoursesFS4oTest passing!
- Loading branch information
1 parent
f694c32
commit 2270617
Showing
5 changed files
with
108 additions
and
99 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -125,8 +125,8 @@ void viewEnrolledCoursesFS4oTest(String mail, String password, String role) { | |
} | ||
|
||
// Step 3: System displays a list of courses the user is enrolled in | ||
Wait.notTooMuch(driver).until(ExpectedConditions.visibilityOfElementLocated(By.id("courses-list"))); | ||
List<WebElement> courses = driver.findElements(By.className("course-item")); | ||
Wait.notTooMuch(driver).until(ExpectedConditions.visibilityOfElementLocated(By.id("course-list"))); | ||
List<WebElement> courses = driver.findElements(By.className("course-list-item")); | ||
|
||
// Expected Output: The dashboard shows a list of courses the user is enrolled in | ||
assertTrue(courses.size() > 0, "No enrolled courses found for the user"); | ||
|
@@ -144,18 +144,19 @@ void viewEnrolledCoursesCOT4oTest(String email, String password, String role) { | |
// Setup | ||
//String email = "[email protected]"; | ||
//String password = "password"; | ||
String[] expectedCourses = {"Course 1", "Course 2", "Course 3"}; | ||
String[] expectedCourses = {"Pseudoscientific course for treating the evil eye", "Don't mind. This is a real course"}; | ||
|
||
// Login | ||
this.slowLogin(user, email, password); | ||
|
||
// Verify Dashboard | ||
try { | ||
NavigationUtilities.toCoursesHome(driver); | ||
// Wait for the dashboard to load | ||
Wait.notTooMuch(driver).until(ExpectedConditions.presenceOfElementLocated(By.id("dashboard"))); | ||
Wait.notTooMuch(driver).until(ExpectedConditions.presenceOfElementLocated(COURSES_DASHBOARD_TITLE)); | ||
|
||
// Get the list of enrolled courses | ||
List<WebElement> courses = driver.findElements(By.className("course-title")); | ||
List<WebElement> courses = driver.findElements(By.className("title")); | ||
|
||
// Verify the number of courses | ||
assertEquals(expectedCourses.length, courses.size(), "Number of enrolled courses does not match"); | ||
|
@@ -187,11 +188,11 @@ void viewEnrolledCoursesFS4oMiniTest(String mail, String password, String role) | |
NavigationUtilities.toCoursesHome(driver); | ||
|
||
// Wait for the courses list to be visible | ||
Wait.notTooMuch(driver).until(ExpectedConditions.visibilityOfElementLocated(By.id("enrolledCoursesList"))); | ||
Wait.notTooMuch(driver).until(ExpectedConditions.visibilityOfElementLocated(By.id("course-list"))); | ||
|
||
// Verify that the dashboard shows a list of courses the user is enrolled in | ||
List<WebElement> enrolledCourses = driver.findElements(By.className("course-title")); | ||
assertFalse(enrolledCourses.isEmpty(), "The enrolled courses list should not be empty."); | ||
List<WebElement> enrolledCourses = driver.findElements(By.className("course-list-item")); | ||
assertFalse(enrolledCourses.size()!=2, "The enrolled courses list should not be empty."); | ||
|
||
// Optionally, you can check for specific course titles if known | ||
// assertTrue(enrolledCourses.stream().anyMatch(course -> course.getText().equals("Expected Course Title")), "Expected course is not found in the enrolled courses list."); | ||
|
@@ -211,7 +212,7 @@ void viewEnrolledCoursesCOT4oMiniTest(String email, String password, String role | |
NavigationUtilities.toCoursesHome(driver); | ||
|
||
// Verification: Check that the system displays a list of enrolled courses | ||
List<WebElement> enrolledCourses = driver.findElements(By.className("enrolled-course")); // Replace with actual class name for enrolled courses | ||
List<WebElement> enrolledCourses = driver.findElements(By.className("course-list-item")); // Replace with actual class name for enrolled courses | ||
Assertions.assertFalse(enrolledCourses.isEmpty(), "The enrolled courses list should not be empty."); | ||
|
||
// Optionally, validate the content of the enrolled courses | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.