Open hem678 opened 3 years ago
Can you show exactly how you are passing options?
under cypress.json
"reporter": "mochawesome", "reporterOptions": { "reportDir": "cypress/reports", "inline": true, "charts": true, "overwrite": false, "html": false, "json": true, "reportTitle": "UI Automation Test Report", "reportPageTitle": "E2E Reports", "reportFilename": "TestReport", "quiet": false, "includeScreenshots": true, "timestamp": true, "code": false
@adamgruber - any update on this issue ?
I'm unable to reproduce this. When I run a simple test with the above configuration the output is a single JSON file as expected.
If you can create a repo that reproduces the behavior you are seeing then I can try to dig a little deeper.
i can see single HTML report after combining multiple JSONs but its creating assets folder as well, which unable to display html page on EMAIL Body
I think the issue is that this library does not read the options from the output.json
file generated by mochawesome instead we have to pass cli options or create another .mocharc.js
which are both just duplicates of the already existing options in the json file.
There is a top level meta
key in output.json
which looks like this:
"meta": {
"mocha": {
"version": "7.0.1"
},
"mochawesome": {
"options": {
"quiet": false,
"reportFilename": "mochawesome",
"saveHtml": false,
"saveJson": true,
"consoleReporter": "spec",
"useInlineDiffs": false,
"code": true
},
"version": "6.2.2"
},
"marge": {
"options": {
"reportTitle": "My test report",
"reportPageTitle": "My test report",
"reportDir": "cypress/results",
"charts": true,
"inline": true,
"showHooks": "always",
"overwrite": false,
"html": false,
"json": true
},
"version": "5.2.0"
}
}
@adamgruber Is my assumption correct that the options under the marge
key are not used in this library? If yes I might be able to add it in a PR if you approve it.
npm i --save-dev cypress mochawesome mochawesome-merge mochawesome-report-generator
cypress.json
file with the following:
{
"reporter": "mochawesome",
"reporterOptions": {
"reportTitle": "My test report",
"reportDir": "cypress/results",
"overwrite": false,
"html": false,
"json": true
}
}
package.json
scripts:"cypress:run": "cypress run && npx mochawesome-merge ./cypress/results/*.json -o ./cypress/results/output.json && npx marge ./cypress/results/output.json"
npm run cypress:run
Noice I did not create any additional files for mocha nor did I pass any cli args to marge.
The output.html
file should be under ./cypress/results/output.html and the title in the navbar should be "My test report"
The output.html
file is under ./mochawesome-report and the title is your current directory.
PS C:\Users\LENOVO\CypressAutomation> npx run cypress:run npm ERR! code ENOTFOUND npm ERR! errno ENOTFOUND npm ERR! network request to https://registry.npmjs.org/run failed, reason: getaddrinfo ENOTFOUND host npm ERR! network This is a problem related to network connectivity. npm ERR! network In most cases you are behind a proxy or have bad network settings. npm ERR! network npm ERR! network If you are behind a proxy, please make sure that the npm ERR! network 'proxy' config is set properly. See: 'npm help config'
npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\LENOVO\AppData\Roaming\npm-cache_logs\2023-03-23T06_28_52_039Z-debug.log Install for [ 'run@latest' ] failed with code 1 PS C:\Users\LENOVO\CypressAutomation> npx run cypress:run npm ERR! network npm ERR! network If you are behind a proxy, please make sure that the npm ERR! network 'proxy' config is set properly. See: 'npm help config'
npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\LENOVO\AppData\Roaming\npm-cache_logs\2023-03-23T06_28_58_670Z-debug.log Install for [ 'run@latest' ] failed with code 1
I have followed the instructions but i keep facing this issue in cypress.
Reporter still not generating in a single file after sending inline as true
reporter options :
"inline":true "html":false
still reporter generating asserts folder and when sending an email with the report.html showing blank page
tried mochaawesome version : 6.1.1 and 6.2.2