From 41feaca58c81fbd578c77424abf745acaf26f84f Mon Sep 17 00:00:00 2001 From: tombatossals Date: Mon, 24 Feb 2014 21:25:47 +0100 Subject: [PATCH] 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 --- lib/runner.js | 8 +++++++- referenceConf.js | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/runner.js b/lib/runner.js index 5e4f773a6..c0dc2904f 100644 --- a/lib/runner.js +++ b/lib/runner.js @@ -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); } diff --git a/referenceConf.js b/referenceConf.js index 4c9720e5e..9783f1f2f 100644 --- a/referenceConf.js +++ b/referenceConf.js @@ -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'