diff --git a/lib/runner/test-runners/cucumber.js b/lib/runner/test-runners/cucumber.js index fcf09083cf..134a29c1d4 100644 --- a/lib/runner/test-runners/cucumber.js +++ b/lib/runner/test-runners/cucumber.js @@ -94,7 +94,7 @@ class CucumberSuite extends TestSuite { if (options.feature_path && !Array.isArray(options.feature_path)) { options.feature_path = [options.feature_path]; } - const {feature_path} = options; + const {feature_path = ''} = options; const parallelArgs = this.usingCucumberWorkers ? ['--parallel', this.usingCucumberWorkers]: []; const additionalOptions = this.buildArgvValue(['tags', 'retry-tag-filter', 'profile', 'format', 'format-options', 'dry-run', 'fail-fast', ['retries', 'retry'], 'no-strict', 'name']); const extraParams = ['--world-parameters', JSON.stringify(this.argv)]; @@ -138,7 +138,14 @@ class CucumberSuite extends TestSuite { argValues = [argValues]; } - argValues.forEach(value => prev.push(`--${key}`, value)); + argValues.forEach(value => { + const args = [`--${key}`]; + if (value !== true) { + args.push(value); + } + + prev.push(...args); + }); } return prev; diff --git a/test/src/runner/cucumber-integration/testCliArgs.js b/test/src/runner/cucumber-integration/testCliArgs.js index cd0aeb2ec9..7796c8df13 100644 --- a/test/src/runner/cucumber-integration/testCliArgs.js +++ b/test/src/runner/cucumber-integration/testCliArgs.js @@ -48,6 +48,7 @@ describe('Cucumber cli arguments', function(){ modulePath: [path.join(__dirname, '../../../cucumbertests/testSample.js')] }); + assert.strictEqual(cliArgs.length, 21); assert.ok(cliArgs.includes('--name')); assert.strictEqual(cliArgs[cliArgs.indexOf('--name')+1], 'sample'); assert.ok(cliArgs.includes('--fail-fast'));