diff --git a/java/client/test/org/openqa/selenium/support/ui/WebDriverWaitTest.java b/java/client/test/org/openqa/selenium/support/ui/WebDriverWaitTest.java index d8ec4e6f6dbe5..5504a9152a7f5 100644 --- a/java/client/test/org/openqa/selenium/support/ui/WebDriverWaitTest.java +++ b/java/client/test/org/openqa/selenium/support/ui/WebDriverWaitTest.java @@ -44,6 +44,7 @@ import org.openqa.selenium.remote.SessionId; import java.io.IOException; +import java.time.Duration; public class WebDriverWaitTest { @@ -68,7 +69,8 @@ public void shouldIncludeRemoteInfoForWrappedDriverTimeout() throws IOException when(((WrapsDriver) testDriver).getWrappedDriver()).thenReturn(driver); TickingClock clock = new TickingClock(); - WebDriverWait wait = new WebDriverWait(testDriver, clock, clock, 1, 200); + WebDriverWait wait = + new WebDriverWait(testDriver, Duration.ofSeconds(1), Duration.ofMillis(200), clock, clock); assertThatExceptionOfType(TimeoutException.class) .isThrownBy(() -> wait.until((d) -> false)) @@ -79,7 +81,8 @@ public void shouldIncludeRemoteInfoForWrappedDriverTimeout() throws IOException @Test public void shouldThrowAnExceptionIfTheTimerRunsOut() { TickingClock clock = new TickingClock(); - WebDriverWait wait = new WebDriverWait(mockDriver, clock, clock, 1, 200); + WebDriverWait wait = + new WebDriverWait(testDriver, Duration.ofSeconds(1), Duration.ofMillis(200), clock, clock); assertThatExceptionOfType(TimeoutException.class) .isThrownBy(() -> wait.until((d) -> false)); @@ -94,7 +97,8 @@ public void shouldSilentlyCaptureNoSuchElementExceptions() { .thenReturn(mockElement); TickingClock clock = new TickingClock(); - Wait wait = new WebDriverWait(mockDriver, clock, clock, 5, 500); + Wait wait = + new WebDriverWait(mockDriver, Duration.ofSeconds(5), Duration.ofMillis(500), clock, clock); assertThat(wait.until(condition)).isSameAs(mockElement); } @@ -107,7 +111,8 @@ public void shouldSilentlyCaptureNoSuchFrameExceptions() { .thenReturn(mockElement); TickingClock clock = new TickingClock(); - Wait wait = new WebDriverWait(mockDriver, clock, clock, 5, 500); + Wait wait = + new WebDriverWait(mockDriver, Duration.ofSeconds(5), Duration.ofMillis(500), clock, clock); wait.until(condition); } @@ -121,7 +126,8 @@ public void shouldSilentlyCaptureNoSuchWindowExceptions() { .thenReturn(mockElement); TickingClock clock = new TickingClock(); - Wait wait = new WebDriverWait(mockDriver, clock, clock, 5, 500); + Wait wait = + new WebDriverWait(mockDriver, Duration.ofSeconds(5), Duration.ofMillis(500), clock, clock); wait.until(condition); } }