Class SauceLabsIntegration
- java.lang.Object
-
- com.vaadin.testbench.parallel.SauceLabsIntegration
-
public class SauceLabsIntegration extends Object
Integration methods for Sauce Labs testing used byParallelTest
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceSauceLabsIntegration.CapabilityTypeSauce Labs specific remote webdriver capabilities
-
Constructor Summary
Constructors Constructor Description SauceLabsIntegration()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static StringgetHubUrl()Returns the HubUrl for running tests in Sauce Labs.static StringgetSauceAccessKey()Gets the configured Saucelabs access key.static ObjectgetSauceLabsOption(org.openqa.selenium.remote.DesiredCapabilities desiredCapabilities, String key)Gets the given SauceLabs option.static StringgetSauceTunnelIdentifier()Gets the configured Saucelabs tunnel identifier.static StringgetSauceUser()Gets the configured Saucelabs user name.static booleanisConfiguredForSauceLabs()Checks if parameters needed to run in Saucelabs have been set.static voidsetDesiredCapabilities(org.openqa.selenium.remote.DesiredCapabilities desiredCapabilities)Sets needed desired capabilities for authentication and using the correct sauce tunnel (if in use).static voidsetSauceLabsOption(org.openqa.selenium.remote.DesiredCapabilities desiredCapabilities, String key, Object value)Sets the given SauceLabs option to the given value.
-
-
-
Method Detail
-
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 null- See Also:
getSauceUser(),getSauceAccessKey(),getSauceTunnelIdentifier()
-
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 key- Returns:
- the option value that was set or null
-
getSauceTunnelIdentifier
public static String getSauceTunnelIdentifier()
Gets the configured Saucelabs tunnel identifier.Reads from the "sauce.tunnelId" system property or the "SAUCE_TUNNEL_ID" 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
public static String 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
public static String 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
public static String 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
-
-