Trying to make axe work can contain surprises. But let’s start at the beginning. Installation and basic usage. Quickly.
Note: relevant for the latest (v10+) Cypress. Cypress 10 was a major upgrade.
npm install --save-dev cypress axe-core
Add the import statement in the
e2e.js support file:
In your test
visit command has to come first, then you can use:
(You can read more about axe configuration here.)
Error message: axe.run arguments are invalid.
null as an additional argument:
YAY! It works! Magic.