Question
cypress-axe Test Runner Reporting Lacks Structured Violation Details
Zo Moss
0 reputation · 02 Aug 2023, 19:27 UTC
141K views0
Context
Cypress delegates accessibility auditing to the cypress-axe plugin, which wraps axe-core. The standard workflow requires calling cy.injectAxe() once per test context before invoking cy.checkA11y() against the current DOM state. While the command executes and surfaces violations, the Test Runner presents them as generic assertion failures rather than structured, filterable reports.
Constraints
- Accessibility testing is not part of the core Cypress installation; it depends on a community-maintained plugin.
- Large DOM trees cause noticeable performance degradation during
cy.checkA11y()execution. - Only programmatic WCAG violations are detected; logical flow and screen-reader behavior require manual verification.
Open Questions
- Is there a supported pattern to transform the raw
axe-coreresults into a structured Cypress custom command that surfaces rule IDs, impact levels, and affected nodes in the command log? - Can the plugin’s
terminalorverboseoptions be configured globally to avoid per-call boilerplate while preserving detailed output? - Are there plans to integrate a native accessibility reporting interface in Cypress that would supersede the current plugin-dependent approach?