Skip to content
This repository has been archived by the owner on Jul 29, 2024. It is now read-only.

Commit

Permalink
feat(suites): allow more than one suite from the command line
Browse files Browse the repository at this point in the history
Allow a comma-separated list of suites be provided on the command line, like
`--suite=suite1,suite2`
  • Loading branch information
nathasm authored and juliemr committed Jul 22, 2014
1 parent caf5f32 commit 1b16c26
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
11 changes: 6 additions & 5 deletions docs/referenceConf.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,9 @@ exports.config = {
exclude: [],

// Alternatively, suites may be used. When run without a command line
// parameter, all suites will run. If run with --suite=smoke, only the
// patterns matched by that suite will run.
// parameter, all suites will run. If run with --suite=smoke or
// --suite=smoke,full only the patterns matched by the specified suites will
// run.
suites: {
smoke: 'spec/smoketests/*.js',
full: 'spec/*.js'
Expand All @@ -88,9 +89,9 @@ exports.config = {
capabilities: {
browserName: 'chrome',

// Number of times to run this set of capabilities (in parallel, unless
// Number of times to run this set of capabilities (in parallel, unless
// limited by maxSessions). Default is 1.
count: 1,
count: 1,

// If this is set to be true, specs will be sharded by file (i.e. all
// files to be run by this set of capabilities will run in parallel).
Expand Down Expand Up @@ -183,7 +184,7 @@ exports.config = {
// Mocha and Cucumber have limited beta support. You will need to include your
// own assertion framework (such as Chai) if working with Mocha.
framework: 'jasmine',

// Options to be passed to minijasminenode.
//
// See the full list at https://github.com/juliemr/minijasminenode/tree/jasmine1
Expand Down
7 changes: 5 additions & 2 deletions lib/configParser.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,15 +113,18 @@ ConfigParser.resolveFilePatterns =
* @return {Array} An array of globs locating the spec files
*/
ConfigParser.getSpecs = function(config) {
var specs = [];
if (config.suite) {
return config.suites[config.suite];
_.forEach(config.suite.split(','), function(suite) {
specs = _.union(specs, makeArray(config.suites[suite]));
});
return specs;
}

if (config.specs.length > 0) {
return config.specs;
}

var specs = [];
_.forEach(config.suites, function(suite) {
specs = _.union(specs, makeArray(suite));
});
Expand Down
3 changes: 2 additions & 1 deletion scripts/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ var scripts = [
'node lib/cli.js spec/cucumberConf.js',
'node lib/cli.js spec/withLoginConf.js',
'node lib/cli.js spec/suitesConf.js --suite okmany',
'node lib/cli.js spec/suitesConf.js --suite okspec'
'node lib/cli.js spec/suitesConf.js --suite okspec',
'node lib/cli.js spec/suitesConf.js --suite okmany,okspec'
];

scripts.push(
Expand Down

0 comments on commit 1b16c26

Please sign in to comment.