DEV Community

Discussion on: Using Mochawesome Reporter with Cypress

Collapse
 
tejkumar profile image
Tejkumar Kempaiah • Edited

Hi All,

I'm getting merge error for mochawesome reports, Please suggest the solution

ERROR: Failed to merge reports

Error: Pattern cypress/reports/mocha/*.json matched no report files

Here is my package.json file:

{
"name": "Project1",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"clean:reports": "mkdir cypress\reports\ && mkdir cypress\reports\mocha\ && mkdir cypress\reports\mochareports\ ",
"pretest": "npm run clean:reports",
"scripts": "cypress run --spec 'cypress/integration/CafeTownSend/' --headless",
"merge-report": "mochawesome-merge cypress/reports/mocha/.json > cypress/reports/report.json",
"generate-report": "marge cypress/reports/mochareports/report.json -f report -o cypress/reports/mochareports",
"posttest": "npm run merge-report && npm run generate-report",
"test": "npm run scripts || npm run posttest"
},
"keywords": [],
"author": "Tejkumar Kempaiah",
"license": "ISC",
"devDependencies": {
"cy-verify-downloads": "0.0.4",
"cypress": "^8.1.0",
"cypress-downloadfile": "^1.2.1",
"cypress-file-upload": "^5.0.8",
"cypress-iframe": "^1.0.1",
"cypress-plugin-tab": "^1.0.5",
"cypress-xpath": "^1.6.2",
"mocha": "^9.0.3",
"mochawesome": "^6.2.2",
"mochawesome-merge": "^4.2.0",
"mochawesome-report-generator": "^5.2.0"
}
}

Here is my cypress.json file:

{
"projectId": "18xfp2",
"$schema": "on.cypress.io/cypress.schema.json",
"env": {
"appurl": "trytestingthis.netlify.app/",
"username": "test",
"password": "test"
},
"watchForFileChanges": false,
"defaultCommandTimeout": 10000,
"pageLoadTimeout": 1000,
"baseUrl": "skpatro.github.io/demo/signup/",
"chromeWebSecurity": false,
"reporter": "mochawesome",
"reporterOptions": {
"files": "mochawesome-report",
"overwrite": false,
"html": false,
"json": true
}
}