Fix ResetPasswordTest on chrome 128

closes #32514
closes #32478
closes #32477
closes #32678
closes #32542
closes #32678
closes #32541

Signed-off-by: mposolda <mposolda@gmail.com>
This commit is contained in:
mposolda 2024-09-06 13:18:07 +02:00 committed by Marek Posolda
parent 3c4763d41b
commit e1d5f0c871

View file

@ -19,12 +19,14 @@ package org.keycloak.testsuite.pages;
import org.jboss.arquillian.test.api.ArquillianResource; import org.jboss.arquillian.test.api.ArquillianResource;
import org.junit.Assert; import org.junit.Assert;
import org.keycloak.common.util.Retry;
import org.keycloak.testsuite.util.DroneUtils; import org.keycloak.testsuite.util.DroneUtils;
import org.keycloak.testsuite.util.OAuthClient; import org.keycloak.testsuite.util.OAuthClient;
import org.keycloak.testsuite.util.WaitUtils; import org.keycloak.testsuite.util.WaitUtils;
import org.openqa.selenium.By; import org.openqa.selenium.By;
import org.openqa.selenium.NoSuchElementException; import org.openqa.selenium.NoSuchElementException;
import org.openqa.selenium.WebElement; import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.support.FindBy; import org.openqa.selenium.support.FindBy;
import static org.keycloak.testsuite.util.UIUtils.clickLink; import static org.keycloak.testsuite.util.UIUtils.clickLink;
@ -233,7 +235,14 @@ public class LoginPage extends LanguageComboboxAwarePage {
} }
public void resetPassword() { 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) { public void setRememberMe(boolean enable) {