Skip to content

Instantly share code, notes, and snippets.

@rocknrollMarc
Last active August 29, 2015 14:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rocknrollMarc/85296aab8ce8e3645a07 to your computer and use it in GitHub Desktop.
Save rocknrollMarc/85296aab8ce8e3645a07 to your computer and use it in GitHub Desktop.
gulp-protractor-livereload
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