diff --git a/tasks/protractor_runner.js b/tasks/protractor_runner.js index d247155..a79d9a4 100644 --- a/tasks/protractor_runner.js +++ b/tasks/protractor_runner.js @@ -42,6 +42,11 @@ module.exports = function(grunt) { opts.configFile = this.data.configFile; } + // suite may or may not to be in options{} object, and can be overriden if passed through the command line. + if (!grunt.util._.isUndefined(this.data.suite)) { + opts.suite = this.data.suite; + } + grunt.verbose.writeln("Options: " + util.inspect(opts)); var keepAlive = opts['keepAlive']; @@ -79,6 +84,11 @@ module.exports = function(grunt) { } }); + //Adds the suite configuration from opts if it hasn't been added by command line arguments + if (!grunt.util._.isUndefined(opts.suite) && !('suite' in opts.args || grunt.option('suite'))){ + args.push('--suite', opts.suite); + } + // Convert [object] to --[object].key1 val1 --[object].key2 val2 .... objectArgs.forEach(function(a) { (function convert(prefix, obj, args) {