SPACEBAR to move forward through slides.
SHIFT & SPACEBAR to move backwards through slides.
LEFT ARROW & RIGHT ARROW to move through sections.
ESC to see overview and ESC again to exit.
F to enter presentation mode and ESC to exit.
Because I am presenting from Australia, I’d like to acknowledge the Traditional Owners of the lands on which I’m presenting today, the Cammeraygal people.
I’d also like to pay my respects to Elders past and present, and to all First Nations people who may be present or watch a recording of this session.
I’d like this session to be interactive, so feel free to add any comments or questions into chat at any time!
Part of my role over the years has focussed on helping teams build and test a wide range of UI components.
The term ‘components’ (sometimes referred to as widgets) means any self-contained UI concept.
I mainly focussed on components that involved user interaction.
This could mean simple components such as:
But most of my time was spent on complex components such as:
In the earlier days, I would conduct basic accessibility testing on each component, but there were some underlying problems in my approach.
My testing process lacked rigour, and I did not provide detailed documentation of my test results.
At one point, a manager asked me the following question:
Are all the components in the design system accessible? Can you guarantee it?
This was a wake-up call that led my to change the way I tested and documented components.
For this presentation, I’ll share how I conducted ‘accessibility unit testing’ on individual components.
As we’ll see a bit later, this process can also help when designing or developing new components.
‘accessibility unit testing’ is a process where the smallest parts of a component are individually and independently evaluated.
The aim of accessibility unit testing is not to make broad, sweeping statements such as ‘this component is accessible’.
Instead, the aim is to test the accessibility of all aspects of the component.
This process provides teams with a detailed understanding about all possible accessibility issues associated with the component.
Accessibility unit testing is typically conducted when reviewing:
Accessibility unit tests are often based on two concepts:
1. How all aspects of the component are presented to users - either on screen or via assistive technologies.
2. How users should be able to interact with the component to complete all relevant tasks.
These tests must include all possible happy and unhappy paths associated with the component.
A happy path is the error-free path users take to complete a task.
An unhappy path is where users may encounter errors or issues that stop them from completing the task.
Let’s use an example of a date picker - one of the most painful components ever conceived!
A high-level task might be something like:
The user can successfully add a date using the date picker.
But numerous small interactions associated with this overall task should be tested.
And there are different methods that people use to achieve these interactions - mouse, keyboard, assistive technologies etc.
Each of these needs to be defined as a test.
For example, what tests would be needed to determine if the date picker overlay could be closed via keystrokes only?
The ESC key can be used to close the date picker overlay: PASS/FAIL
When the ESC key is triggered, focus returns to the date field: PASS/FAIL
These are two separate tests, because a date picker may allow users to close the the overlay using ESC, but send focus to the wrong location.
An unhappy path could be where the date-picker question is required, but the user does not enter a date value for the field.
What tests would be needed to determine if users could identify the field as required before deciding whether to enter data?
A visual means of identifying that the field is required is present: PASS/FAIL
Users can programmatically determine that the field is required (e.g. via required
or aria-required="true"
): PASS/FAIL
And what tests would be needed to determine if the field is accessible once it is in a state of error?
The form field uses methods other than colour alone to visually identify that it is in a state of error: PASS/FAIL
When the field is in a state of error, an error message is presented on screen: PASS/FAIL
The error message provides advice on how to fix the problem: PASS/FAIL
The error message is presented in close proximity to the field in a state of error: PASS/FAIL
The error message is programmatically associated with the field (e.g. as part of the <label>
or via aria-describedby
): PASS/FAIL
As you can see, every test must be written as a statement where the only outcome is either a pass or a fail.
Tests do not have to be tasks. A test may relate to how aspects of the component are presented to users.
Each test must be repeatable so that it can be re-tested at a later date.
These tests may need to be performed in complex combinations of different assistive technologies, browsers and operating systems.
Each of these different test combinations must be documented separately.
The end result should be a document that defines the following:
Let’s look at an example of an autocomplete component from the last design system I worked on.
(I’m going to open a strange spreadsheet now).
Before we look at how to create these tasks, any questions or comments?
How could you create a complex series of tests for any component?
You can start by looking at different groups of people and their needs.
This means you can focus on one user type and explore how they may need to interact with the component.
These groups of people could include:
For each group, there are some high levels questions that can be asked for any component to help determine possible tests.
Does the component:
Sometimes, these people may need to customise the user interface or magnify the display.
Is the component operable/understandable:
Sometimes, these people may rely on keyboard interactions or voice recognition software.
These people may rely on screen reader software.
The next step is to break down each question into a series of individual tests.
In some cases, the question can almost become the test. For example:
Does the component have an accessible name?
The component provides an accessible name: PASS/FAIL
The accessible name is meaningful (e.g. describes the purpose of the element): PASS/FAIL
In other cases, you may need multiple tests associated with a question. For example:
Can all actions be executed using keystrokes only?
This question may need a wide range of individual tests, depending on the complexity of the component.
Let’s dive a bit deeper into tests that could be used to determine the accessibility of a date picker.
For simplicity, we will focus on people with limited mobility.
How would someone who uses a keyboard-only need to interact with this component?
The user can manually enter a date without using the date picker overlay: PASS/FAIL
The user can navigate to the date picker icon: PASS/FAIL
The user can trigger the date picker overlay using ENTER and SPACEBAR: PASS/FAIL
When the date picker icon is triggered, focus moves to the date picker overlay: PASS/FAIL
But which part of the date picker overlay should receive focus?
You may need to do a lot of testing before deciding on the best solution.
Ideally, you should also test with real users to find out their preferences and expectations.
This is not a significant issue for keyboard users but becomes very important for screen reader users as they require additional context!
The users can navigate through dates using all variations of ARROW keys: PASS/FAIL
The users can navigate to previous or next month dates using all variations of ARROW keys: PASS/FAIL
The user can select a date using ENTER and SPACEBAR: PASS/FAIL
When a date is selected, the date picker overlay closes: PASS/FAIL
When a date is selected, focus returns to the form field: PASS/FAIL
When focus returns to the form field, the chosen date is injected into the field: PASS/FAIL
The user can TAB to the ‘Close’ button: PASS/FAIL
When the ‘Close’ button is selected, focus returns to the form field: PASS/FAIL
The user can close the date picker overlay using the ESC key: PASS/FAIL
When the ESC key is trigged selected, focus returns to the form field: PASS/FAIL
The user can TAB to the previous and next month buttons: PASS/FAIL
When the previous or next buttons are triggered, the Month title and date table updates: PASS/FAIL
These are just some examples of unit tests that could be conducted using keyboard-only.
We could then use the same process for other uses, such as ‘People with limited or no sight’.
Screen readers must be given additional context for each interaction - name, role, states, values etc.
The names and roles must also clearly define the purpose of the element.
I always run keyboard-only tests before screen reader tests, as screen reader users need the same basic functionality with additional criteria.
We need to determine if each test can be conducted using a single browser or if multiple browsers are required.
We also need to determine if any assistive technologies are required for any tests and if these need to be conducted across multiple browser options.
We can then create a testing spreadsheet and begin testing!
As mentioned earlier, this overall concept can also be used to help design and development new components:
Teams can ask themselves the following three questions:
1. What different types of users may interact with the component.
2. How are all aspects of the component presented to these users?
3. What are all the ways that these users may need to interact with the component to complete a task?
If these three questions are considered, you are much more likely to have an accessible component!
And finally, try to include a diverse range of real users as part of the design and development process!