How to run protractor with different config file in sequence? -


i have different configuration file protractor, , create gulp task run protractor each config file in sequence. here actual code:

gulp.src('conf/protractor.conf.*.js')       .pipe($.debug())       .pipe($.foreach(function(stream, file){         var configfilename = path.join('conf/', path.basename(file.path));          console.log(configfilename);          gulp.src(path.join(conf.paths.e2e, '/**/*.js'))             .pipe($.protractor.protractor({               configfile: configfilename,               args: args             }))             .on('error', function (err) {               // make sure failed tests cause gulp exit non-zero               console.log('error catch gulp');               throw err;             })             .on('end', function () {               // close browser sync server               browsersync.exit();               done();               return stream;             });       })); 

it run protractor first configuration file , stop, if different conf file listed foreach.

does has idea of missing?

thanks

i found workaround: instead of trying use gulp want do, created little shell script. now, gulp task take protractor config file path command line argument that:

var argv = require('minimist')(process.argv.slice(2));  if (!argv.conf || typeof argv.conf !== 'string' ) throw new error('protractor configuration file path required');  function runprotractor (done) {   gulp.src(path.join(conf.paths.e2e, '/**/*.js'))       .pipe($.protractor.protractor({         configfile: argv.conf       }))       .on('error', function (err) {         // make sure failed tests cause gulp exit non-zero         throw err;       })       .on('end', function () {         // close browser sync server         browsersync.exit();         done();       }); }  gulp.task('protractor', ['protractor:src']); gulp.task('protractor:src', ['serve:e2e', 'webdriver-update'], runprotractor); 

and use shell script parse folder , call gulp protractor each configuration file:

#!/usr/bin/env bash  filename in conf/protractor.conf.*.js;     gulp protractor --conf=$filename done 

it works charm.


Comments

Popular posts from this blog

magento2 - Magento 2 admin grid add filter to collection -

Android volley - avoid multiple requests of the same kind to the server? -

Combining PHP Registration and Login into one class with multiple functions in one PHP file -