Skip to content
This repository has been archived by the owner on Jan 12, 2024. It is now read-only.

Commit

Permalink
add phantomjs to e2e tests
Browse files Browse the repository at this point in the history
  • Loading branch information
hmdhk committed Aug 2, 2016
1 parent 99aabab commit 8c5347b
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 7 deletions.
20 changes: 17 additions & 3 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ gulp.task('server', function () {
root: ['examples', 'dist'],
port: 7000,
livereload: false,
open: false,
open: false
})
})

Expand Down Expand Up @@ -212,7 +212,7 @@ gulp.task('test:e2e:protractor', function () {

return gulp.src(['e2e_test/**/*.pspec.js'])
.pipe(protractor({
configFile: 'protractor.conf.js',
configFile: 'protractor.conf.js'
}))
.on('error', function (e) { throw e })
})
Expand All @@ -229,6 +229,19 @@ gulp.task('test:e2e:run', ['test:e2e:protractor'], function (done) {
})
})

gulp.task('test:e2e:phantomjs', function () {
var failSafeStream = gulp.src('wdio.phantomjs.conf.js')
.pipe(webdriver())
.on('error', function () {
console.log('Exiting process with status 1')
process.exit(1)
})
.on('end', function () {
console.log('Tests complete')
})
return failSafeStream
})

gulp.task('test:e2e:sauceconnect:failsafe', function () {
var failSafeStream = gulp.src('wdio.failsafe.conf.js')
.pipe(webdriver(webdriverConfig))
Expand Down Expand Up @@ -312,6 +325,7 @@ gulp.task('test:e2e:selenium', function (done) {

gulp.task('test:e2e:start-local', function (done) {
runSequence('build', 'build:release', 'test:e2e:serve', 'test:e2e:selenium', function () {
done()
console.log('All tasks completed.')
})
})
Expand All @@ -324,7 +338,7 @@ gulp.task('test:e2e:start-sauce', function (done) {
})

gulp.task('test:e2e', function (done) {
runSequence('build', 'build:release', 'test:e2e:serve', 'test:e2e:launchsauceconnect', 'test:e2e:sauceconnect', function (err) {
runSequence('build', 'build:release', 'test:e2e:start-local', 'test:e2e:phantomjs', 'test:e2e:launchsauceconnect', 'test:e2e:sauceconnect', function (err) {
if (err) {
return taskFailed(err)
} else {
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
"karma-jasmine": "~0.3.6",
"karma-sauce-launcher": "^0.3.1",
"karma-spec-reporter": "0.0.23",
"phantomjs2": "^2.2.0",
"proxyquireify": "^3.0.1",
"run-sequence": "^1.1.5",
"selenium-standalone": "^4.8.0",
Expand Down
4 changes: 0 additions & 4 deletions wdio.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,6 @@ exports.config = {
// https://docs.saucelabs.com/reference/platforms-configurator
//
capabilities: [
// {
// browserName: 'phantomjs',
// 'phantomjs.binary.path': require('phantomjs').path
// },
{
maxInstances: 1,
browserName: 'chrome',
Expand Down
14 changes: 14 additions & 0 deletions wdio.phantomjs.conf.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
var config = require('./wdio.conf.js').config
config.capabilities = [
{
maxInstances: 1,
browserName: 'phantomjs',
'phantomjs.binary.path': require('phantomjs2').path
}
]

config.specs = [
'./e2e_test/**/*.failsafe.js'
]

exports.config = config

0 comments on commit 8c5347b

Please sign in to comment.