Skip to content

Commit

Permalink
allow more framework options as cli parameters - closes webdriverio#704
Browse files Browse the repository at this point in the history
  • Loading branch information
christian-bromann committed Aug 22, 2015
1 parent a73434a commit 3cccc55
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 3 deletions.
4 changes: 3 additions & 1 deletion docs/guide/testrunner/configurationfile.md
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,9 @@ exports.config = {
cucumberOpts: {
require: ['./examples/runner-specs/cucumber/step-definitions.js'],
// Enable this config to treat undefined definitions as warnings.
ignoreUndefinedDefinitions: false
ignoreUndefinedDefinitions: false,
// run only certain scenarios annotated by tags
tags: ['foo', 'bar']
},
//
// =====
Expand Down
4 changes: 3 additions & 1 deletion examples/wdio.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,9 @@ exports.config = {
cucumberOpts: {
require: ['./examples/runner-specs/cucumber/step-definitions.js'],
// Enable this config to treat undefined definitions as warnings.
ignoreUndefinedDefinitions: false
ignoreUndefinedDefinitions: false,
// run only certain scenarios annotated by tags
tags: ['foo', 'bar']
},
//
// =====
Expand Down
22 changes: 22 additions & 0 deletions lib/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,13 @@ var path = require('path'),
alias('framework', 'f').
describe('reporter', 'reporter to print out the results on stdout').
alias('reporter', 'r').
describe('cucumberOpts.tags', 'run only certain scenarios annotated by tags').
describe('cucumberOpts.ignoreUndefinedDefinitions', 'ignore undefined step definitions').
describe('cucumberOpts.require', 'specify where your step definitions are located').
describe('jasmineOpts.defaultTimeoutInterval', 'Jasmine default timeout').
describe('mochaOpts.ui', 'specify user-interface').
describe('mochaOpts.timeout', 'set test-case timeout in milliseconds').
describe('mochaOpts.require', 'require the given module').

describe('waitforTimeout', 'Default timeout for all wait commands').
describe('logLevel', 'Level of test output verbosity').
Expand Down Expand Up @@ -211,6 +218,21 @@ if(argv._[0] === 'config') {
});
}

/**
* sanitize cucumberOpts
*/
if(argv.cucumberOpts) {
if(argv.cucumberOpts.tags) {
argv.cucumberOpts.tags = argv.cucumberOpts.tags.split(',');
}
if(argv.cucumberOpts.ignoreUndefinedDefinitions) {
argv.cucumberOpts.ignoreUndefinedDefinitions = argv.cucumberOpts.ignoreUndefinedDefinitions === 'true'
}
if(argv.cucumberOpts.require) {
argv.cucumberOpts.require = argv.cucumberOpts.require.split(',');
}
}

// Use default configuration, if it exists.
var configFile = argv._[0];
if (!configFile) {
Expand Down
4 changes: 3 additions & 1 deletion lib/helpers/wdio.conf.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,9 @@ exports.config = {
cucumberOpts: {
require: ['<%= answers.stepDefinitions %>'],
// Enable this config to treat undefined definitions as warnings.
ignoreUndefinedDefinitions: false
ignoreUndefinedDefinitions: false,
// run only certain scenarios annotated by tags
// tags: ['foo', 'bar']
},
<% } %>
//
Expand Down

0 comments on commit 3cccc55

Please sign in to comment.