Skip to content

Commit 6149489

Browse files
committed
Merge branch '6.4.x'
fix flakey test in WebAuthnWebDriverTests Closes gh-16464
2 parents 4ee9358 + 028c212 commit 6149489

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

config/src/integration-test/java/org/springframework/security/config/annotation/configurers/WebAuthnWebDriverTests.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
import org.junit.jupiter.api.BeforeEach;
3434
import org.junit.jupiter.api.Test;
3535
import org.openqa.selenium.By;
36+
import org.openqa.selenium.WebDriverException;
3637
import org.openqa.selenium.WebElement;
3738
import org.openqa.selenium.chrome.ChromeDriverService;
3839
import org.openqa.selenium.chrome.ChromeOptions;
@@ -273,12 +274,14 @@ private AbstractStringAssert<?> assertHasAlertStartingWith(String alertType, Str
273274

274275
/**
275276
* Await until the assertion passes. If the assertion fails, it will display the
276-
* assertion error in stdout.
277+
* assertion error in stdout. WebDriver-related exceptions are ignored, so that
278+
* {@code assertion}s can interact with the page and be retried on error, e.g.
279+
* {@code assertThat(this.driver.findElement(By.Id("some-id")).isNotNull()}.
277280
*/
278281
private void await(Supplier<AbstractAssert<?, ?>> assertion) {
279282
new FluentWait<>(this.driver).withTimeout(Duration.ofSeconds(2))
280283
.pollingEvery(Duration.ofMillis(100))
281-
.ignoring(AssertionError.class)
284+
.ignoring(AssertionError.class, WebDriverException.class)
282285
.until((d) -> {
283286
assertion.get();
284287
return true;

0 commit comments

Comments
 (0)