Last active
August 29, 2015 14:21
-
-
Save rocknrollMarc/85296aab8ce8e3645a07 to your computer and use it in GitHub Desktop.
gulp-protractor-livereload
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
var gulp = require('gulp'); | |
var livereload = require('gulp-livereload'); | |
// The protractor task | |
var protractor = require('gulp-protractor').protractor; | |
// Start a standalone server | |
var webdriver_standalone = require('gulp-protractor').webdriver_standalone; | |
// Download and update the selenium driver | |
var webdriver_update = require('gulp-protractor').webdriver_update; | |
// Downloads the selenium webdriver | |
gulp.task('webdriver_update', webdriver_update); | |
// Start the standalone selenium server | |
gulp.task('webdriver_standalone', webdriver_standalone); | |
gulp.task('watch', function() { | |
livereload.listen(); | |
gulp.watch('./app/*.*', ['protractor', 'watch']); | |
gulp.watch('./test/e2e/*.js', ['protractor', 'watch']); | |
}); | |
// Setting up the test task | |
gulp.task('protractor', ['webdriver_update'], function(cb) { | |
gulp.src([]).pipe(protractor({ | |
configFile: './test/protractor-conf.js', | |
args: process.argv.slice(3) || '' | |
})).on('error', function(e) { | |
console.error(e); | |
process.exit(1); | |
}).on('end', cb); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment