From dce1a8a4ae450f48ccf69dcf69ea26ef51853e64 Mon Sep 17 00:00:00 2001 From: labkey-tchad Date: Tue, 31 May 2022 12:19:55 -0700 Subject: [PATCH] Update to Selenium 4.2 Stop using deprecated `WebDriverWait` constructor --- .../src/org/labkey/test/pages/ehr/AnimalHistoryPage.java | 5 +++-- ehr/test/src/org/labkey/test/util/ehr/EHRTestHelper.java | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/ehr/test/src/org/labkey/test/pages/ehr/AnimalHistoryPage.java b/ehr/test/src/org/labkey/test/pages/ehr/AnimalHistoryPage.java index fc1557ec9..793109d81 100644 --- a/ehr/test/src/org/labkey/test/pages/ehr/AnimalHistoryPage.java +++ b/ehr/test/src/org/labkey/test/pages/ehr/AnimalHistoryPage.java @@ -27,6 +27,7 @@ import org.openqa.selenium.WebElement; import org.openqa.selenium.support.ui.WebDriverWait; +import java.time.Duration; import java.util.ArrayList; import java.util.Arrays; import java.util.Iterator; @@ -69,7 +70,7 @@ public A refreshReport() { doAndWaitForPageSignal( () -> elementCache().updateButton.click(), - REPORT_TAB_SIGNAL, new WebDriverWait(getDriver(), 60)); + REPORT_TAB_SIGNAL, new WebDriverWait(getDriver(), Duration.ofSeconds(60))); ensureWaitForReports(); @@ -241,4 +242,4 @@ protected List findNotFoundIdButtons() .append(ext4Button()).findElements(this); } } -} \ No newline at end of file +} diff --git a/ehr/test/src/org/labkey/test/util/ehr/EHRTestHelper.java b/ehr/test/src/org/labkey/test/util/ehr/EHRTestHelper.java index c452df363..73001ac13 100644 --- a/ehr/test/src/org/labkey/test/util/ehr/EHRTestHelper.java +++ b/ehr/test/src/org/labkey/test/util/ehr/EHRTestHelper.java @@ -48,6 +48,7 @@ import java.io.IOException; import java.text.SimpleDateFormat; +import java.time.Duration; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; @@ -147,7 +148,7 @@ public Boolean waitForElementWithValue(final BaseWebDriverTest test, final Strin final Locator l = Locator.name(name); long secTimeout = msTimeout / 1000; secTimeout = secTimeout > 0 ? secTimeout : 1; - WebDriverWait wait = new WebDriverWait(test.getDriver(), secTimeout); + WebDriverWait wait = new WebDriverWait(test.getDriver(), Duration.ofSeconds(secTimeout)); try { return wait.until(new ExpectedCondition()