Skip to content

Commit

Permalink
Enable running tests on sauce-connect 💥
Browse files Browse the repository at this point in the history
  • Loading branch information
samccone committed Mar 17, 2015
1 parent 1a1f9da commit 66f35e2
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 4 deletions.
6 changes: 6 additions & 0 deletions .travis.yml
@@ -1,4 +1,10 @@
language: node_js
addons:
sauce_connect: true
env:
global:
- secure: L/aGHl+XZ2tyeZ0xZTkKPySfsVZxkQt9Y3naN0icMu8DoXP83eUQ/gKooEKP0i0XTvwslCGa808UyZ99mWAdZ/WBA23i7q3fCLHwMcA7EcRsDky8vv6nMu00jTwLEX2ly+3+jc4xZV7ZO7KJNBRBcSD78L2KiMiRUzZ+WFZVrZ0=
- secure: T9Ur8o93Bs42r2De53U97oheh/E+P9VDpuRYHUtr5YoxU/n4sALcz3FfyJ6HOcuDctIXb26MvNrzvf9abaxNFf4QapqVlWW6Fj8xHA9x55eRjz4QasyM1nk7gqhlZ2HZuvxqhEcgvfirn7FGb9bIEuBVmFaJtqURp2JwEO4ABdQ=
before_script:
- python -m SimpleHTTPServer &
- sleep 2
Expand Down
20 changes: 16 additions & 4 deletions test/basic.js
Expand Up @@ -3,10 +3,22 @@ var webdriver = require("selenium-webdriver");

describe("testing javascript in the browser", function() {
beforeEach(function() {
this.browser = new webdriver.Builder()
.withCapabilities({
browserName: "chrome"
}).build();
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");
});
Expand Down

0 comments on commit 66f35e2

Please sign in to comment.