|
| 1 | +var gulp = require('gulp'); |
| 2 | + |
| 3 | +// The protractor task |
| 4 | +var protractor = require('gulp-protractor'); |
| 5 | + |
| 6 | +// Start a standalone server |
| 7 | +var webdriver_standalone = protractor.webdriver_standalone; |
| 8 | + |
| 9 | +// Download and update the selenium driver |
| 10 | +var webdriver_update = protractor.webdriver_update; |
| 11 | + |
| 12 | +// Downloads the selenium webdriver |
| 13 | +gulp.task('webdriver-update', webdriver_update); |
| 14 | + |
| 15 | +// Start the standalone selenium server |
| 16 | +// NOTE: This is not needed if you reference the |
| 17 | +// seleniumServerJar in your protractor.conf.js |
| 18 | +gulp.task('webdriver-standalone', webdriver_standalone); |
| 19 | + |
| 20 | + |
| 21 | +// Setting up the test task |
| 22 | +gulp.task('protractor', ['webdriver-update'], function(cb) { |
| 23 | + gulp.src(['test/protractor/specs/**/*.js']).pipe(protractor.protractor({ |
| 24 | + configFile: 'test/protractor/conf.js', |
| 25 | + })).on('error', function(e) { |
| 26 | + console.log(e); |
| 27 | + }).on('end', cb); |
| 28 | +}); |
| 29 | + |
| 30 | +['validation-messages', 'custom-validation'].forEach(function(name) { |
| 31 | + gulp.task('protractor:' + name, ['webdriver-update'], function(cb) { |
| 32 | + gulp.src(['test/protractor/specs/' + name + '.js']).pipe(protractor.protractor({ |
| 33 | + configFile: 'test/protractor/conf.js', |
| 34 | + })).on('error', function(e) { |
| 35 | + console.log(e); |
| 36 | + }).on('end', cb); |
| 37 | + }); |
| 38 | +}); |
0 commit comments