Cypress-Axe reporter that outputs accessibility violations in a HTML format.
Installations
npm install cypress-axe-reporter
Developer Guide
Typescript
No
Module System
CommonJS
Min. Node Version
>=14
Node Version
18.12.1
NPM Version
9.8.1
Score
70.5
Supply Chain
97.4
Quality
89.9
Maintenance
100
Vulnerability
98.9
License
Contributors
Unable to fetch Contributors
Languages
JavaScript (94.73%)
SCSS (5.27%)
Love this project? Help keep it running — sponsor us today! 🚀
Developer
Download Statistics
Total Downloads
924
Last Day
2
Last Week
85
Last Month
346
Last Year
924
GitHub Statistics
MIT License
65 Commits
1 Watchers
6 Branches
1 Contributors
Updated on Feb 13, 2025
Bundle Size
451.00 B
Minified
271.00 B
Minified + Gzipped
Package Meta Information
Latest Version
1.1.5
Package Id
cypress-axe-reporter@1.1.5
Unpacked Size
1.11 MB
Size
181.69 kB
File Count
12
NPM Version
9.8.1
Node Version
18.12.1
Published on
Feb 13, 2025
Total Downloads
Cumulative downloads
Total Downloads
924
Last Day
-33.3%
2
Compared to previous day
Last Week
608.3%
85
Compared to previous week
Last Month
-40.1%
346
Compared to previous month
Last Year
0%
924
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
cypress-axe-reporter
Cypress-Axe reporter that outputs accessibility violations in a HTML format.

Setup
This setup tutorial works with Cypress >= v10, and Cypress-Axe >= v1.5.0
-
install cypress-axe-reporter
npm i --save-dev cypress-axe-reporter
or
yarn add -D cypress-axe-reporter
-
Change cypress reporter & setup hooks
Edit config file (
cypress.config.js
by default)1const { defineConfig } = require("cypress"); 2 3module.exports = defineConfig({ 4 reporter: "cypress-axe-reporter", 5 e2e: { 6 setupNodeEvents(on, config) { 7 require("cypress-axe-reporter/plugin")(on); 8 }, 9 }, 10});
If you are to override
before:run
orafter:run
hooks, use this:1const { defineConfig } = require("cypress"); 2const { beforeRunHook, afterRunHook } = require("cypress-axe-reporter/lib"); 3 4module.exports = defineConfig({ 5 reporter: "cypress-axe-reporter", 6 e2e: { 7 setupNodeEvents(on, config) { 8 on("before:run", async (details) => { 9 await beforeRunHook(details); 10 }); 11 12 on("after:run", async (results) => { 13 await afterRunHook(results); 14 }); 15 }, 16 }, 17});
-
Add to
cypress/support/e2e.js
1import "cypress-axe-reporter/register";
-
Specify
cy.cypressAxeReporterCallBack
as the violationCallback argument1it("check for violations", () => { 2 cy.checkA11y(null, null, cy.cypressAxeReporterCallBack); 3});
-
Run cypress
Custom options
If you want to customize your HTML report, add the desired flags to reporterOptions
1const { defineConfig } = require("cypress"); 2 3module.exports = defineConfig({ 4 reporter: "cypress-axe-reporter", 5 reporterOptions: { 6 reportDir: "cypress/report-folder/", 7 }, 8 e2e: { 9 setupNodeEvents(on, config) { 10 require("cypress-axe-reporter/plugin")(on); 11 }, 12 }, 13});
CLI Flags
Flag | Type | Default | Description |
---|---|---|---|
--reportFilename | string | accessibility-report | Filename of saved report. |
--reportDir | string | [cwd]/reports/ | Path to save report |
--reportTitle | string | Accessibility Report | Report title |
--reportPageTitle | string | Accessibility Report | Browser title |
--saveJson | boolean | false | Should report data be saved to JSON file |
--saveHtml | boolean | true | Should report be saved to HTML file |
--includeSummary | boolean | false | Should report include count of all violations found violations |

No vulnerabilities found.

No security vulnerabilities found.