[java-idp-integration-tests COMMIT] in /trunk: pom.xml src/test/java/net/shibboleth/idp/test/BaseIntegrationTest.java
noreply at shibboleth.net
noreply at shibboleth.net
Tue Jun 23 18:11:59 EDT 2015
Author: tzeller
Date: Tue Jun 23 18:11:59 2015
New Revision: 69
URL: http://svn.shibboleth.net/view/java-idp-integration-tests?rev=69&view=rev
Log:
IDP-738 Attempt to test on Firefox running on Sauce Labs.
https://issues.shibboleth.net/jira/browse/IDP-738
Modified:
trunk/pom.xml
trunk/src/test/java/net/shibboleth/idp/test/BaseIntegrationTest.java
Modified: trunk/pom.xml
URL: http://svn.shibboleth.net/view/java-idp-integration-tests/trunk/pom.xml?rev=69&r1=68&r2=69&view=diff
==============================================================================
--- trunk/pom.xml (original)
+++ trunk/pom.xml Tue Jun 23 18:11:59 2015
@@ -28,6 +28,7 @@
<xerces.version>2.11.0</xerces.version>
<xmlresolver.groupId>xml-resolver</xmlresolver.groupId>
<xmlresolver.version>1.2</xmlresolver.version>
+ <sauce.version>2.1.19</sauce.version>
</properties>
<repositories>
@@ -148,6 +149,13 @@
<groupId>${xalan.groupId}</groupId>
<artifactId>xalan</artifactId>
<version>${xalan.version}</version>
+ <scope>test</scope>
+ </dependency>
+ <!-- Sauce Labs SauceOnDemandAuthentication.class -->
+ <dependency>
+ <groupId>com.saucelabs</groupId>
+ <artifactId>sauce_java_common</artifactId>
+ <version>${sauce.version}</version>
<scope>test</scope>
</dependency>
Modified: trunk/src/test/java/net/shibboleth/idp/test/BaseIntegrationTest.java
URL: http://svn.shibboleth.net/view/java-idp-integration-tests/trunk/src/test/java/net/shibboleth/idp/test/BaseIntegrationTest.java?rev=69&r1=68&r2=69&view=diff
==============================================================================
--- trunk/src/test/java/net/shibboleth/idp/test/BaseIntegrationTest.java (original)
+++ trunk/src/test/java/net/shibboleth/idp/test/BaseIntegrationTest.java Tue Jun 23 18:11:59 2015
@@ -18,6 +18,8 @@
package net.shibboleth.idp.test;
import java.io.IOException;
+import java.lang.reflect.Method;
+import java.net.URL;
import java.nio.file.DirectoryStream;
import java.nio.file.Files;
import java.nio.file.Path;
@@ -44,6 +46,9 @@
import org.openqa.selenium.firefox.FirefoxProfile;
import org.openqa.selenium.firefox.internal.ProfilesIni;
import org.openqa.selenium.htmlunit.HtmlUnitDriver;
+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.WebDriverWait;
import org.opensaml.core.config.InitializationException;
@@ -59,6 +64,8 @@
import org.testng.annotations.BeforeClass;
import org.testng.annotations.BeforeMethod;
+import com.saucelabs.common.SauceOnDemandAuthentication;
+
/**
* Abstract integration test which starts a Jetty server and an in-memory directory server.
*/
@@ -139,6 +146,9 @@
/** XMLObject unmarshaller factory */
@NonnullAfterInit protected UnmarshallerFactory unmarshallerFactory;
+ /** Desired capabilities of the web driver. */
+ @Nullable protected DesiredCapabilities desiredCapabilities;
+
/** Web driver. */
@Nonnull protected WebDriver driver;
@@ -156,12 +166,15 @@
/** URL to start the force authn flow. */
@Nullable protected String forceAuthnRequestURL;
-
+
/** IdP single logout service endpoint. */
@Nullable protected String idpLogoutURL;
-
+
/** SP single logout service endpoint. */
@Nullable protected String spLogoutURL;
+
+ /** Name of test class concatenated with the test method. **/
+ @Nullable protected String testName;
/** Class logger. */
@Nonnull private final Logger log = LoggerFactory.getLogger(BaseIntegrationTest.class);
@@ -408,7 +421,7 @@
Files.copy(pathToRelyingPartyWithConsent, pathToRelyingParty, StandardCopyOption.REPLACE_EXISTING);
}
-
+
public void enableLogout() throws Exception {
// server-side storage of user sessions
replaceIdPProperty("idp.session.StorageService", "shibboleth.StorageService");
@@ -421,29 +434,79 @@
}
/**
- * Setup HTML web driver.
- */
- @BeforeMethod(enabled = true) public void setUpDriver() throws IOException {
+ * Populate the test name as the name of test class concatenated with the test method.
+ *
+ * @param method the test method
+ */
+ @BeforeMethod public void setUpTestName(@Nonnull final Method method) {
+ testName = method.getDeclaringClass().getName() + "." + method.getName();
+ }
+
+ /**
+ * Set up HtmlUnitDriver web driver.
+ */
+ @BeforeMethod(enabled = false) public void setUpHtmlUnitDriver() throws IOException {
driver = new HtmlUnitDriver();
((HtmlUnitDriver) driver).setJavascriptEnabled(true);
}
/**
- * Setup Firefox web driver.
+ * Set up Firefox web driver.
*/
@BeforeMethod(enabled = false) public void setUpFirefoxDriver() throws IOException {
[... 78 lines stripped ...]
More information about the commits
mailing list