sa11y

Salesforce Accessibility Automation Libraries

Automated Accessibility Testing Libraries and Tools (@sa11y packages) based on axe-core providing support for Jest unit tests, Vitest unit tests, WebdriverIO component/integration tests used by teams in Salesforce. However, they are not specific to Salesforce and can be used to test any UI supported by axe-core for accessibility. These libraries are designed to be flexible, customizable and reusable to support automated accessibility testing in different testing workflows from unit to integration tests.

Sa11y Code Coverage semantic-release License NPM downloads per month of @sa11y/common package Known Vulnerabilities OpenSSF Scorecard

Docs

References

Canary releases

To try changes from an open pull request before they are merged and released, e.g. to check a fix in your project, use a canary release: a test build of all public @sa11y/* packages published from the PR.

  1. Comment canary on the PR. Only maintainers (people with write access to this repo) can trigger a canary, so ask one to do it if you can’t. PRs from forks are not supported.
  2. CI tests the PR and publishes the packages to npm with the canary tag. Once they can be installed, usually within about 10 minutes, a bot replies on the PR with the version, e.g. 8.2.1-canary.57.1.gd39f94e.
  3. Install that exact version in your project:

     yarn add -D @sa11y/jest@8.2.1-canary.57.1.gd39f94e
     # or
     npm install -D @sa11y/jest@8.2.1-canary.57.1.gd39f94e
    

    Use the same version for every @sa11y package your project depends on. The @sa11y packages they depend on are installed at that version too.

Packages

This repo contains the following packages for automated accessibility testing:

Jest integration

published npm version of @sa11y/jest node-current (scoped)

Screenshot showing Sa11y Jest API usage and a11y errors showing up in VSCode

Vitest integration

published npm version of @sa11y/vitest node-current (scoped)

WDIO integration

published npm version of @sa11y/wdio node-current (scoped)

Screenshot showing a11y errors from a test using Sa11y WDIO in a terminal

assertAccessible API

published npm version of @sa11y/assert node-current (scoped)

a11y results formatter

published npm version of @sa11y/format node-current (scoped)

Preset accessibility rules

published npm version of @sa11y/preset-rules node-current (scoped)

Core accessibility matcher

published npm version of @sa11y/matcher node-current (scoped)

Minified bundle for testing in browser

published npm version of @sa11y/browser-lib node-current (scoped)

Internal packages

Test utilities

Integration Tests

Common utilities


Epilogue

A wise person once said…

“Don’t talk to me until I’ve had coffee and you’ve run axe”

Embroidery that says "Don't talk to me until I've had coffee and you've run axe" in a hoop

(Image courtesy: @shleewhite, @jorycunningham)