-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1. fix E2E errors 2. use http-server to lauch local server on travis 3. use sauce-connect to test on localhost 4. use saucelab timeout parameters 5. only run build on master branch
- Loading branch information
PinkyJie
committed
Dec 24, 2015
1 parent
41681b3
commit d97cf5f
Showing
5 changed files
with
57 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,10 +7,11 @@ const args = require('yargs').argv; | |
const e2eBaseFolder = './source/test/e2e'; | ||
|
||
const config = { | ||
baseUrl: `http://localhost:${webpackConfig.devServer.port}`, | ||
framework: 'jasmine2', | ||
jasmineNodeOpts: { | ||
showColors: true, | ||
defaultTimeoutInterval: 30000, | ||
defaultTimeoutInterval: 90000, | ||
// remove ugly protractor dot reporter | ||
print: () => {} | ||
}, | ||
|
@@ -22,18 +23,20 @@ const config = { | |
const helper = require('./source/test/e2e/helper'); // eslint-disable-line | ||
browser._BasePageObject = helper.BasePageObject; | ||
browser._ = new helper.E2EHelper(); | ||
// screenshot reporter | ||
jasmine.getEnv().addReporter(new HtmlScreenshotReporter({ | ||
dest: `${e2eBaseFolder}/screenshots`, | ||
filename: 'e2e-report.html', | ||
captureOnlyFailedSpecs: true, | ||
reportOnlyFailedSpecs: false, | ||
pathBuilder: (currentSpec) => { | ||
// TODO: can not get browser name due to | ||
// https://github.com/mlison/protractor-jasmine2-screenshot-reporter/issues/4 | ||
return currentSpec.description.replace(/[ :]/g, '-'); | ||
} | ||
})); | ||
if (!args.ci) { | ||
// screenshot reporter | ||
jasmine.getEnv().addReporter(new HtmlScreenshotReporter({ | ||
dest: `${e2eBaseFolder}/screenshots`, | ||
filename: 'e2e-report.html', | ||
captureOnlyFailedSpecs: true, | ||
reportOnlyFailedSpecs: false, | ||
pathBuilder: (currentSpec) => { | ||
// TODO: can not get browser name due to | ||
// https://github.com/mlison/protractor-jasmine2-screenshot-reporter/issues/4 | ||
return currentSpec.description.replace(/[ :]/g, '-'); | ||
} | ||
})); | ||
} | ||
// add jasmine spec reporter | ||
jasmine.getEnv().addReporter(new SpecReporter({ | ||
displayStacktrace: 'all', | ||
|
@@ -51,50 +54,66 @@ const config = { | |
|
||
if (args.ci) { | ||
// run by sauce lab | ||
config.seleniumAddress = 'http://sd4399340:[email protected]/wd/hub'; | ||
config.baseUrl = 'http://localhost:8080/#'; | ||
config.sauceUser = 'sd4399340'; | ||
config.sauceKey = '5829a37c-41c0-4490-b6c2-061ae4acc5e9'; | ||
// https://wiki.saucelabs.com/display/DOCS/Platform+Configurator#/ | ||
config.multiCapabilities = [ | ||
{ | ||
name: `chrome-on-windows-${args.buildId}`, | ||
name: `Chrome (build-${args.buildId})`, | ||
build: args.buildId, | ||
browserName: 'chrome', | ||
platform: 'Windows 7' | ||
platform: 'Windows 7', | ||
maxDuration: 3600, | ||
commandTimeout: 600, | ||
idleTimeout: 1000 | ||
}, | ||
{ | ||
name: `safari-on-mac-${args.buildId}`, | ||
name: `Safari (build-${args.buildId})`, | ||
build: args.buildId, | ||
browserName: 'safari', | ||
platform: 'OS X 10.11' | ||
platform: 'OS X 10.11', | ||
maxDuration: 3600, | ||
commandTimeout: 600, | ||
idleTimeout: 1000 | ||
}, | ||
{ | ||
name: `ie9-on-windows-${args.buildId}`, | ||
name: `IE (build-${args.buildId})`, | ||
build: args.buildId, | ||
browserName: 'internet explorer', | ||
platform: 'Windows 7', | ||
version: '9.0' | ||
version: '11.0', | ||
maxDuration: 3600, | ||
commandTimeout: 600, | ||
idleTimeout: 1000 | ||
}, | ||
{ | ||
name: `safari-on-iphone-${args.buildId}`, | ||
name: `iOS (build-${args.buildId})`, | ||
build: args.buildId, | ||
browserName: 'iphone', | ||
platform: 'OS X 10.10', | ||
version: '9.1', | ||
deviceName: 'iPhone 5s', | ||
deviceOrientation: 'portrait' | ||
deviceOrientation: 'portrait', | ||
maxDuration: 3600, | ||
commandTimeout: 600, | ||
idleTimeout: 1000 | ||
}, | ||
{ | ||
name: `chrome-on-andoird-${args.buildId}`, | ||
name: `Android (build-${args.buildId})`, | ||
build: args.buildId, | ||
browserName: 'android', | ||
platform: 'Linux', | ||
version: '4.4', | ||
deviceName: 'Android Emulator', | ||
deviceOrientation: 'portrait' | ||
deviceOrientation: 'portrait', | ||
maxDuration: 3600, | ||
commandTimeout: 600, | ||
idleTimeout: 1000 | ||
} | ||
]; | ||
} else { | ||
// local run | ||
config.baseUrl = `http://${webpackConfig.devServer.host}:${webpackConfig.devServer.port}/`; | ||
config.capabilities = { | ||
browserName: 'chrome' | ||
}; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters