Skip to content

Latest commit

 

History

History
 
 

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

example: a11y

Testing component accessibility

npm install
npm run cy:open
# or just run headless tests
npm test

Testing components following the React accessibility guide using cypress-axe plugin.

See the spec file cypress/component/spec.js. For example, an <input> without a label is caught:

mount(<input type="text" value="John Smith" name="name" />)
cy.checkA11y('input', {
  runOnly: {
    type: 'tag',
    values: ['wcag2a'],
  },
})

Input without a label

You can click on the error to see more details in the DevTools console

Error details