From e1d5f0c8715ed66088db2fadba820642b819da6e Mon Sep 17 00:00:00 2001 From: mposolda Date: Fri, 6 Sep 2024 13:18:07 +0200 Subject: [PATCH] Fix ResetPasswordTest on chrome 128 closes #32514 closes #32478 closes #32477 closes #32678 closes #32542 closes #32678 closes #32541 Signed-off-by: mposolda --- .../java/org/keycloak/testsuite/pages/LoginPage.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/pages/LoginPage.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/pages/LoginPage.java index 83d2056de8..6a302db8cf 100755 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/pages/LoginPage.java +++ b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/pages/LoginPage.java @@ -19,12 +19,14 @@ package org.keycloak.testsuite.pages; import org.jboss.arquillian.test.api.ArquillianResource; import org.junit.Assert; +import org.keycloak.common.util.Retry; import org.keycloak.testsuite.util.DroneUtils; import org.keycloak.testsuite.util.OAuthClient; import org.keycloak.testsuite.util.WaitUtils; import org.openqa.selenium.By; import org.openqa.selenium.NoSuchElementException; import org.openqa.selenium.WebElement; +import org.openqa.selenium.chrome.ChromeDriver; import org.openqa.selenium.support.FindBy; import static org.keycloak.testsuite.util.UIUtils.clickLink; @@ -233,7 +235,14 @@ public class LoginPage extends LanguageComboboxAwarePage { } public void resetPassword() { - clickLink(resetPasswordLink); + // Since Chrome 128, the user can be still kept on the "Login page" after click to "Forget Password" link. Clicking the "Forget Password" link another + // time usually helps. Limit to 4 attempts for now. + Retry.execute(() -> { + clickLink(resetPasswordLink); + if (driver instanceof ChromeDriver) { + Assert.assertEquals("Forgot Your Password?", PageUtils.getPageTitle(driver)); + } + }, 4, 0); } public void setRememberMe(boolean enable) {