Skip to content

Commit 317328a

Browse files
committed
Additional test "Re-Login should not keep url if view does not exist"
1 parent e4f79fd commit 317328a

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

  • demo/integration-tests/webapp-vaadin-it/src/test/java/software/xdev/sse/demo/vaadin/cases

demo/integration-tests/webapp-vaadin-it/src/test/java/software/xdev/sse/demo/vaadin/cases/LoginOIDCTest.java

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,25 @@ void checkReLoginShouldKeepUrl(final TestBrowser browser)
6868
this.waitUntil(ExpectedConditions.urlToBe(this.getWebAppBaseUrl() + "/another?continue")));
6969
}
7070

71+
@DisplayName("Re-Login should not keep url if view does not exist")
72+
@ParameterizedTest
73+
@EnumSource(TestBrowser.class)
74+
void checkReLoginShouldNOTKeepUrlIfViewDoesNotExist(final TestBrowser browser)
75+
{
76+
this.startAll(browser, dbCtrl -> dbCtrl.useNewEntityManager(em -> new DefaultDG(em).generateAll()));
77+
78+
this.loginAndGotoMainSite();
79+
this.navigateTo("anotherThatDoesNotExist");
80+
81+
// Delete all cookies of the CURRENT domain
82+
this.getWebDriver().manage().deleteAllCookies();
83+
this.getWebDriver().navigate().refresh();
84+
85+
// Should be restored to the same path/view
86+
Assertions.assertDoesNotThrow(() ->
87+
this.waitUntil(ExpectedConditions.urlToBe(this.getWebAppBaseUrl() + "/main")));
88+
}
89+
7190
@DisplayName("Check Login works when OIDC offline")
7291
@ParameterizedTest
7392
@EnumSource(TestBrowser.class)

0 commit comments

Comments
 (0)