Skip to content

Commit

Permalink
Updated README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Eduardo-Cardenas-Teracode committed Feb 7, 2020
1 parent 65037df commit 7f0a731
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,11 @@ to get a single report for ALL test execution. Consider the following:
1) Create a small node script
```javascript
const mergeResults = require('wdio-json-reporter/mergeResults')
mergeResults()
mergeResults('./Results', 'wdio-json-*', 'wdio-custom-filename.json')
```

*Note:* `wdio-custom-filename.json` is optional, is the parameter is not provided the default value is `wdio-merged.json`

2) Call node script from command line and pass 2 arguments

* <RESULTS_DIR>: Directory where results files are written
Expand All @@ -91,6 +93,16 @@ Example:
node mergeResults.json ./Results "wdio-json-*"
```

3) As part of a wdio hook

```js
// Located in your wdio.conf.js file
onComplete: function (exitCode, config, capabilities, results) {
const mergeResults = require('wdio-json-reporter/mergeResults')
mergeResults('./Results', 'results-*', 'wdio-custom-filename.json')
}
```

Upon completion, the merge script will output a single json file named `wdio-merged.json` in the provided <RESULTS_DIR>


Expand Down

0 comments on commit 7f0a731

Please sign in to comment.