From c6e5fb5a0e572018f1dff904891a4427528b6fdf Mon Sep 17 00:00:00 2001 From: Igor Korostelev <74544655+igor-korost@users.noreply.github.com> Date: Wed, 6 Mar 2024 15:39:59 +0500 Subject: [PATCH] Revert "Update Cypress" This reverts commit 3058d291a0bb430efdbff2e8087f16a1be8db679. --- .../tests/elements/complex/SnackbarTests.java | 18 ++++++------------ .../src/test/resources/common.properties | 2 +- 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/jdi-light-angular-tests/src/test/java/io/github/epam/angular/tests/elements/complex/SnackbarTests.java b/jdi-light-angular-tests/src/test/java/io/github/epam/angular/tests/elements/complex/SnackbarTests.java index 8e2ead76b2..d742fe8631 100644 --- a/jdi-light-angular-tests/src/test/java/io/github/epam/angular/tests/elements/complex/SnackbarTests.java +++ b/jdi-light-angular-tests/src/test/java/io/github/epam/angular/tests/elements/complex/SnackbarTests.java @@ -54,20 +54,14 @@ public void checkSnackbarWithNoActionTest() { @Test public void checkSnackbarDurationTest() { - final int DURATION = 5; // Duration in seconds + final int DURATION = 5; - // Set the duration for the snackbar visibility - snackBarPage.durationInput.setValue(String.valueOf(DURATION)); + JAction action = () -> { + snackBarPage.customSnackbar.base().timer().wait(() -> snackBarPage.customSnackbar.isDisplayed()); + snackBarPage.customSnackbar.base().timer().wait(() -> snackBarPage.customSnackbar.isHidden()); + }; - // Open the custom snackbar + snackBarPage.durationInput.setValue(String.valueOf(DURATION)); 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"); } } diff --git a/jdi-light-angular-tests/src/test/resources/common.properties b/jdi-light-angular-tests/src/test/resources/common.properties index 91b3603f15..c31a28a764 100644 --- a/jdi-light-angular-tests/src/test/resources/common.properties +++ b/jdi-light-angular-tests/src/test/resources/common.properties @@ -1 +1 @@ -arguments=--headed +arguments=--headless