|
@@ -16,6 +16,9 @@
|
|
|
|
|
|
package example;
|
|
|
|
|
|
+import java.util.ArrayList;
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
import com.gargoylesoftware.htmlunit.ElementNotFoundException;
|
|
|
import com.gargoylesoftware.htmlunit.WebClient;
|
|
|
import com.gargoylesoftware.htmlunit.html.HtmlElement;
|
|
@@ -62,7 +65,20 @@ public class Saml2LoginApplicationITests {
|
|
|
HtmlPage home = (HtmlPage) Saml2LoginApplicationITests.this.webClient.getCurrentWindow().getEnclosedPage();
|
|
|
HtmlElement rpLogoutButton = home.getHtmlElementById("rp_logout_button");
|
|
|
HtmlPage loginPage = rpLogoutButton.click();
|
|
|
- assertThat(loginPage.getUrl().getFile()).isEqualTo("/login?logout");
|
|
|
+ this.webClient.waitForBackgroundJavaScript(10000);
|
|
|
+ List<String> urls = new ArrayList<>();
|
|
|
+ urls.add(loginPage.getUrl().getFile());
|
|
|
+ urls.add(((HtmlPage) this.webClient.getCurrentWindow().getEnclosedPage()).getUrl().getFile());
|
|
|
+ assertThat(urls).withFailMessage(() -> {
|
|
|
+ // @formatter:off
|
|
|
+ String builder = loginPage.asXml()
|
|
|
+ + "\n\n\n"
|
|
|
+ + "Enclosing Page"
|
|
|
+ + "\n\n\n"
|
|
|
+ + ((HtmlPage) this.webClient.getCurrentWindow().getEnclosedPage()).asXml();
|
|
|
+ // @formatter:on
|
|
|
+ return builder;
|
|
|
+ }).contains("/login?logout");
|
|
|
}
|
|
|
|
|
|
private void performLogin() throws Exception {
|