[java-idp-integration-tests] branch main updated: Updates for accessibility changes

Tom Zeller tzeller at dragonacea.biz
Wed Mar 2 21:44:41 UTC 2022


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=a7381d0139b9c6ff9fa069bb47b5057558898042

The following commit(s) were added to refs/heads/main by this push:
     new a7381d0  Updates for accessibility changes
a7381d0 is described below

commit a7381d0139b9c6ff9fa069bb47b5057558898042
Author: Tom Zeller <tzeller at dragonacea.biz>
AuthorDate: Wed Mar 2 10:50:44 2022 -0600

    Updates for accessibility changes
    
    Will need to be updated again for IdP 4.1.x
    
    https://shibboleth.atlassian.net/browse/IDP-1910
---
 .../saml2/SAML2SSORedirectLDAPIntegrationTest.java    | 19 +++++++++----------
 .../idp/test/ui/csrf/CSRFMitigationTest.java          | 14 +++-----------
 2 files changed, 12 insertions(+), 21 deletions(-)

diff --git a/src/test/java/net/shibboleth/idp/test/saml2/SAML2SSORedirectLDAPIntegrationTest.java b/src/test/java/net/shibboleth/idp/test/saml2/SAML2SSORedirectLDAPIntegrationTest.java
index 261792d..e518ea1 100644
--- a/src/test/java/net/shibboleth/idp/test/saml2/SAML2SSORedirectLDAPIntegrationTest.java
+++ b/src/test/java/net/shibboleth/idp/test/saml2/SAML2SSORedirectLDAPIntegrationTest.java
@@ -17,12 +17,10 @@
 
 package net.shibboleth.idp.test.saml2;
 
-import java.util.List;
-
 import javax.annotation.Nullable;
 
 import org.openqa.selenium.By;
-import org.openqa.selenium.WebElement;
+import org.openqa.selenium.NoSuchElementException;
 import org.opensaml.core.xml.XMLObjectBuilder;
 import org.opensaml.core.xml.config.XMLObjectProviderRegistrySupport;
 import org.opensaml.core.xml.schema.XSAny;
@@ -108,15 +106,16 @@ public class SAML2SSORedirectLDAPIntegrationTest extends AbstractSAML2Integratio
         waitForAttributeReleasePage();
 
         // fail if mail attribute is displayed
-
-        final WebElement table = driver.findElement(By.tagName("table"));
-        final List<WebElement> tds = table.findElements(By.tagName("td"));
-        for (final WebElement td : tds) {
-            Assert.assertNotEquals("mail", td.getText(), "Emtpy mail attribute should not be displayed");
-            Assert.assertNotEquals("ZERO_LENGTH_VALUE", td.getText(), "Emtpy attributes should not be displayed");
-            Assert.assertNotEquals("NULL_VALUE", td.getText(), "Emtpy attributes should not be displayed");
+        try {
+            driver.findElement(By.id("mail"));
+            Assert.fail("Mail attribute should not be released");
+        } catch (NoSuchElementException e) {
+            // expected to not be found
         }
 
+        // fail if uid attribute is not released, will throw exception if not found
+        driver.findElement(By.id("uid"));
+
         releaseAllAttributes();
 
         rememberConsent();
diff --git a/src/test/java/net/shibboleth/idp/test/ui/csrf/CSRFMitigationTest.java b/src/test/java/net/shibboleth/idp/test/ui/csrf/CSRFMitigationTest.java
index 54cf081..e65313c 100644
--- a/src/test/java/net/shibboleth/idp/test/ui/csrf/CSRFMitigationTest.java
+++ b/src/test/java/net/shibboleth/idp/test/ui/csrf/CSRFMitigationTest.java
@@ -137,18 +137,10 @@ public class CSRFMitigationTest extends BaseIntegrationTest {
         Assert.assertNotNull(errorPageTitle);
         final String errorPageSubtitle = getMessage(CSRF_ERROR_PAGE_TITLE_PROPERTY);
         Assert.assertNotNull(errorPageSubtitle);
-        
-        
-        (new WebDriverWait(driver, 5)).until(new ExpectedCondition<Boolean>() {
-            public Boolean apply(WebDriver d) {
-                return d.getTitle().equals(errorPageTitle+" - "+errorPageSubtitle);
-            }
-        });
-
         Assert.assertTrue(driver.getPageSource()!=null);
-        WebElement contentElement = driver.findElement(By.xpath("//div[contains(@class,'content')]"));
-        String contentText = contentElement.getText().trim();
-        Assert.assertTrue(csrfErrorMessage.equals(contentText));
+        final String pageSource = driver.getPageSource();
+        Assert.assertTrue(pageSource.contains(csrfErrorMessage));
+        Assert.assertTrue(pageSource.contains(errorPageTitle + " - " + errorPageSubtitle));
     }
 
     /**

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


More information about the commits mailing list