I have a little web app called Gametime I use to keep track of players during youth soccer matches. Recently I decided to add a11y testing to ensure the text is readable, inputs have labels, etc. Since I already had Cypress end-to-end tests covering all features of the app, I just needed 60 seconds to ensure the web app is accessible to everyone.
Install the wick-a11y plugin
First, let's install wick-a11y plugin.
1 | npm i -D wick-a11y |
Register the plugin's tasks in the Cypress config file
1 | import { defineConfig } from 'cypress' |
Include the plugin's custom commands by importing it from the support file loaded by the browser
1 | // https://github.com/sclavijosuero/wick-a11y |
That's it. Now I can confirm the page is accessible by calling cy.checkAccessibility() command.
Check a11y
Let's confirm the Teams page works for everyone. I simply add the accessibility command at the end of the test
1 | it('enables Add button when typing the name', () => { |
Right away it shows 1 critical problem: the text "Zero players" has a color that is hard to read on white background.

You can get the error details by clicking on the "Fixme" log line in the Command Log

The fix is simple: use a darker gray color class
1 | <div |
Note: this plugin by default checks. If you want to see lower severity errors, enable them when running the command; could be verbose at first.
1 | cy.checkAccessibility(undefined, { |
Our page is missing <main> landmark (and other landmarks, like <footer>), so we get several warnings, highlighted in yellow

Detailed reports
This plugin generates detailed static HTML reports (which you can control). Open the report file from cypress/accessibility folder. Each error has a separate section, showing the HTML snapshot with offending element.

I suggest saving cypress/accessibility folder as a test artifact on your CI. If the cy.checkAccessibility command fails, these reports will make fixing it a breeze.