Skip to content

Commit

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

// Verify classes are 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");

// Check if classes are ordered by date
boolean isOrderedByDate = true;
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();
if (previousDate.compareTo(currentDate) > 0) {
isOrderedByDate = false;
break;
Expand Down

0 comments on commit 34c79e5

Please sign in to comment.