[java-idp-integration-tests] branch main updated: Set up implicit wait driven by 'wait' system property
Tom Zeller
tzeller at dragonacea.biz
Mon Feb 5 23:15:40 UTC 2024
This is an automated email from the git hooks/post-receive script.
tzeller pushed a commit to branch main
in repository java-idp-integration-tests.
View the commit online:
http://git.shibboleth.net/view/?p=java-idp-integration-tests.git;a=commit;h=bea1f6ce0f423cd8587b281fbbbb787144a98fbc
The following commit(s) were added to refs/heads/main by this push:
new bea1f6c Set up implicit wait driven by 'wait' system property
bea1f6c is described below
commit bea1f6ce0f423cd8587b281fbbbb787144a98fbc
Author: Tom Zeller <tzeller at dragonacea.biz>
AuthorDate: Mon Feb 5 17:15:32 2024 -0600
Set up implicit wait driven by 'wait' system property
---
.../idp/integration/tests/BaseIntegrationTest.java | 18 ++++++++++++++++++
.../tests/clientstorage/ClientStorageTest.java | 2 --
2 files changed, 18 insertions(+), 2 deletions(-)
diff --git a/src/test/java/net/shibboleth/idp/integration/tests/BaseIntegrationTest.java b/src/test/java/net/shibboleth/idp/integration/tests/BaseIntegrationTest.java
index 4fb5e93..12d6338 100644
--- a/src/test/java/net/shibboleth/idp/integration/tests/BaseIntegrationTest.java
+++ b/src/test/java/net/shibboleth/idp/integration/tests/BaseIntegrationTest.java
@@ -1074,6 +1074,8 @@ public abstract class BaseIntegrationTest {
*
* Otherwise, start a Firefox web driver.
*
+ * If 'wait' system property is set, implicitly wait that number of seconds. See {@link #setUpImplicitWait()}.
+ *
* <p>
* Note : this method must be called in each test.
* </p>
@@ -1098,6 +1100,7 @@ public abstract class BaseIntegrationTest {
setUpFirefoxDriver();
}
log.debug("Started web driver '{}'", driver);
+ setUpImplicitWait();
}
/**
@@ -2816,4 +2819,19 @@ public abstract class BaseIntegrationTest {
log.debug("Finished tearing down DNS");
}
+ /**
+ * Implicitly wait the number of seconds specified by the 'wait' system
+ * property.
+ */
+ public void setUpImplicitWait() {
+ final String wait = System.getProperty("wait");
+ if (wait == null) {
+ return;
+ }
+ int seconds = Integer.parseInt(wait);
+ log.debug("Implicitly waiting '{}' seconds", seconds);
+ assert (driver != null) : "WebDriver is null";
+ driver.manage().timeouts().implicitlyWait(Duration.ofSeconds(seconds));
+ }
+
}
diff --git a/src/test/java/net/shibboleth/idp/integration/tests/clientstorage/ClientStorageTest.java b/src/test/java/net/shibboleth/idp/integration/tests/clientstorage/ClientStorageTest.java
index 9afa04a..1c7acb7 100644
--- a/src/test/java/net/shibboleth/idp/integration/tests/clientstorage/ClientStorageTest.java
+++ b/src/test/java/net/shibboleth/idp/integration/tests/clientstorage/ClientStorageTest.java
@@ -202,8 +202,6 @@ public class ClientStorageTest extends BaseIntegrationTest {
startSeleniumClient(browserData);
- driver.manage().timeouts().implicitlyWait(Duration.ofSeconds(1));
-
disableLocalStorage();
startServer();
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the commits
mailing list