[java-idp-integration-tests] 04/07: IDP-1632 - Slow down Firefox by adding waits

Tom Zeller tzeller at dragonacea.biz
Wed May 5 20:46:42 UTC 2021


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=611cc3a56da8c7f77123362151d34976694ad74a

commit 611cc3a56da8c7f77123362151d34976694ad74a
Author: Tom Zeller <tzeller at dragonacea.biz>
AuthorDate: Wed May 5 15:00:47 2021 -0500

    IDP-1632 - Slow down Firefox by adding waits
    
    https://issues.shibboleth.net/jira/browse/IDP-1632
---
 .../java/net/shibboleth/idp/test/BaseIntegrationTest.java    | 12 ++++++++++++
 .../shibboleth/idp/test/clientstorage/ClientStorageTest.java |  4 ++++
 .../idp/test/saml2/SAML2AttributeQueryIntegrationTest.java   |  1 +
 3 files changed, 17 insertions(+)

diff --git a/src/test/java/net/shibboleth/idp/test/BaseIntegrationTest.java b/src/test/java/net/shibboleth/idp/test/BaseIntegrationTest.java
index bdfc727..1909cdf 100644
--- a/src/test/java/net/shibboleth/idp/test/BaseIntegrationTest.java
+++ b/src/test/java/net/shibboleth/idp/test/BaseIntegrationTest.java
@@ -70,6 +70,7 @@ import org.openqa.selenium.remote.CapabilityType;
 import org.openqa.selenium.remote.DesiredCapabilities;
 import org.openqa.selenium.remote.RemoteWebDriver;
 import org.openqa.selenium.support.ui.ExpectedCondition;
+import org.openqa.selenium.support.ui.ExpectedConditions;
 import org.openqa.selenium.support.ui.WebDriverWait;
 import org.opensaml.core.config.InitializationException;
 import org.opensaml.core.config.InitializationService;
@@ -1633,6 +1634,7 @@ public abstract class BaseIntegrationTest
      * @param user username
      */
     public void login(final @Nonnull String user) {
+        new WebDriverWait(driver, 10).until(driver -> driver.findElement(By.name("j_username")));
         final WebElement username = driver.findElement(By.name("j_username"));
         final WebElement password = driver.findElement(By.name("j_password"));
         username.sendKeys(user);
@@ -1709,6 +1711,16 @@ public abstract class BaseIntegrationTest
         });
     }
 
+    /**
+     * Wait for the page whose URL contains the given fraction.
+     * 
+     * @param fraction the fraction of the url
+     */
+    public void waitForPageURLContains(@Nonnull final String fraction) {
+        Assert.assertNotNull(fraction);
+        new WebDriverWait(driver, 10).until(ExpectedConditions.urlContains(fraction));
+    }
+
     /**
      * Select web element with id {@link #REMEMBER_CONSENT_ID}.
      */
diff --git a/src/test/java/net/shibboleth/idp/test/clientstorage/ClientStorageTest.java b/src/test/java/net/shibboleth/idp/test/clientstorage/ClientStorageTest.java
index d88c0c3..1bcfa0d 100644
--- a/src/test/java/net/shibboleth/idp/test/clientstorage/ClientStorageTest.java
+++ b/src/test/java/net/shibboleth/idp/test/clientstorage/ClientStorageTest.java
@@ -103,6 +103,8 @@ public class ClientStorageTest extends BaseIntegrationTest {
         read.findElement(By.name("context")).sendKeys("context");
         read.findElement(By.name("key")).sendKeys("key");
         read.submit();
+
+        waitForPageURLContains("/idp/storage/read");
     }
 
     /**
@@ -125,6 +127,8 @@ public class ClientStorageTest extends BaseIntegrationTest {
         read.findElement(By.name("key")).sendKeys("key");
         read.findElement(By.name("value")).sendKeys("value");
         read.submit();
+
+        waitForPageURLContains("/idp/storage/create");
     }
 
     @Test(dataProvider = "sauceOnDemandBrowserDataProvider")
diff --git a/src/test/java/net/shibboleth/idp/test/saml2/SAML2AttributeQueryIntegrationTest.java b/src/test/java/net/shibboleth/idp/test/saml2/SAML2AttributeQueryIntegrationTest.java
index 36180bc..a9b2d4b 100644
--- a/src/test/java/net/shibboleth/idp/test/saml2/SAML2AttributeQueryIntegrationTest.java
+++ b/src/test/java/net/shibboleth/idp/test/saml2/SAML2AttributeQueryIntegrationTest.java
@@ -292,6 +292,7 @@ public class SAML2AttributeQueryIntegrationTest extends AbstractSAML2Integration
      */
     protected void submitAttributeQueryForm() {
         driver.findElement(By.id("saml2-attribute-query")).submit();
+        waitForPageURLContains("/sp/SAML2/AttributeQuery");
     }
 
     /**

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the commits mailing list