11.0.0 • Published 6 months ago
cypress-html-reporter v11.0.0
cypress-html-reporter
A simple Cypress HTML reporter. Generates an HTML report at the end of the test execution. (Works only for Cypress ver. 13.4 and above)
Installation
npm install cypress-html-reporter --save
Usage
Add the following to the cypress.config.ts/js file:
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.)
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