Accessibility Testing

Learn about accessibility testing features within leading JavaScript automation frameworks.

Each website these days must adhere to the strict accessibility requirements defined by Web Content Accessibility Guidelines (WCAG) and other bodies. Enabling people with various disabilities to consume data on websites and perform all available transactions is a mandatory requirement. So, designing a web application for accessibility and testing for it is a key requirement for each software iteration. For web accessibility testing, Deque has developed the widely adopted axe open-source framework, which most test automation frameworks today support through APIs and plugins.

Cypress accessibility testing

Most frameworks utilize the axe framework for checking website accessibility issues. The axe library provides us with the following useful methods:

  • cy.injectAxe()

  • cy.configureAxe()

  • cy.checkA11Y()

Running our test code in JavaScript or TypeScript with the axe plugin will generate a detailed A11Y accessibility test report, which will be available on both the Cypress GUI dashboard as well as within the local test report. We should then analyze and resolve all violations.

Puppeteer accessibility testing

Google Puppeteer can also leverage the axe framework to run accessibility tests on web applications. This axe-puppeteer will add the AxePuppeteer(page).analyze() method, which can be used to run a scan on a given page and report back the results.

Get hands-on with 1200+ tech skills courses.