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

Commit

Permalink
feat(framework.cucumber): Allow multiple tags on cucumber tests.
Browse files Browse the repository at this point in the history
Motivation:
Support for multiple tags on the cucumber test execution, to be able to filter with more complex expressions the scenarios to run.

How to use:
cucumberOpts: {
    tags: '@dev'
}

or

cucumberOpts: {
    tags: ['@dev', '~@ignore']
}

More information on tags:
https://github.com/cucumber/cucumber/wiki/Tags
  • Loading branch information
tombatossals authored and juliemr committed Feb 27, 2014
1 parent 7348b62 commit 41feaca
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,13 @@ Runner.prototype.runCucumber_ = function(specs, done) {
}

// Process Cucumber Tag param
if (self.config_.cucumberOpts.tags) {
if (Array.isArray(self.config_.cucumberOpts.tags)) {
for (var i in self.config_.cucumberOpts.tags) {
var tags = self.config_.cucumberOpts.tags[i];
execOptions.push('-t');
execOptions.push(tags);
}
} else if (self.config_.cucumberOpts.tags) {
execOptions.push('-t');
execOptions.push(self.config_.cucumberOpts.tags);
}
Expand Down
1 change: 1 addition & 0 deletions referenceConf.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ exports.config = {
// Require files before executing the features.
require: 'cucumber/stepDefinitions.js',
// Only execute the features or scenarios with tags matching @dev.
// This may be an array of strings to specify multiple tags to include.
tags: '@dev',
// How to format features (default: progress)
format: 'summary'
Expand Down

0 comments on commit 41feaca

Please sign in to comment.