Skip to content

Commit

Permalink
Update Cypress
Browse files Browse the repository at this point in the history
  • Loading branch information
igor-korost committed Mar 6, 2024
1 parent 90b4fe2 commit 3058d29
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,20 @@ public void checkSnackbarWithNoActionTest() {

@Test
public void checkSnackbarDurationTest() {
final int DURATION = 5;

JAction action = () -> {
snackBarPage.customSnackbar.base().timer().wait(() -> snackBarPage.customSnackbar.isDisplayed());
snackBarPage.customSnackbar.base().timer().wait(() -> snackBarPage.customSnackbar.isHidden());
};
final int DURATION = 5; // Duration in seconds

// Set the duration for the snackbar visibility
snackBarPage.durationInput.setValue(String.valueOf(DURATION));

// Open the custom snackbar
snackBarPage.customSnackbarOpenButton.click();

// Wait for the snackbar to be displayed
snackBarPage.customSnackbar.base().timer().waitFor(() -> snackBarPage.customSnackbar.isDisplayed(), DURATION, "Snackbar did not appear in expected time");

// Then, wait for the snackbar to disappear.
// Assuming snackbar visibility duration is DURATION, add a buffer to wait for disappearance.
int waitTimeForDisappearance = DURATION + 2; // Adding a buffer time for it to disappear
snackBarPage.customSnackbar.base().timer().waitFor(() -> snackBarPage.customSnackbar.isHidden(), waitTimeForDisappearance, "Snackbar did not disappear in expected time");
}
}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
arguments=--headless
arguments=--headed

0 comments on commit 3058d29

Please sign in to comment.