You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
### Saving CucumberJS json to disk when using Protractor
50
+
####Saving CucumberJS json to disk when using Protractor
35
51
If you're using Protractor in combination with CucumberJS there currently is [no way](https://github.com/cucumber/cucumber-js/issues/90) to save the CucumberJS JSON output to a file.
36
52
37
53
It is however possible to add a listener to the CucumberJS JSON formatter and save it to a file manually. The following hook can be added to your project and included to your Protractor configuration.
@@ -56,7 +72,7 @@ module.exports = function JsonOutputHook() {
56
72
57
73
Above snippet will hook into the CucumberJS JSON formatter and save the JSON to a file called 'cucumber-test-results.json' in the './reports' folder (relative from this file's location)
58
74
59
-
### Setting up Protractor, CucumberJS and the JSON listener
75
+
####Setting up Protractor, CucumberJS and the JSON listener
60
76
61
77
In your protractor.conf.js add a reference to the hook listener (as shown above). In this example the file is found in './support'. Also make sure to set the output format to 'json'.
62
78
@@ -66,35 +82,6 @@ cucumberOpts: {
66
82
format:'json'
67
83
},
68
84
```
69
-
### Options
70
-
71
-
#### options.dest
72
-
Type: `String`
73
-
Default value: `'.'`
74
-
75
-
The output directory for the HTML report relative from the Gulpfile
76
-
77
-
#### options.filename
78
-
Type: `String`
79
-
Default value: `'report.html'`
80
-
81
-
The filename for the HTML report
82
-
83
-
### Usage Examples
84
-
85
-
#### Default Options
86
-
87
-
```js
88
-
grunt.initConfig({
89
-
'protractor-cucumber-html-report': {
90
-
options: {
91
-
dest:'.',
92
-
output:'report.html',
93
-
testJSONResultPath:'',
94
-
},
95
-
},
96
-
});
97
-
```
98
85
99
86
## Contributing
100
87
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using [Grunt](http://gruntjs.com/).
0 commit comments