From 6437c3149407109744aa8e5412d36eea1d6999a1 Mon Sep 17 00:00:00 2001 From: Marco Collovati Date: Sun, 22 Dec 2024 16:57:59 +0100 Subject: [PATCH] test: fix session expire notication test (#141) --- vertx-vaadin-tests/pom.xml | 9 ++++++--- .../vaadin/flow/uitest/ui/InternalErrorIT.java | 16 ++++++++-------- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/vertx-vaadin-tests/pom.xml b/vertx-vaadin-tests/pom.xml index ec3e555f..6daaca28 100644 --- a/vertx-vaadin-tests/pom.xml +++ b/vertx-vaadin-tests/pom.xml @@ -22,6 +22,9 @@ 1.0.17 false + 3 + 4 + 2 @@ -153,11 +156,11 @@ true all 2 - 3 + ${failsafe.rerunFailingTestsCount} - 4 + ${testbench.testInParallel} - 2 + ${testbench.maxAttempts} ${webdriver.chrome.driver} diff --git a/vertx-vaadin-tests/test-root-context/src/test/java/com/vaadin/flow/uitest/ui/InternalErrorIT.java b/vertx-vaadin-tests/test-root-context/src/test/java/com/vaadin/flow/uitest/ui/InternalErrorIT.java index 265384ee..71399a7e 100644 --- a/vertx-vaadin-tests/test-root-context/src/test/java/com/vaadin/flow/uitest/ui/InternalErrorIT.java +++ b/vertx-vaadin-tests/test-root-context/src/test/java/com/vaadin/flow/uitest/ui/InternalErrorIT.java @@ -87,25 +87,25 @@ public void sessionExpired_refreshByDefault() { } @Test - public void enableSessionExpiredNotification_sessionExpired_notificationShown() { + public void enableSessionExpiredNotification_sessionExpired_notificationShown() throws InterruptedException { clickButton("enable-notification"); // Refresh to take the new config into use getDriver().navigate().refresh(); clickButton(UPDATE); + waitUntil(driver -> isMessageUpdated()); clickButton(CLOSE_SESSION); // Just click on any button to make a request after killing the session clickButton(CLOSE_SESSION); - assertTrue( - "After enabling the 'Session Expired' notification, " - + "the page should not be refreshed " - + "after killing the session", - isMessageUpdated()); - assertTrue( - "After enabling the 'Session Expired' notification " + waitUntil(d -> isSessionExpiredNotificationPresent()); + + Assert.assertTrue("After enabling the 'Session Expired' notification, " + + "the page should not be refreshed " + + "after killing the session", isMessageUpdated()); + Assert.assertTrue("After enabling the 'Session Expired' notification " + "and killing the session, the notification should be displayed", isSessionExpiredNotificationPresent()); }