Skip to content

Commit

Permalink
Force tests to wait for brute force login event as they are fired in …
Browse files Browse the repository at this point in the history
…a separate thread

Closes keycloak#32942

Signed-off-by: Pedro Igor <[email protected]>
  • Loading branch information
pedroigor committed Oct 1, 2024
1 parent 3887ee3 commit 87db1d1
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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());

Expand Down

0 comments on commit 87db1d1

Please sign in to comment.