|
@@ -100,6 +100,15 @@ class CasLoginApplicationTests {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @Test
|
|
|
|
+ void publicPageWhenCasGatewayAuthenticationThenAuthenticated() {
|
|
|
|
+ try (Page page = doLogin()) {
|
|
|
|
+ page.navigate("http://localhost:" + this.port + "/public");
|
|
|
|
+ String lead = page.locator(".lead").textContent();
|
|
|
|
+ assertThat(lead).isEqualTo("You are successfully logged in as casuser");
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
private Page doLogin() {
|
|
private Page doLogin() {
|
|
Page page = this.browser.newPage();
|
|
Page page = this.browser.newPage();
|
|
page.navigate("http://localhost:" + this.port);
|
|
page.navigate("http://localhost:" + this.port);
|
|
@@ -109,19 +118,4 @@ class CasLoginApplicationTests {
|
|
return page;
|
|
return page;
|
|
}
|
|
}
|
|
|
|
|
|
- @Test
|
|
|
|
- void publicPageWhenCasGatewayAuthenticationThenAuthenticated() {
|
|
|
|
- doCasLogin();
|
|
|
|
- Selenide.open("http://localhost:" + this.port + "/public");
|
|
|
|
- String lead = Selenide.$(By.className("lead")).text();
|
|
|
|
- assertThat(lead).isEqualTo("You are successfully logged in as casuser");
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- private void doCasLogin() {
|
|
|
|
- Selenide.open(this.environment.getProperty("cas.login.url"));
|
|
|
|
- Selenide.$(By.name("username")).setValue("casuser");
|
|
|
|
- Selenide.$(By.name("password")).setValue("Mellon");
|
|
|
|
- Selenide.$(By.name("submitBtn")).click();
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
}
|
|
}
|