Skip to main content

accessibility

@ensono-stacks/playwright:accessibility

Adds axe accessibility tests to your test project

The accessibility generator installs @axe-core/playwright and configures an example accessibility test

Usage

nx g @ensono-stacks/playwright: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/playwright - The accessibility test engine
  2. axe-result-pretty-print - Result formatter

Additionally, an example accessibility test will be generated, showcasing how to utilise both axe and axe-result-pretty-print to scan your application for accessibility violations:

Generated files
.
├── apps
│ ├── <app-name>-e2e
│ │ ├── src
│ │ │ ├── axe-accessibility.spec.ts #Example accessibility test using playwright
└──────────
note

Visit the Accessibility Testing documentation for further details!