edu.samplu.common
Class SauceLabsWebDriverHelper

java.lang.Object
  extended by edu.samplu.common.SauceLabsWebDriverHelper
All Implemented Interfaces:
com.saucelabs.common.SauceOnDemandSessionIdProvider

public class SauceLabsWebDriverHelper
extends Object
implements com.saucelabs.common.SauceOnDemandSessionIdProvider

Simple RemoteWebDriver test that demonstrates how to run your Selenium tests with Sauce OnDemand. This test also includes the Sauce JUnit helper classes, which will use the Sauce REST API to mark the Sauce Job as passed/failed. In order to use the SauceOnDemandTestWatcher, the test must implement the SauceOnDemandSessionIdProvider interface.


Field Summary
 com.saucelabs.common.SauceOnDemandAuthentication authentication
          Constructs a SauceOnDemandAuthentication instance using the supplied user name/access key.
static String REMOTE_DRIVER_SAUCELABS_PROPERTY
          Use Saucelabs flag.
static String SAUCE_BROWSER_PROPERTY
          Saucelabs browser, default is Firefox.
static String SAUCE_BUILD_PROPERTY
          Suacelabs build, default is unknown.
static String SAUCE_DOWNLOAD_SCRIPT_PROPERTY
          Create a unix shell script to download saucelab resources, default is false Note - saucelabs history only goes back so far, if you run enough tests the resources will no longer be available for downloading.
static String SAUCE_IDLE_TIMEOUT_SECONDS_PROPERTY
          Saucelabs idle timeout in seconds, default is 180 -Dsaucelabs.idle.timeout.seconds=
static String SAUCE_IE_INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS_PROPERTY
          Saucelabs ignore security domains in IE, which can introduce flakiness, default is true.
static String SAUCE_KEY_PROPERTY
          Saucelabs key, required.
static String SAUCE_MAX_DURATION_SECONDS_PROPERTY
          Saucelabs max duration in seconds, default is 480 -Dsaucelabs.max.duration.seconds=
static String SAUCE_PLATFORM_PROPERTY
          Saucelabs platform (OS) replace spaces with underscores, default is Linux.
static String SAUCE_POPUP_PROPERTY
          Saucelabs popup disable setting, default is false (not disabled).
static String SAUCE_SHARE_PROPERTY
          Saucelabs share setting, default is share.
static String SAUCE_USER_PROPERTY
          Saucelabs user -Dsaucelabs.user=
static String SAUCE_VERSION_PROPERTY
          Browser Version.
 
Constructor Summary
SauceLabsWebDriverHelper()
           
 
Method Summary
 org.openqa.selenium.WebDriver getDriver()
          Returns the driver
 String getSessionId()
           
 void setUp(String className, String testName)
          Saucelabs setup
static void tearDown(boolean passed, String sessionId, String sauceUser, String sauceKey)
          Do Suacelabs related teardown things.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

REMOTE_DRIVER_SAUCELABS_PROPERTY

public static final String REMOTE_DRIVER_SAUCELABS_PROPERTY
Use Saucelabs flag. For ease of disabling saucelabs without having to remove other saucelabs property settings. -Dremote.driver.saucelabs

See Also:
Constant Field Values

SAUCE_BROWSER_PROPERTY

public static final String SAUCE_BROWSER_PROPERTY
Saucelabs browser, default is Firefox. See Saucelabs Resources ff = Firefox ie = Internet Explorer chrome = Google Chrome opera = Opera android = Android safari = Safari ipad = IPad iphone = IPhone -Dsaucelabs.browser=

See Also:
Constant Field Values

SAUCE_BUILD_PROPERTY

public static final String SAUCE_BUILD_PROPERTY
Suacelabs build, default is unknown. -Drice.version=

See Also:
Constant Field Values

SAUCE_DOWNLOAD_SCRIPT_PROPERTY

public static final String SAUCE_DOWNLOAD_SCRIPT_PROPERTY
Create a unix shell script to download saucelab resources, default is false Note - saucelabs history only goes back so far, if you run enough tests the resources will no longer be available for downloading. -Dsaucelabs.download.script=false

See Also:
Constant Field Values

SAUCE_IDLE_TIMEOUT_SECONDS_PROPERTY

public static final String SAUCE_IDLE_TIMEOUT_SECONDS_PROPERTY
Saucelabs idle timeout in seconds, default is 180 -Dsaucelabs.idle.timeout.seconds=

See Also:
Constant Field Values

SAUCE_KEY_PROPERTY

public static final String SAUCE_KEY_PROPERTY
Saucelabs key, required. -Dsaucelabs.key=

See Also:
Constant Field Values

SAUCE_MAX_DURATION_SECONDS_PROPERTY

public static final String SAUCE_MAX_DURATION_SECONDS_PROPERTY
Saucelabs max duration in seconds, default is 480 -Dsaucelabs.max.duration.seconds=

See Also:
Constant Field Values

SAUCE_PLATFORM_PROPERTY

public static final String SAUCE_PLATFORM_PROPERTY
Saucelabs platform (OS) replace spaces with underscores, default is Linux. See Saucelabs Resources -Dsaucelabs.platform=

See Also:
Constant Field Values

SAUCE_IE_INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS_PROPERTY

public static final String SAUCE_IE_INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS_PROPERTY
Saucelabs ignore security domains in IE, which can introduce flakiness, default is true. See InternetExplorerDriver FAQ -Dsaucelabs.ie.ignore.domains=false

See Also:
Constant Field Values

SAUCE_POPUP_PROPERTY

public static final String SAUCE_POPUP_PROPERTY
Saucelabs popup disable setting, default is false (not disabled). See DISABLE POPUP HANDLER -Dsaucelabs.pop.disable=

See Also:
Constant Field Values

SAUCE_SHARE_PROPERTY

public static final String SAUCE_SHARE_PROPERTY
Saucelabs share setting, default is share. -Dsaucelabs.share=

See Also:
Constant Field Values

SAUCE_USER_PROPERTY

public static final String SAUCE_USER_PROPERTY
Saucelabs user -Dsaucelabs.user=

See Also:
Constant Field Values

SAUCE_VERSION_PROPERTY

public static final String SAUCE_VERSION_PROPERTY
Browser Version. See Saucelabs Resources 0 or null is current version of Chrome. If using a browser other than Chrome this must be set else an Exception will be thrown. -Dsaucelabs.version=

See Also:
Constant Field Values

authentication

public com.saucelabs.common.SauceOnDemandAuthentication authentication
Constructs a SauceOnDemandAuthentication instance using the supplied user name/access key. To use the authentication supplied by environment variables or from an external file, use the no-arg SauceOnDemandAuthentication constructor.

Constructor Detail

SauceLabsWebDriverHelper

public SauceLabsWebDriverHelper()
Method Detail

setUp

public void setUp(String className,
                  String testName)
           throws Exception
Saucelabs setup

Parameters:
className -
testName -
Throws:
Exception

tearDown

public static void tearDown(boolean passed,
                            String sessionId,
                            String sauceUser,
                            String sauceKey)
                     throws Exception
Do Suacelabs related teardown things. Mostly flag the tests as passed or failed.

Parameters:
passed -
sessionId -
sauceUser -
sauceKey -
Throws:
Exception

getDriver

public org.openqa.selenium.WebDriver getDriver()
Returns the driver

Returns:
WebDriver

getSessionId

public String getSessionId()
Specified by:
getSessionId in interface com.saucelabs.common.SauceOnDemandSessionIdProvider


Copyright © 2005-2015 The Kuali Foundation. All Rights Reserved.