Skip to content

Commit

Permalink
userCanAccessAndViewCalendarCOT4MiniTest passing!
Browse files Browse the repository at this point in the history
  • Loading branch information
augustocristian committed Jul 30, 2024
1 parent de6b6fb commit ff78843
Showing 1 changed file with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import com.fullteaching.e2e.no_elastest.utils.Wait;
import giis.retorch.annotations.AccessMode;
import giis.retorch.annotations.Resource;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Tag;
Expand Down Expand Up @@ -177,22 +178,22 @@ void userCanAccessAndViewCalendarCOT4MiniTest(String mail, String password, Stri

try {
// Step 2: User navigates to the calendar page
//NavigationUtilities.toCalendarPage(driver);
NavigationUtilities.toCoursesHome(driver);

// Step 3: Verify calendar display
//Wait.notTooMuch(driver).until(ExpectedConditions.visibilityOfElementLocated(By.id(CALENDAR_ID)));
//WebElement calendar = driver.findElement(By.id(CALENDAR_ID));
//assertTrue(calendar.isDisplayed(), "Calendar is not displayed");
Wait.notTooMuch(driver).until(ExpectedConditions.visibilityOfElementLocated(By.className("calendar-div")));
WebElement calendar = driver.findElement(By.className("calendar-div"));
assertTrue(calendar.isDisplayed(), "Calendar is not displayed");

// Step 4: Check that the calendar shows all the user's classes
//List<WebElement> classes = calendar.findElements(By.className(CLASS_ITEM_CLASS));
//assertTrue(classes.size() > 0, "No classes found in the calendar");
List<WebElement> classes = calendar.findElements(By.className("cal-day-badge")); ;
assertTrue(classes.size() > 0, "No classes found in the calendar");

// Optionally, you can validate the class details here
// For example, check if the classes match expected classes for the user

} catch (Exception e) {
//Assertions.fail("Failed to access and view the calendar: " + e.getMessage());
Assertions.fail("Failed to access and view the calendar: " + e.getMessage());
} finally {
// Step 5: Teardown if necessary
user.getDriver().get(APP_URL); // Navigate back to the main page or logout
Expand Down

0 comments on commit ff78843

Please sign in to comment.