Skip to content

Commit ddea769

Browse files
author
John Doherty
committed
added -f switch to allow a specific feature file to be run
1 parent 4d27a76 commit ddea769

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

README.MD

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ node ./node_modules/selenium-cucumber-js/index.js -s ./step-definitions
2727
-b, --browser <path> name of browser to use. defaults to chrome
2828
-r, --reports <path> output path to save reports. defaults to ./reports
2929
-t, --tags <tagName> name of tag to run
30+
-f, --featureFile <path> a specific feature file to run
3031
```
3132

3233
By default tests are run using Google Chrome, to run tests using another browser supply the name of that browser along with the `-b` switch. Available options are:

index.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ program
1919
.option('-b, --browser <path>', 'name of browser to use. defaults to chrome', /^(chrome|firefox|phantomjs)$/i, 'chrome')
2020
.option('-r, --reports <path>', 'output path to save reports. defaults to ./reports', './reports')
2121
.option('-t, --tags <tagName>', 'name of tag to run')
22+
.option('-f, --featureFile <path>', 'a specific feature file to run')
2223
.parse(process.argv);
2324

2425
program.on('--help', function() {
@@ -42,6 +43,11 @@ global.sharedObjectPaths = program.sharedObjects.map(function(item){
4243
// rewrite command line switches for cucumber
4344
process.argv.splice(2, 100);
4445

46+
// allow a specific feature file to be excuted
47+
if (program.featureFile) {
48+
process.argv.push(program.featureFile);
49+
}
50+
4551
// add switch to tell cucumber to produce json report files
4652
process.argv.push('-f');
4753
process.argv.push('pretty');

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "selenium-cucumber-js",
3-
"version": "1.2.8",
3+
"version": "1.2.9",
44
"description": "A debuggable JS BDD framework that uses the official selenium-webdriver for Node and cucumber-js",
55
"main": "index.js",
66
"scripts": {

0 commit comments

Comments
 (0)