Getting started with Accessibility Testing in Sauce Labs

By now you’ve noticed the availability of Accessibility testing alongside other quality metrics provided by Sauce Labs. This is the result of a partnership between Sauce Labs and Deque Systems, the trusted leader in digital accessibility.

Getting Started

Testing Technology

Sauce Labs and Deque support many of the same testing technologies, making the addition of Accessibility testing to your existing tests simple!

For this guide we’ll focus on WebdriverIO

The first thing we’ll need is just one dependency for our Accessibility (or a11y) tests, shown below:

As well as the saucelabs service which you likely already have in your project:

The next step will be making sure our configuration file for SauceLabs contains the required browser configurations (as well as our API key. You’ve likely already worked with a file like this, and more information can be found in the SauceLabs documentation, just remember that you’ll need your API key, as well as your desired region (see below)

In this wdio.conf file we have created an axeWdio object that creates a new AxeWebdriverIO instance which will take the current browser (or client) object from WDIO. This allows axe-core to be injected into the current page, and when analyze() is called, axe-core then will scan the current page content.  There are many ways to do this and we encourage you to get creative. It is perfectly fine to scan the entire page as  you get accustomed to working with the a11y results, but you may want to go further later; specifically with end-to-end tests that modify the state or the UI. For now I’ll keep it simple and show you this function:

Now anywhere in my actual tests, all I have to do is call