8000 Stabilize flaky test PasskeysUsernameFormTest by ahus1 · Pull Request #52077 · keycloak/keycloak · GitHub
[go: up one dir, main page]

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Unified Diff View
Unified
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public void fillPassword(String password) {
}

public void submit() {
submitButton.click();
driver.waiting().waitForPageReload(() -> submitButton.click());
}

public void clickSocial(String alias) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public String getUsernameInputError() {
}

public void submit() {
submitButton.click();
driver.waiting().waitForPageReload(() -> submitButton.click());
}

@Override
Expand Down
8000
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public void fillPassword(String password) {
}

public void submit() {
submitButton.click();
driver.waiting().waitForPageReload(() -> submitButton.click());
}

public String getPassword() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,12 @@
import org.keycloak.testframework.ui.page.AbstractPage;

import org.junit.jupiter.api.Assertions;
import org.openqa.selenium.By;
import org.openqa.selenium.StaleElementReferenceException;
import org.openqa.selenium.TimeoutException;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.WebDriverWait;

public class WaitUtils {
Expand Down Expand Up @@ -58,6 +61,13 @@ public WaitUtils waitForTitle(String title) {
return this;
}

public WaitUtils waitForPageReload(Runnable action) {
WebElement body = managed.findElement(By.tagName("body"));
action.run();
createDefaultWait().until(ExpectedConditions.stalenessOf(body));
return this;
}

public <V> V until(Function<WebDriver, V> isTrue) {
return createDefaultWait().until(isTrue);
}
Expand Down
Loading
0