|
4 | 4 | import static org.junit.jupiter.api.Assertions.assertNotNull; |
5 | 5 | import static org.junit.jupiter.api.Assertions.assertTrue; |
6 | 6 |
|
| 7 | +import org.junit.jupiter.api.Assertions; |
7 | 8 | import org.junit.jupiter.api.DisplayName; |
8 | 9 | import org.junit.jupiter.params.ParameterizedTest; |
9 | 10 | import org.junit.jupiter.params.provider.EnumSource; |
| 11 | +import org.openqa.selenium.support.ui.ExpectedConditions; |
10 | 12 |
|
11 | 13 | import software.xdev.sse.demo.entities.UserDetail; |
12 | 14 | import software.xdev.sse.demo.persistence.jpa.dao.UserDetailDAO; |
@@ -47,6 +49,25 @@ void checkSignupOfUser(final TestBrowser browser) |
47 | 49 | assertEquals(this.oidcInfra().getDefaultUserName(), user.getFullName()); |
48 | 50 | } |
49 | 51 |
|
| 52 | + @DisplayName("Re-Login should keep url") |
| 53 | + @ParameterizedTest |
| 54 | + @EnumSource(TestBrowser.class) |
| 55 | + void checkReLoginShouldKeepUrl(final TestBrowser browser) |
| 56 | + { |
| 57 | + this.startAll(browser, dbCtrl -> dbCtrl.useNewEntityManager(em -> new DefaultDG(em).generateAll())); |
| 58 | + |
| 59 | + this.loginAndGotoMainSite(); |
| 60 | + this.navigateTo("another"); |
| 61 | + |
| 62 | + // Delete all cookies of the CURRENT domain |
| 63 | + this.getWebDriver().manage().deleteAllCookies(); |
| 64 | + this.getWebDriver().navigate().refresh(); |
| 65 | + |
| 66 | + // Should be restored to the same path/view |
| 67 | + Assertions.assertDoesNotThrow(() -> |
| 68 | + this.waitUntil(ExpectedConditions.urlToBe(this.getWebAppBaseUrl() + "/another?continue"))); |
| 69 | + } |
| 70 | + |
50 | 71 | @DisplayName("Check Login works when OIDC offline") |
51 | 72 | @ParameterizedTest |
52 | 73 | @EnumSource(TestBrowser.class) |
|
0 commit comments