This repository has been archived by the owner on Aug 30, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(protractor): support for gulp-protractor for v6-7 only (#1752)
* fix(protractor): updating gulp-protractor * re-factoring out protractor prep tasks
- Loading branch information
Showing
4 changed files
with
58 additions
and
9 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -47,9 +47,23 @@ gulp.task('env:prod', function () { | |
|
||
// Nodemon task | ||
gulp.task('nodemon', function () { | ||
|
||
var nodeVersions = process.versions; | ||
var debugArgument = '--debug'; | ||
switch (nodeVersions.node.substr(0, 1)) { | ||
case '4': | ||
case '5': | ||
case '6': | ||
debugArgument = '--debug'; | ||
break; | ||
case '7': | ||
debugArgument = '--inspect'; | ||
break; | ||
} | ||
|
||
return plugins.nodemon({ | ||
script: 'server.js', | ||
nodeArgs: ['--inspect'], | ||
nodeArgs: [debugArgument], | ||
ext: 'js,html', | ||
verbose: true, | ||
watch: _.union(defaultAssets.server.views, defaultAssets.server.allJS, defaultAssets.server.config) | ||
|
@@ -371,16 +385,43 @@ gulp.task('dropdb', function (done) { | |
}); | ||
}); | ||
|
||
// Downloads the selenium webdriver | ||
// Downloads the selenium webdriver if protractor version is compatible | ||
gulp.task('webdriver_update', webdriver_update); | ||
|
||
gulp.task('webdriver_prep', function(done) { | ||
runSequence('protractor_prep', 'webdriver_update', done); | ||
}); | ||
|
||
gulp.task('protractor_prep', function() { | ||
var nodeVersions = process.versions; | ||
switch (nodeVersions.node.substr(0, 1)) { | ||
case '4': | ||
case '5': | ||
console.log('E2E testing doesnt support v4 and v5'); | ||
process.exit(0); | ||
break; | ||
case '6': | ||
if (parseInt(nodeVersions.node.substr(1, 1), 10) < 9) { | ||
console.log('E2E testing with latest protractor requires v >= 6.9 '); | ||
process.exit(0); | ||
} | ||
break; | ||
default: | ||
console.log('Detecting support for protractor E2E tests'); | ||
break; | ||
} | ||
|
||
return gulp.src('*.js'); | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
lirantal
Author
Member
|
||
}); | ||
|
||
|
||
// Start the standalone selenium server | ||
// NOTE: This is not needed if you reference the | ||
// seleniumServerJar in your protractor.conf.js | ||
gulp.task('webdriver_standalone', webdriver_standalone); | ||
|
||
// Protractor test runner task | ||
gulp.task('protractor', ['webdriver_update'], function () { | ||
gulp.task('protractor', ['webdriver_prep'], function () { | ||
gulp.src([]) | ||
.pipe(protractor({ | ||
configFile: 'protractor.conf.js' | ||
|
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/bin/bash -x | ||
|
||
echo "$TRAVIS_NODE_VERSION" | ||
if [[ "$TRAVIS_NODE_VERSION" == "6" || "$TRAVIS_NODE_VERSION" == "7" ]] | ||
then | ||
npm install protractor | ||
export DISPLAY=:99.0 | ||
bash -e /etc/init.d/xvfb start | ||
./node_modules/protractor/bin/webdriver-manager update --standalone --firefox | ||
./node_modules/protractor/bin/webdriver-manager start 2>&1 & | ||
fi |
Is there a specific reason for returning
gulp.src('*.js')
here?A simple
return;
should suffice. It's a little confusing as to what this accomplishes, so it would probably be best to add a comment to why it's needed or remove it.