Skip to content

Commit d6ee332

Browse files
author
John Doherty
committed
added -d command line switch to disable auto launching of test report
1 parent 6f966de commit d6ee332

File tree

4 files changed

+7
-2
lines changed

4 files changed

+7
-2
lines changed

README.MD

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ node ./node_modules/selenium-cucumber-js/index.js -s ./step-definitions
2626
-o, --sharedObjects [paths] path to shared objects (repeatable). defaults to ./shared-objects
2727
-b, --browser <path> name of browser to use. defaults to chrome
2828
-r, --reports <path> output path to save reports. defaults to ./reports
29+
-d, --disableLaunchReport disable the auto opening the browser with test report
2930
-j, --junit <path> output path to save junit-report.xml defaults to ./reports
3031
-t, --tags <tagName> name of tag to run
3132
-f, --featureFile <path> a specific feature file to run

index.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ program
1818
.option('-o, --sharedObjects [paths]', 'path to shared objects (repeatable). defaults to ./shared-objects', collectPaths, ['./shared-objects'])
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')
21+
.option('-d, --disableLaunchReport [optional]', 'Disables the auto opening the browser with test report')
2122
.option('-j, --junit <path>', 'output path to save junit-report.xml defaults to ./reports')
2223
.option('-t, --tags <tagName>', 'name of tag to run')
2324
.option('-f, --featureFile <path>', 'a specific feature file to run')
@@ -37,6 +38,9 @@ global.pageObjectPath = path.resolve(program.pageObjects);
3738
// used within world.js to output reports
3839
global.reportsPath = path.resolve(program.reports);
3940

41+
// used within world.js to decide if reports should be generated
42+
global.disableLaunchReport = (program.disableLaunchReport);
43+
4044
// used within world.js to output junit reports
4145
global.junitPath = path.resolve(program.junit || program.reports);
4246

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.3.7",
3+
"version": "1.3.8",
44
"description": "JavaScript browser automation framework using official selenium-webdriver and cucumber-js",
55
"main": "index.js",
66
"scripts": {

runtime/world.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ module.exports = function () {
164164
jsonFile: cucumberReportPath,
165165
output: path.resolve(global.reportsPath, 'cucumber-report.html'),
166166
reportSuiteAsScenarios: true,
167-
launchReport: true,
167+
launchReport: (!global.disableLaunchReport),
168168
ignoreBadJsonFile: true
169169
};
170170

0 commit comments

Comments
 (0)