Merge pull request #1968 from LLK/travis

Make Travis run smoke tests with Saucelabs
This commit is contained in:
Bryce Taylor 2018-07-23 14:47:08 -04:00 committed by GitHub
commit 4f927b1d38
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 3 deletions

View file

@ -94,8 +94,8 @@ jobs:
- cd test/integration
- npm install
- cd -
script: npm run smoke
script: npm run smoke-sauce
stages:
- test
- name: smoke
if: branch IN (travis) and type != pull_request
if: type != pull_request

View file

@ -3,6 +3,8 @@ const bindAll = require('lodash.bindall');
const headless = process.env.SMOKE_HEADLESS || false;
const remote = process.env.SMOKE_REMOTE || false;
const ci = process.env.CI || false;
const buildID = process.env.TRAVIS_BUILD_NUMBER;
const {SAUCE_USERNAME, SAUCE_ACCESS_KEY} = process.env;
const {By, until} = webdriver;
@ -24,7 +26,13 @@ class SeleniumHelper {
}
buildDriver (name) {
if (remote === 'true'){
this.driver = this.getSauceDriver(SAUCE_USERNAME, SAUCE_ACCESS_KEY, name);
let nameToUse;
if (ci === 'true'){
nameToUse = 'travis ' + buildID + ' : ' + name;
} else {
nameToUse = name;
}
this.driver = this.getSauceDriver(SAUCE_USERNAME, SAUCE_ACCESS_KEY, nameToUse);
} else {
this.driver = this.getDriver();
}