public class SauceOnDemandBuildWrapper extends hudson.tasks.BuildWrapper implements Serializable
BuildWrapper that sets up the Sauce OnDemand SSH tunnel and populates environment variables which
represent the selected browser(s).| Modifier and Type | Class and Description |
|---|---|
static class |
SauceOnDemandBuildWrapper.DescriptorImpl
Plugin descriptor, which adds the plugin details to the Jenkins job configuration page.
|
class |
SauceOnDemandBuildWrapper.SauceOnDemandLogParser
Captures the output of a Jenkins build, so that it can be parsed to find Sauce jobs invoked by the build.
|
| Modifier and Type | Field and Description |
|---|---|
static Pattern |
ENVIRONMENT_VARIABLE_PATTERN
Regex pattern which is used to identify replacement parameters.
|
static String |
SAUCE_ONDEMAND_BROWSERS
Environment variable key which contains a JSON formatted list of selected browsers.
|
static String |
SELENIUM_BROWSER
Environment variable key which contains the browser value for the selected browser.
|
static String |
SELENIUM_DEVICE
Environment variable key which contains the device value for the selected browser.
|
static String |
SELENIUM_DEVICE_ORIENTATION
Environment variable key which contains the device orientation for the selected browser.
|
static String |
SELENIUM_DEVICE_TYPE
Environment variable key which contains the device type for the selected browser.
|
static String |
SELENIUM_DRIVER
Environment variable key which contains Selenium Client Factory driver for selected browser.
|
static String |
SELENIUM_HOST
Environment variable key which contains the selenium host.
|
static String |
SELENIUM_PLATFORM
Environment variable key which contains the platform for the selected browser.
|
static String |
SELENIUM_PORT
Environment variable key which contains the selenium port.
|
static String |
SELENIUM_VERSION
Environment variable key which contains the version for the selected browser.
|
| Constructor and Description |
|---|
SauceOnDemandBuildWrapper(boolean enableSauceConnect,
org.jenkins_ci.plugins.run_condition.RunCondition condition,
Credentials credentials,
SeleniumInformation seleniumInformation,
String seleniumHost,
String seleniumPort,
String options,
String sauceConnectPath,
boolean launchSauceConnectOnSlave,
boolean verboseLogging,
boolean useLatestVersion,
List<String> webDriverBrowsers,
List<String> appiumBrowsers,
String nativeAppPackage,
boolean useGeneratedTunnelIdentifier)
Constructs a new instance using data entered on the job configuration screen.
|
| Modifier and Type | Method and Description |
|---|---|
OutputStream |
decorateLogger(hudson.model.AbstractBuild build,
OutputStream logger)
Creates a new
SauceOnDemandBuildWrapper.SauceOnDemandLogParser instance, which is added to the logParserMap. |
String |
getApiKey() |
List<String> |
getAppiumBrowsers() |
org.jenkins_ci.plugins.run_condition.RunCondition |
getCondition() |
Credentials |
getCredentials() |
String |
getNativeAppPackage() |
String |
getOptions() |
String |
getSauceConnectPath() |
static com.saucelabs.ci.sauceconnect.AbstractSauceTunnelManager |
getSauceTunnelManager()
Retrieve the
AbstractSauceTunnelManager instance to be used to launch Sauce Connect. |
String |
getSeleniumHost() |
SeleniumInformation |
getSeleniumInformation() |
String |
getSeleniumPort() |
String |
getUserName() |
List<String> |
getWebDriverBrowsers() |
boolean |
isEnableSauceConnect() |
boolean |
isLaunchSauceConnectOnSlave() |
boolean |
isUseChromeForAndroid() |
boolean |
isUseGeneratedTunnelIdentifier() |
boolean |
isUseLatestVersion() |
boolean |
isVerboseLogging() |
static String |
sanitiseBuildNumber(String buildNumber)
Replace all spaces and hashes with underscores.
|
void |
setAppiumBrowsers(List<String> appiumBrowsers) |
void |
setCredentials(Credentials credentials) |
void |
setEnableSauceConnect(boolean enableSauceConnect) |
void |
setLaunchSauceConnectOnSlave(boolean launchSauceConnectOnSlave) |
void |
setNativeAppPackage(String nativeAppPackage) |
void |
setOptions(String options) |
void |
setSauceConnectPath(String sauceConnectPath) |
void |
setSeleniumHost(String seleniumHost) |
void |
setSeleniumInformation(SeleniumInformation seleniumInformation) |
void |
setSeleniumPort(String seleniumPort) |
hudson.tasks.BuildWrapper.Environment |
setUp(hudson.model.AbstractBuild build,
hudson.Launcher launcher,
hudson.model.BuildListener listener)
Invoked prior to the running of a Jenkins build.
|
void |
setUseChromeForAndroid(boolean useChromeForAndroid) |
void |
setUseGeneratedTunnelIdentifier(boolean useGeneratedTunnelIdentifier) |
void |
setUseLatestVersion(boolean useLatestVersion) |
void |
setVerboseLogging(boolean verboseLogging) |
void |
setWebDriverBrowsers(List<String> webDriverBrowsers) |
boolean |
shouldSendUsageData() |
public static final String SELENIUM_DRIVER
public static final String SAUCE_ONDEMAND_BROWSERS
public static final String SELENIUM_HOST
public static final String SELENIUM_PORT
public static final String SELENIUM_DEVICE
public static final String SELENIUM_DEVICE_TYPE
public static final String SELENIUM_DEVICE_ORIENTATION
public static final Pattern ENVIRONMENT_VARIABLE_PATTERN
public static final String SELENIUM_BROWSER
public static final String SELENIUM_PLATFORM
public static final String SELENIUM_VERSION
@DataBoundConstructor
public SauceOnDemandBuildWrapper(boolean enableSauceConnect,
org.jenkins_ci.plugins.run_condition.RunCondition condition,
Credentials credentials,
SeleniumInformation seleniumInformation,
String seleniumHost,
String seleniumPort,
String options,
String sauceConnectPath,
boolean launchSauceConnectOnSlave,
boolean verboseLogging,
boolean useLatestVersion,
List<String> webDriverBrowsers,
List<String> appiumBrowsers,
String nativeAppPackage,
boolean useGeneratedTunnelIdentifier)
enableSauceConnect - indicates whether Sauce Connect should be started as part of the build.condition - allows users to define rules which enable Sauce Connectcredentials - the Sauce username/access key that should be used for the build.seleniumInformation - the browser information that is to be used for the build.seleniumHost - host location of the selenium server.seleniumPort - port location of the selenium server.options - the Sauce Connect command line options to be usedsauceConnectPath - Path to sauce connectlaunchSauceConnectOnSlave - indicates whether Sauce Connect should be launched on the slave or master nodeverboseLogging - indicates whether the Sauce Connect output should be written to the Jenkins job outputuseLatestVersion - indicates whether the latest version of the selected browser(s) should be usedwebDriverBrowsers - which browser(s) should be used for web driverappiumBrowsers - which browser(s( should be used for appiumnativeAppPackage - indicates whether the latest version of the selected browser(s) should be useduseGeneratedTunnelIdentifier - indicated whether tunnel identifers and ports should be managed by the pluginpublic hudson.tasks.BuildWrapper.Environment setUp(hudson.model.AbstractBuild build,
hudson.Launcher launcher,
hudson.model.BuildListener listener)
throws IOException,
InterruptedException
setUp in class hudson.tasks.BuildWrapperEnvironment instance populated with the Sauce environment variablesIOExceptionInterruptedExceptionpublic boolean shouldSendUsageData()
public static String sanitiseBuildNumber(String buildNumber)
buildNumber - the current Jenkins build numberpublic String getUserName()
public String getApiKey()
public boolean isUseLatestVersion()
public String getSeleniumHost()
public void setSeleniumHost(String seleniumHost)
public String getSeleniumPort()
public void setSeleniumPort(String seleniumPort)
public Credentials getCredentials()
public void setCredentials(Credentials credentials)
public SeleniumInformation getSeleniumInformation()
public void setSeleniumInformation(SeleniumInformation seleniumInformation)
public boolean isEnableSauceConnect()
public void setEnableSauceConnect(boolean enableSauceConnect)
public boolean isLaunchSauceConnectOnSlave()
public void setLaunchSauceConnectOnSlave(boolean launchSauceConnectOnSlave)
public boolean isUseGeneratedTunnelIdentifier()
public void setUseGeneratedTunnelIdentifier(boolean useGeneratedTunnelIdentifier)
public boolean isVerboseLogging()
public void setVerboseLogging(boolean verboseLogging)
public String getOptions()
public void setOptions(String options)
public org.jenkins_ci.plugins.run_condition.RunCondition getCondition()
public String getSauceConnectPath()
public void setSauceConnectPath(String sauceConnectPath)
public boolean isUseChromeForAndroid()
public String getNativeAppPackage()
public void setUseLatestVersion(boolean useLatestVersion)
public void setNativeAppPackage(String nativeAppPackage)
public void setUseChromeForAndroid(boolean useChromeForAndroid)
public OutputStream decorateLogger(hudson.model.AbstractBuild build, OutputStream logger) throws IOException, InterruptedException, hudson.model.Run.RunnerAbortedException
SauceOnDemandBuildWrapper.SauceOnDemandLogParser instance, which is added to the logParserMap.decorateLogger in class hudson.tasks.BuildWrapperIOExceptionInterruptedExceptionhudson.model.Run.RunnerAbortedExceptionpublic static com.saucelabs.ci.sauceconnect.AbstractSauceTunnelManager getSauceTunnelManager()
throws org.codehaus.plexus.component.repository.exception.ComponentLookupException
AbstractSauceTunnelManager instance to be used to launch Sauce Connect.AbstractSauceTunnelManager instanceorg.codehaus.plexus.component.repository.exception.ComponentLookupException - see plexusCopyright © 2004-2015. All Rights Reserved.