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

Commit 41feaca

Browse files
tombatossalsjuliemr
authored andcommitted
feat(framework.cucumber): Allow multiple tags on cucumber tests.
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
1 parent 7348b62 commit 41feaca

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

lib/runner.js

+7-1
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,13 @@ Runner.prototype.runCucumber_ = function(specs, done) {
132132
}
133133

134134
// Process Cucumber Tag param
135-
if (self.config_.cucumberOpts.tags) {
135+
if (Array.isArray(self.config_.cucumberOpts.tags)) {
136+
for (var i in self.config_.cucumberOpts.tags) {
137+
var tags = self.config_.cucumberOpts.tags[i];
138+
execOptions.push('-t');
139+
execOptions.push(tags);
140+
}
141+
} else if (self.config_.cucumberOpts.tags) {
136142
execOptions.push('-t');
137143
execOptions.push(self.config_.cucumberOpts.tags);
138144
}

referenceConf.js

+1
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ exports.config = {
143143
// Require files before executing the features.
144144
require: 'cucumber/stepDefinitions.js',
145145
// Only execute the features or scenarios with tags matching @dev.
146+
// This may be an array of strings to specify multiple tags to include.
146147
tags: '@dev',
147148
// How to format features (default: progress)
148149
format: 'summary'

0 commit comments

Comments
 (0)