diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/broker/AbstractAdvancedBrokerTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/broker/AbstractAdvancedBrokerTest.java index e6b645aee336..cf2b44255a23 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/broker/AbstractAdvancedBrokerTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/broker/AbstractAdvancedBrokerTest.java @@ -29,6 +29,7 @@ import org.keycloak.testsuite.util.OAuthClient; import org.keycloak.testsuite.util.RealmBuilder; import org.keycloak.testsuite.util.TestAppHelper; +import org.keycloak.testsuite.util.WaitUtils; import org.openqa.selenium.TimeoutException; import jakarta.ws.rs.client.Client; @@ -566,12 +567,12 @@ public void testPostBrokerLoginFlowWithOTP_bruteForceEnabled() { loginTotpPage.assertCurrent(); + events.clear(); + // Login for 2 times with incorrect TOTP. This should temporarily disable the user loginTotpPage.login("bad-totp"); Assert.assertEquals("Invalid authenticator code.", loginTotpPage.getInputError()); - - events.clear(); - + WaitUtils.waitForPageToLoad(); loginTotpPage.login("bad-totp"); Assert.assertEquals("Invalid authenticator code.", loginTotpPage.getInputError());