com.vaadin.testbench.parallel.
Class SauceLabsIntegration
Integration methods for Sauce Labs testing.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interface
Sauce Labs specific remote webdriver capabilities
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic String
Returns the HubUrl for running tests in Sauce Labs.
static String
Gets the configured Saucelabs access key.
static Object
getSauceLabsOption
(org.openqa.selenium.remote.DesiredCapabilities desiredCapabilities, String key) Gets the given SauceLabs option.
static String
Gets the configured Saucelabs tunnel identifier.
static String
Gets the configured Saucelabs user name.
static boolean
Checks if parameters needed to run in Saucelabs have been set.
static void
setDesiredCapabilities
(org.openqa.selenium.remote.DesiredCapabilities desiredCapabilities) Sets needed desired capabilities for authentication and using the correct sauce tunnel (if in use).
static void
setSauceLabsOption
(org.openqa.selenium.remote.DesiredCapabilities desiredCapabilities, String key, Object value) Sets the given SauceLabs option to the given value.
-
Constructor Details
-
SauceLabsIntegration
public SauceLabsIntegration()
-
-
Method Details
-
setDesiredCapabilities
public static void setDesiredCapabilities(org.openqa.selenium.remote.DesiredCapabilities desiredCapabilities) Sets needed desired capabilities for authentication and using the correct sauce tunnel (if in use).
Parameters:
desiredCapabilities
- the capabilities object to populate, not nullSee Also:
-
setSauceLabsOption
public static void setSauceLabsOption(org.openqa.selenium.remote.DesiredCapabilities desiredCapabilities, String key, Object value) Sets the given SauceLabs option to the given value.
The available SauceLabs options are listed at https://docs.saucelabs.com/dev/test-configuration-options/.
Parameters:
desiredCapabilities
- the desired capabilities objectkey
- the option keyvalue
- the option value -
getSauceLabsOption
public static Object getSauceLabsOption(org.openqa.selenium.remote.DesiredCapabilities desiredCapabilities, String key) Gets the given SauceLabs option.
The available SauceLabs options are listed at https://docs.saucelabs.com/dev/test-configuration-options/.
Parameters:
desiredCapabilities
- the desired capabilities objectkey
- the option keyReturns:
the option value that was set or null
-
getSauceTunnelIdentifier
Gets the configured Saucelabs tunnel identifier.
Reads from the "sauce.tunnelId" system property or the "SAUCE_TUNNEL_IDENTIFIER" environment variable.
If both system property and environment variable are defined, the system property is used.
Returns:
the configured Saucelabs tunnel identifier or null
-
getHubUrl
Returns the HubUrl for running tests in Sauce Labs.
The available SauceLabs URLs are listed at https://docs.saucelabs.com/basics/data-center-endpoints/#data-center-endpoints.
Returns:
url String to be used in Sauce Labs test run
-
isConfiguredForSauceLabs
public static boolean isConfiguredForSauceLabs()Checks if parameters needed to run in Saucelabs have been set.
Returns:
true if the Saucelabs configuration was found
-
getSauceUser
Gets the configured Saucelabs user name.
Reads from the "sauce.user" system property or the "SAUCE_USERNAME" environment variable.
If both system property and environment variable are defined, the system property is used.
Returns:
the configured Saucelabs user name or null
-
getSauceAccessKey
Gets the configured Saucelabs access key.
Reads from the "sauce.sauceAccessKey" system property or the "SAUCE_ACCESS_KEY" environment variable.
If both system property and environment variable are defined, the system property is used.
Returns:
the configured Saucelabs access key or null
-