Skip to content

Commit

Permalink
test: fix session expire notication test (#141)
Browse files Browse the repository at this point in the history
  • Loading branch information
mcollovati authored Dec 22, 2024
1 parent 7def7e5 commit 6437c31
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 deletions.
9 changes: 6 additions & 3 deletions vertx-vaadin-tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
<driver.binary.downloader.maven.plugin.version>1.0.17</driver.binary.downloader.maven.plugin.version>
<skipVertxRun>false</skipVertxRun>
<test.vertx.jvmArgs></test.vertx.jvmArgs>
<failsafe.rerunFailingTestsCount>3</failsafe.rerunFailingTestsCount>
<testbench.testInParallel>4</testbench.testInParallel>
<testbench.maxAttempts>2</testbench.maxAttempts>
</properties>

<dependencyManagement>
Expand Down Expand Up @@ -153,11 +156,11 @@
<enableAssertions>true</enableAssertions>
<parallel>all</parallel>
<threadCount>2</threadCount>
<rerunFailingTestsCount>3</rerunFailingTestsCount>
<rerunFailingTestsCount>${failsafe.rerunFailingTestsCount}</rerunFailingTestsCount>
<systemPropertyVariables>
<com.vaadin.testbench.Parameters.testsInParallel>4
<com.vaadin.testbench.Parameters.testsInParallel>${testbench.testInParallel}
</com.vaadin.testbench.Parameters.testsInParallel>
<com.vaadin.testbench.Parameters.maxAttempts>2
<com.vaadin.testbench.Parameters.maxAttempts>${testbench.maxAttempts}
</com.vaadin.testbench.Parameters.maxAttempts>
<webdriver.chrome.driver>${webdriver.chrome.driver}</webdriver.chrome.driver>
</systemPropertyVariables>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
Expand Down

0 comments on commit 6437c31

Please sign in to comment.