From b24d446911bd3d717066fec555bb52f1ea0ddc81 Mon Sep 17 00:00:00 2001 From: Giuseppe Graziano Date: Wed, 20 Mar 2024 17:01:07 +0100 Subject: [PATCH] Avoid using wait() to wait for the redirect Closes #22644 Signed-off-by: Giuseppe Graziano --- .../java/org/keycloak/testsuite/forms/BrowserFlowTest.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/forms/BrowserFlowTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/forms/BrowserFlowTest.java index 59dbe39550..38ce45b54a 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/forms/BrowserFlowTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/forms/BrowserFlowTest.java @@ -60,6 +60,7 @@ import java.util.function.Consumer; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.containsString; import static org.keycloak.testsuite.admin.AbstractAdminTest.loadJson; +import static org.keycloak.testsuite.broker.BrokerTestTools.waitForPage; import static org.keycloak.testsuite.broker.SocialLoginTest.Provider.GITHUB; import static org.keycloak.testsuite.broker.SocialLoginTest.Provider.GITLAB; import static org.keycloak.testsuite.broker.SocialLoginTest.Provider.GOOGLE; @@ -565,10 +566,8 @@ public class BrowserFlowTest extends AbstractTestRealmKeycloakTest { WebElement aHref = driver.findElement(By.tagName("a")); driver.get(aHref.getAttribute("href")); // Waiting for account redirection from app page - driver.wait(1000); + waitForPage(driver, "Account Management", true); assertThat(driver.getTitle(), containsString("Account Management")); - } catch (Throwable t) { - t.printStackTrace(); } finally { revertFlows("browser - alternative non-interactive executor"); }