Skip to content

Commit

Permalink
userAccessCoursesAndViewClassesCOT4oTest passing!
Browse files Browse the repository at this point in the history
  • Loading branch information
augustocristian committed Jul 30, 2024
1 parent 34c79e5 commit 079b0cf
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -170,16 +170,17 @@ void userAccessCoursesAndViewClassesCOT4oTest(String mail, String password, Stri
String courseName = courses.get(0); // Select the first course for simplicity
WebElement course = CourseNavigationUtilities.getCourseByName(driver, courseName);
course.findElement(By.cssSelector(".course-title")).click();
Wait.notTooMuch(driver).until(ExpectedConditions.visibilityOfElementLocated(By.id("course-page")));
CourseNavigationUtilities.go2Tab(driver, SESSION_ICON);
Wait.notTooMuch(driver).until(ExpectedConditions.visibilityOfElementLocated(By.className("session-data")));

// Step 4: System displays the classes within the course, ordered by date
List<WebElement> classes = driver.findElements(By.cssSelector(".class-item"));
List<WebElement> classes = driver.findElements(By.className("session-data"));
assertTrue(classes.size() > 0, "No classes found in the course");

// Verify that classes are ordered by date
for (int i = 1; i < classes.size(); i++) {
String previousDate = classes.get(i - 1).findElement(By.cssSelector(".class-date")).getText();
String currentDate = classes.get(i).findElement(By.cssSelector(".class-date")).getText();
String previousDate = classes.get(i - 1).findElement(By.className("session-datetime")).getText();
String currentDate = classes.get(i).findElement(By.className("session-datetime")).getText();
assertTrue(previousDate.compareTo(currentDate) <= 0, "Classes are not ordered by date");
}

Expand Down

0 comments on commit 079b0cf

Please sign in to comment.