Back to Browse

Cypress Beginner Tutorial 11 | HTML Reports | Solution - Unexpected token � in JSON at position 0

30.4K views
Nov 23, 2021
37:18

Cypress Quiz - https://automationstepbystep.com/quiz-time/ Cypress Udemy Course - https://bit.ly/3wJAdjq 1. How to install mochawesome reporter 2. How to configure the reporter 3. How to merge multiple JSON report files 4. How to generate a single HTML report 5. Troubleshooting issues like Unexpected token � in JSON at position 0 Unexpected end of JSON input 6. Run reports command automatically using pretest and posttest scripts in package.json Step 1 - Install mochawesome library npm install mochawesome --save-dev Step 2 - Install mochawesome-merge library npm install mochawesome-merge --save-dev Step 3 - Add reports configuration in cypress.json { "reporter": "mochawesome", "reporterOptions": { "charts": true, "overwrite": false, "html": false, "json": true, "reportDir": "cypress/report/mochawesome-report" } } Step 4 - Run command to execute tests npx cypress run --reporter mochawesome Step 5 - Run command to merge multiple json reports into one npx mochawesome-merge cypress/report/mochawesome-report/*.json > cypress/report/output.json npx mochawesome-merge cypress/report/mochawesome-report/*.json | out-file -encoding ascii cypress/report/output.json Step 6 - Run command to generate html report npx marge cypress/report/output.json --reportDir ./ --inline Add report generation commands in package.json scripts pretest test posttest #CypressBeginnerTutorials Stories by Raghav - https://automationstepbystep.com/stories/ You can support my mission for education by sharing this knowledge and helping as many people as you can If my work has helped you, consider helping any animal near you, in any way you can To save cows - https://radhasurabhi.com/donate/ Never Stop Learning Raghav https://automationstepbystep.com/

Download

0 formats

No download links available.

Cypress Beginner Tutorial 11 | HTML Reports | Solution - Unexpected token � in JSON at position 0 | NatokHD