Permalink
Browse files

Enable running tests on sauce-connect 💥

  • Loading branch information...
samccone committed Mar 17, 2015
1 parent 1a1f9da commit 66f35e2380aebc0abdb85d365731d012b442d7fa
Showing with 22 additions and 4 deletions.
  1. +6 −0 .travis.yml
  2. +16 −4 test/basic.js
View
@@ -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
View
@@ -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");
});

0 comments on commit 66f35e2

Please sign in to comment.