Package hudson.plugins.sauce_ondemand
Class SauceOnDemandBuildWrapper
java.lang.Object
hudson.model.AbstractDescribableImpl<BuildWrapper>
hudson.tasks.BuildWrapper
hudson.plugins.sauce_ondemand.SauceOnDemandBuildWrapper
- All Implemented Interfaces:
ExtensionPoint,Describable<BuildWrapper>,Serializable
BuildWrapper that sets up the Sauce OnDemand SSH tunnel and populates environment
variables which represent the selected browser(s).- Author:
- Kohsuke Kawaguchi, Ross Rowe
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classPlugin descriptor, which adds the plugin details to the Jenkins job configuration page.static classstatic final classNested classes/interfaces inherited from class hudson.tasks.BuildWrapper
BuildWrapper.EnvironmentNested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final PatternRegex pattern which is used to identify replacement parameters.static final StringDeprecated.Should use the standard SAUCE_BUILD_NAMEstatic final StringEnvironment variable key which contains the Sauce access key.static final StringEnvironment variable key which contains the Jenkins build number.static final StringEnvironment variable key which contains a JSON formatted list of selected browsers.static final StringEnvironment variable key which contains the Sauce REST endpoint.static final StringEnvironment variable key which contains the Sauce user name.static final StringEnvironment variable key which contains the browser value for the selected browser.static final StringEnvironment variable key which contains the device value for the selected browser.static final StringEnvironment variable key which contains the device orientation for the selected browser.static final StringEnvironment variable key which contains the device type for the selected browser.static final StringEnvironment variable key which contains Selenium Client Factory driver for selected browser.static final StringEnvironment variable key which contains the selenium host.static final StringEnvironment variable key which contains the platform for the selected browser.static final StringEnvironment variable key which contains the selenium port.static final StringEnvironment variable key which contains the version for the selected browser.static final Stringstatic final String -
Constructor Summary
ConstructorsConstructorDescriptionSauceOnDemandBuildWrapper(boolean enableSauceConnect, org.jenkins_ci.plugins.run_condition.RunCondition condition, String credentialId, SeleniumInformation seleniumInformation, String seleniumHost, String seleniumPort, String options, String cliOptions, String sauceConnectPath, boolean launchSauceConnectOnSlave, boolean verboseLogging, boolean useLatestVersion, boolean useLatestSauceConnect, boolean forceCleanup, List<String> webDriverBrowsers, List<String> appiumBrowsers, String nativeAppPackage, boolean useGeneratedTunnelIdentifier) Constructs a new instance using data entered on the job configuration screen. -
Method Summary
Modifier and TypeMethodDescriptionorg.jenkins_ci.plugins.run_condition.RunConditiongetSauceBuildAction(AbstractBuild build) static com.saucelabs.ci.sauceconnect.AbstractSauceTunnelManagerRetrieve theAbstractSauceTunnelManagerinstance to be used to launch Sauce Connect.booleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanvoidmakeSensitiveBuildVariables(AbstractBuild build, Set<String> sensitiveVariables) protected booleanmigrateCredentials(AbstractProject project) voidsetAppiumBrowsers(List<String> appiumBrowsers) voidsetCliOptions(String cliOptions) voidsetCredentialId(String credentialId) voidsetEnableSauceConnect(boolean enableSauceConnect) voidsetForceCleanup(boolean forceCleanup) voidsetLaunchSauceConnectOnSlave(boolean launchSauceConnectOnSlave) voidsetNativeAppPackage(String nativeAppPackage) voidsetOptions(String options) voidsetSauceConnectPath(String sauceConnectPath) voidsetSeleniumHost(String seleniumHost) voidsetSeleniumInformation(SeleniumInformation seleniumInformation) voidsetSeleniumPort(String seleniumPort) setUp(AbstractBuild build, Launcher launcher, BuildListener listener) voidsetUseChromeForAndroid(boolean useChromeForAndroid) voidsetUseGeneratedTunnelIdentifier(boolean useGeneratedTunnelIdentifier) voidsetUseLatestVersion(boolean useLatestVersion) voidsetVerboseLogging(boolean verboseLogging) voidsetWebDriverBrowsers(List<String> webDriverBrowsers) Methods inherited from class hudson.tasks.BuildWrapper
all, decorateLauncher, decorateLogger, getProjectAction, getProjectActions, makeBuildVariables, preCheckout, setUpMethods inherited from class hudson.model.AbstractDescribableImpl
getDescriptor
-
Field Details
-
SELENIUM_DRIVER
Environment variable key which contains Selenium Client Factory driver for selected browser.- See Also:
-
SAUCE_ONDEMAND_BROWSERS
Environment variable key which contains a JSON formatted list of selected browsers.- See Also:
-
SELENIUM_HOST
Environment variable key which contains the selenium host.- See Also:
-
SELENIUM_PORT
Environment variable key which contains the selenium port.- See Also:
-
SAUCE_USERNAME
Environment variable key which contains the Sauce user name.- See Also:
-
SAUCE_ACCESS_KEY
Environment variable key which contains the Sauce access key.- See Also:
-
SAUCE_REST_ENDPOINT
Environment variable key which contains the Sauce REST endpoint.- See Also:
-
SELENIUM_DEVICE
Environment variable key which contains the device value for the selected browser.- See Also:
-
SELENIUM_DEVICE_TYPE
Environment variable key which contains the device type for the selected browser.- See Also:
-
SELENIUM_DEVICE_ORIENTATION
Environment variable key which contains the device orientation for the selected browser.- See Also:
-
ENVIRONMENT_VARIABLE_PATTERN
Regex pattern which is used to identify replacement parameters. -
SELENIUM_BROWSER
Environment variable key which contains the browser value for the selected browser.- See Also:
-
SELENIUM_PLATFORM
Environment variable key which contains the platform for the selected browser.- See Also:
-
SELENIUM_VERSION
Environment variable key which contains the version for the selected browser.- See Also:
-
JENKINS_BUILD_NUMBER
Deprecated.Should use the standard SAUCE_BUILD_NAMEEnvironment variable key which contains the Jenkins build number.- See Also:
-
SAUCE_BUILD_NAME
Environment variable key which contains the Jenkins build number.- See Also:
-
USE_LATEST_SAUCE_CONNECT
- See Also:
-
TUNNEL_NAME
- See Also:
-
-
Constructor Details
-
SauceOnDemandBuildWrapper
@DataBoundConstructor public SauceOnDemandBuildWrapper(boolean enableSauceConnect, org.jenkins_ci.plugins.run_condition.RunCondition condition, String credentialId, SeleniumInformation seleniumInformation, String seleniumHost, String seleniumPort, String options, String cliOptions, String sauceConnectPath, boolean launchSauceConnectOnSlave, boolean verboseLogging, boolean useLatestVersion, boolean useLatestSauceConnect, boolean forceCleanup, List<String> webDriverBrowsers, List<String> appiumBrowsers, String nativeAppPackage, boolean useGeneratedTunnelIdentifier) Constructs a new instance using data entered on the job configuration screen.- Parameters:
enableSauceConnect- indicates whether Sauce Connect should be started as part of the build.condition- allows users to define rules which enable Sauce ConnectseleniumInformation- 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 useduseLatestSauceConnect- indicates whether the latest version of Sauce Connect should always be usedforceCleanup- indicates whether to force cleanup for jobs/tunnels instead of waiting for timeoutwebDriverBrowsers- which browser(s) should be used for web driverappiumBrowsers- which browser(s) should be used for appiumnativeAppPackage- the path to the native app package to be testeduseGeneratedTunnelIdentifier- indicated whether tunnel names and ports should be managed by the plugincredentialId- Which credential a build should use
-
-
Method Details
-
getSauceTunnelManager
public static com.saucelabs.ci.sauceconnect.AbstractSauceTunnelManager getSauceTunnelManager() throws org.codehaus.plexus.component.repository.exception.ComponentLookupExceptionRetrieve theAbstractSauceTunnelManagerinstance to be used to launch Sauce Connect.- Returns:
AbstractSauceTunnelManagerinstance- Throws:
org.codehaus.plexus.component.repository.exception.ComponentLookupException- see plexus
-
makeSensitiveBuildVariables
- Overrides:
makeSensitiveBuildVariablesin classBuildWrapper
-
setUp
public BuildWrapper.Environment setUp(AbstractBuild build, Launcher launcher, BuildListener listener) throws IOException, InterruptedException Invoked prior to the running of a Jenkins build. Populates the Sauce specific environment variables and launches Sauce Connect.
- Overrides:
setUpin classBuildWrapper- Returns:
- a new
Environmentinstance populated with the Sauce environment variables - Throws:
IOExceptionInterruptedException
-
isDisableUsageStats
public boolean isDisableUsageStats() -
isUseLatestVersion
public boolean isUseLatestVersion() -
isForceCleanup
public boolean isForceCleanup() -
getSeleniumHost
-
setSeleniumHost
-
getSeleniumPort
-
setSeleniumPort
-
getSeleniumInformation
-
setSeleniumInformation
-
isEnableSauceConnect
public boolean isEnableSauceConnect() -
setEnableSauceConnect
public void setEnableSauceConnect(boolean enableSauceConnect) -
getWebDriverBrowsers
-
setWebDriverBrowsers
-
getAppiumBrowsers
-
setAppiumBrowsers
-
isLaunchSauceConnectOnSlave
public boolean isLaunchSauceConnectOnSlave() -
setLaunchSauceConnectOnSlave
public void setLaunchSauceConnectOnSlave(boolean launchSauceConnectOnSlave) -
isUseLatestSauceConnect
public boolean isUseLatestSauceConnect() -
isUseGeneratedTunnelIdentifier
public boolean isUseGeneratedTunnelIdentifier() -
setUseGeneratedTunnelIdentifier
public void setUseGeneratedTunnelIdentifier(boolean useGeneratedTunnelIdentifier) -
isVerboseLogging
public boolean isVerboseLogging() -
setVerboseLogging
public void setVerboseLogging(boolean verboseLogging) -
getOptions
-
setOptions
-
getCliOptions
-
setCliOptions
-
getCondition
public org.jenkins_ci.plugins.run_condition.RunCondition getCondition() -
getSauceConnectPath
-
setSauceConnectPath
-
isUseChromeForAndroid
public boolean isUseChromeForAndroid() -
getNativeAppPackage
-
setUseLatestVersion
public void setUseLatestVersion(boolean useLatestVersion) -
setForceCleanup
public void setForceCleanup(boolean forceCleanup) -
setNativeAppPackage
-
setUseChromeForAndroid
public void setUseChromeForAndroid(boolean useChromeForAndroid) -
getCredentialId
-
setCredentialId
-
migrateCredentials
-
getSauceBuildAction
-