Skip to main content

accessibility

@ensono-stacks/cypress:accessibility

Adds axe accessibility tests to your test project

The accessibility generator installs the required plugins for conducting accessibility testing with cypress. Additionally, this will configure your test project to enable proper test reporting from axe while providing you with an example set of test cases.

Usage

nx g @ensono-stacks/cypress:accessibility

Command line arguments

The following command line arguments are available:

OptionDescriptionType
--project -pThe name of the test project to add accessibility tests tostring

Generator Output

Scaffolding accessibility testing will add two dependencies to the package.json:

  1. axe-core - The accessibility test engine
  2. cypress-axe - Cypress integration with the accessibility test engine

Additionally, an example accessibility test will be generated, showcasing how to utilise axe to scan your application for accessibility violations:

Generated files
.
├── apps
│ ├── <app-name>
│ │ ├── cypress
│ │ │ │ ├── support
│ │ │ │ │ ├── e2e.ts #Terminal logging function configured
│ │ │ │ ├── e2e
│ │ │ │ │ ├── axe-accessibility.cy.ts #Example accessibility test using cypress
│ │ ├── cypress.config.js #setupNodeEvents configured for logging with terminal logging function
├── tsconfig.cy.json #cypress-axe declared as a type
└──────────
note

Visit the Accessibility Testing documentation for further details!