Skip to content

Commit

Permalink
JENKINS-13796 Expose selected browser information as environment vari…
Browse files Browse the repository at this point in the history
…ables
  • Loading branch information
rossrowe committed Jun 9, 2012
1 parent a78f784 commit 3aaea6d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 2 additions & 0 deletions README
Expand Up @@ -7,3 +7,5 @@ To build and unit test the plugin, execute:
To deploy a built version, execute

mvn release:prepare release:perform

Defects/enhancements can be recorded at https://issues.jenkins-ci.org/browse/JENKINS/component/15751
Expand Up @@ -90,7 +90,9 @@ public class SauceOnDemandBuildWrapper extends BuildWrapper implements Serializa
*/
private boolean launchSauceConnectOnSlave = false;
public static final Pattern ENVIRONMENT_VARIABLE_PATTERN = Pattern.compile("[$|%]([a-zA-Z_][a-zA-Z0-9_]+)");

private static final String SELENIUM_BROWSER = "SELENIUM_BROWSER";
private static final String SELENIUM_PLATFORM = "SELENIUM_PLATFORM";
private static final String SELENIUM_VERSION = "SELENIUM_VERSION";


@DataBoundConstructor
Expand Down Expand Up @@ -132,6 +134,9 @@ public void buildEnvVars(Map<String, String> env) {
if (browsers != null && !browsers.isEmpty()) {
if (browsers.size() == 1) {
Browser browserInstance = BrowserFactory.getInstance().forKey(browsers.get(0));
env.put(SELENIUM_PLATFORM, browserInstance.getPlatform().toString());
env.put(SELENIUM_BROWSER, browserInstance.getBrowserName());
env.put(SELENIUM_VERSION, browserInstance.getVersion());
env.put(SELENIUM_DRIVER, browserInstance.getUri());
}

Expand Down

0 comments on commit 3aaea6d

Please sign in to comment.