A simple HTML report generator for the Cypress tests
npm install cypress-html-reporterA simple Cypress HTML reporter. Generates an HTML report at the end of the test execution.
(Works only for Cypress ver. 13.4 and above)
``bash`
npm install cypress-html-reporter --save
`python
const { defineConfig } = require("cypress");
module.exports = defineConfig({
retries: {
runMode: 1
},
e2e: {
video: true,
setupNodeEvents(on, config) {
// implement node event listeners here
require('cypress-html-reporter/GenerateReport')(on, config)
},
},
});
`
Once the test execution is done, start the report server.
(Create a .js file at the project root directory and run following command.)
`bash``
const startServer = require('cypress-html-reporter/StartServer')
startServer()
This will host the report server (embedded screenshots/video links are blocked by the browser hence this is necessary). Navigate to http://127.0.0.1:8080/ in the browser.
Sample report screenshot can be found at:
https://github.com/rk508501/CypressReporter/blob/main/assets/Sample_Report.png