Skip to content

Instantly share code, notes, and snippets.

@samccone
Created March 18, 2015 00:06
Show Gist options
  • Save samccone/babb69f679b485743522 to your computer and use it in GitHub Desktop.
Save samccone/babb69f679b485743522 to your computer and use it in GitHub Desktop.
sauce connect basic test setup
beforeEach(function() {
if (process.env.SAUCE_USERNAME != undefined) {
this.browser = new webdriver.Builder()
.usingServer('http://'+ process.env.SAUCE_USERNAME+':'+process.env.SAUCE_ACCESS_KEY+'@ondemand.saucelabs.com:80/wd/hub')
.withCapabilities({
'tunnel-identifier': process.env.TRAVIS_JOB_NUMBER,
build: process.env.TRAVIS_BUILD_NUMBER,
username: process.env.SAUCE_USERNAME,
accessKey: process.env.SAUCE_ACCESS_KEY,
browserName: "chrome"
}).build();
} else {
this.browser = new webdriver.Builder()
.withCapabilities({
browserName: "chrome"
}).build();
}
return this.browser.get("http://localhost:8000/page/index.html");
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment