
Security News
Django Joins curl in Pushing Back on AI Slop Security Reports
Django has updated its security policies to reject AI-generated vulnerability reports that include fabricated or unverifiable content.
@seeplusplus/wdio-json-reporter
Advanced tools
A WebdriverIO plugin. Report results in json format.
A WebdriverIO plugin. Report results in json format.
There are breaking changes between WDIO v4 and v5 with how custom reporters work. The chart below shows the versions of this reporter and their WDIO compatibility version.
WDIO Json Reporter | WDIO |
---|---|
^0.4.0 | v4 |
^1.0.0 | v5 |
^2.0.0 | v6 |
^3.0.0 | v7 |
npm install wdio-json-reporter --save-dev
yarn add wdio-json-reporter --dev
reporters: [
'dot',
['json',{ stdout: true }]
],
reporters: [
'dot',
['json',{
outputDir: './Results'
}]
],
reporters: [
'dot',
['json',{
outputDir: './Results',
outputFileFormat: function(opts) {
return `results-${opts.cid}.${opts.capabilities}.json`
}
}]
],
With WDIO v5, reporting has moved from a centralized process to one that is handled by each of the "sessions" spun up for parallel test execution. This change helped reduce the amount of chatter during WDIO test execution and thus improved performance. The downside is we are no longer able to get a single report for ALL test execution. Consider the following:
2 suites of tests configured to run in 2 browsers:
wdio-json-reporter
provides a utility function to merge the multiple json files into a single file. Follow the steps below to take advantage of the utility.
const mergeResults = require('wdio-json-reporter/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
wdio-json-reporter
result files in <RESULTS_DIR>. This is necessary because multiple reporters produce json
result filesExample:
node mergeResults.json ./Results "wdio-json-*"
// 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>
npm install wdio-json-reporter@^0.4.0 --save-dev
yarn add wdio-json-reporter@^0.4.0 --dev
Following code shows the default wdio test runner configuration. Just add 'json'
as reporter
to the array. To get some output during the test you can run the WDIO Dot Reporter and the WDIO JSON Reporter at the same time:
// wdio.conf.js
module.exports = {
// ...
reporters: ['dot', 'json'],
reporterOptions: {
outputDir: './Results'
},
// ...
};
// wdio.conf.js
module.exports = {
// ...
reporters: ['dot', 'json'],
reporterOptions: {
outputDir: './',
combined: true
},
// ...
};
// wdio.conf.js
module.exports = {
// ...
reporters: ['dot', 'json'],
reporterOptions: {
outputDir: './',
filename: 'wdio-results'
},
// ...
};
// wdio.conf.js
module.exports = {
// ...
reporters: ['json'],
reporterOptions: {
useStdout: true
},
// ...
};
If you do not want to print out the mocha epilogue (i.e. 1 passing (5.2s)
), you can suppress it:
// wdio.conf.js
module.exports = {
// ...
reporters: ['json'],
reporterOptions: {
suppressEpilogue: true
},
// ...
};
For more information on WebdriverIO see the homepage.
FAQs
A WebdriverIO plugin. Report results in json format.
We found that @seeplusplus/wdio-json-reporter demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Django has updated its security policies to reject AI-generated vulnerability reports that include fabricated or unverifiable content.
Security News
ECMAScript 2025 introduces Iterator Helpers, Set methods, JSON modules, and more in its latest spec update approved by Ecma in June 2025.
Security News
A new Node.js homepage button linking to paid support for EOL versions has sparked a heated discussion among contributors and the wider community.