NickTomlin / protractor-flake

Rerun potentially flakey protractor tests before failing.
MIT License
80 stars 51 forks source link

Unable to Switch Conf File #53

Closed tyleragnew closed 7 years ago

tyleragnew commented 7 years ago

@NickTomlin - Im seeing an issue where I'm not able to pass in the config file as a build arg. Is Flake configured to allow a conf file other than the regular protractor.conf.js ? This is my gulp task:

gulp.task('e2e-testEnv', ['build-e2e'], function(cb) {

  var protractorFlake = require('protractor-flake');

  protractorFlake({
    configFile: 'protractor.conf.testEnv.js',
    maxAttempts: 3,
    protractorArgs: [
    ]
  }, function (status, output) {
    process.exit(status);
  });
});
tyleragnew commented 7 years ago

I have also tried passing it in as a protractor arg and no go:

gulp.task('e2e-myMachine', ['build-e2e'], function(cb) {

  var protractorFlake = require('protractor-flake');

  protractorFlake({
    maxAttempts: 3,
    protractorArgs: [ "--protractor.conf.myMachine.js"
    ]
  }, function (status, output) {
    process.exit(status);
  });

});
NickTomlin commented 7 years ago

There is no configFile option; protractorArgs are passed directly to protractor (just like you would via the CLI) so you'll need to pass the argument exactly as you would to protractor, without the --

 protractorFlake({
    maxAttempts: 3,
    protractorArgs: ["protractor.conf.myMachine.js"]
  }, function (status, output) {})

I was able to do this with a test Gulpfile. I'm going to go ahead and close this for now but please holler if that does not work for you.

Thanks 😄 !