VOOZH about

URL: https://thenewstack.io/a-workflow-for-component-based-accessibility-testing/

⇱ A Workflow for Component-Based Accessibility Testing - The New Stack


TNS
SUBSCRIBE
Join our community of software engineering leaders and aspirational developers. Always stay in-the-know by getting the most important news and exclusive content delivered fresh to your inbox to learn more about at-scale software development.
REQUIRED
It seems that you've previously unsubscribed from our newsletter in the past. Click the button below to open the re-subscribe form in a new tab. When you're done, simply close that tab and continue with this form to complete your subscription.
The New Stack does not sell your information or share it with unaffiliated third parties. By continuing, you agree to our Terms of Use and Privacy Policy.
Welcome and thank you for joining The New Stack community!
Please answer a few simple questions to help us deliver the news and resources you are interested in.
REQUIRED
REQUIRED
REQUIRED
REQUIRED
REQUIRED
Great to meet you!
Tell us a bit about your job so we can cover the topics you find most relevant.
REQUIRED
REQUIRED
REQUIRED
REQUIRED
REQUIRED
Welcome!

We’re so glad you’re here. You can expect all the best TNS content to arrive Monday through Friday to keep you on top of the news and at the top of your game.

What’s next?

Check your inbox for a confirmation email where you can adjust your preferences and even join additional groups.

Follow TNS on your favorite social media networks.

Become a TNS follower on LinkedIn.

Check out the latest featured and trending stories while you wait for your first TNS newsletter.

PREV
1 of 2
NEXT
VOXPOP
As a JavaScript developer, what non-React tools do you use most often?
Angular
0%
Astro
0%
Svelte
0%
Vue.js
0%
Other
0%
I only use React
0%
I don't use JavaScript
0%
Thanks for your opinion! Subscribe below to get the final results, published exclusively in our TNS Update newsletter:
NEW! Try Stackie AI
From clobbered drafts to real-time sync
Apr 14th 2026 10:00am, by David Moore
TypeScript 6.0 RC arrives as a bridge to a faster future
Mar 14th 2026 9:00am, by Darryl K. Taft
Mastra empowers web devs to build AI agents in TypeScript
Jan 28th 2026 11:00am, by Loraine Lawson
2023-05-18 07:28:35
A Workflow for Component-Based Accessibility Testing
Software Development / Software Testing

A Workflow for Component-Based Accessibility Testing

If each component is accessible, then the site as a whole will be pretty close to accessible as well.
May 18th, 2023 7:28am by Navin Thadani
👁 Featued image for: A Workflow for Component-Based Accessibility Testing
Components are a significant force in software development now, but can you use them in conjunction with accessibility testing? The answer is probably yes. Here’s an approach that’s worth trying.

Before You Start: The Five-Minute Rule

Before we walk you through the workflow, let’s address a particular digital-accessibility elephant in the room: the need for speed. One common concern about building accessibility tests into a development process is that adding accessibility scans will bog things down and make it harder to reach release goals. A solid strategy to avoid that is to create a company policy requiring feedback within five minutes. For a product or workflow to pass muster, developers must receive feedback from unit, functional and accessibility tests within five minutes of submitting a pull request. This time frame allows the developer to meet release velocity needs, easily maintain context and keep frustration low.

Benefits of Component Libraries and Design Tools

We believe that a component-based approach is intrinsically faster. These five benefits make components and component libraries an ideal match for testing:
  1. Feedback clarity. Tests created for individual components are inherently both short and atomic by design. Atomic tests validate a single feature or function. For example, if an atomically designed test for, say, a website’s search functionality fails, one can be confident that it is the actual search functionality that is broken, not a problem in the setup or teardown step of a longer flow.
  2. Short and stable tests. If we’re trying to get developers near-immediate feedback, it helps to have short tests that are more stable and run quickly. Should a commit introduce a bug, you’d want to know immediately, not a few hours later!
  3. Less noise. Teams always strive to reduce noise, obtain clear results and make interpreting results easier. If component testing can be disconnected from needing a server-side API or any external resources, that will help.
  4. Efficient error-state setup. With a component library, an error state can be loaded quickly and tested with no setup or teardown steps required, dramatically reducing test execution times. Whereas within a full staging environment a user must automate a flow to drive the application to a particular state. For example, to verify that an error message appears correctly, a tester must load the site, navigate to the appropriate page and trigger the error before checking the assertion criteria. This process takes too long.
  5. Fast local connections. When using a component library for testing, all connections are local, which means no more waiting to log in, or worrying about internet connection or back-end bugs.
What’s more, a component-based approach to testing is especially powerful when considering digital accessibility. Why? Because if each component is accessible, then the site as a whole will be pretty close to accessible as well.

Workflow Details

Consider using something like Storybook to manage components and their various states. That way, you can create a static website that contains all different components and is rendered in isolation, offering a distinct advantage over traditional staging environments. 👁 Image
Now, let’s look at workflow details with respect to test design, build process, gating and interpreting results.

Test Design

For functional and accessibility testing at the same time, you’ll need a test framework, like Cypress, and some kind of accessibility test SDK. Once installed, it’s easy to add accessibility scans to your functional test. For example, using Cypress and the Evinced Automation SDK, you would simply add the `cy.evStart()` and `cy.evStop()` commands to the before and after hooks of each test:
//...
describe('EvTextInput Component', () => {
 	describe.only('Enabled buttons', () => {
 	beforeEach(() => {
 	 	cy.evStart();
 	});
 	afterEach(() => {
 	 	cy.evStop().then((results) => {
 	 expect(results.length).to.be.equal(0);
 	});
 	});
 	// Enabled buttons
 		it(`${PATHS.ENABLED.ACTION} test`, () => {
 	 clickAndValidate(PATHS.ENABLED.ACTION, false);
 	});
 		it(`${PATHS.ENABLED.CUSTOM} test`, () => {
 	 clickAndValidate(PATHS.ENABLED.CUSTOM, false);
 	});
 	 	it(`${PATHS.ENABLED.ICON} test`, () => {
 	 clickAndValidate(PATHS.ENABLED.ICON, false);
 	
 	//More tests...
As an extra benefit, some accessibility automation SDKs use a kind of continuous flow technology that scans state changes and dynamically loads elements and DOM changes for any accessibility issues resulting from the test’s interaction with the component.

Build Process

Consider integrating a CI/CD system, like CircleCI. Then each time a developer pushes code, the CI/CD system listens for new branches and runs several checks before marking a pull request as safe to merge. These include linting, unit tests, functional tests and accessibility checks. Make sure all of these checks are kicked off in parallel to minimize execution time and ensure developers get feedback as quickly as possible.

Gating and Assertions

It’s very helpful if your accessibility testing SDK supports gating. For example, a test could fail if a new critical accessibility issue is detected, or whatever logic your organization finds most appropriate. In the example below, from the Evinced Automation SDK, the assertion is expecting to see no critical issues after the scan has been completed.
afterEach(() => {
 	cy.evStop().then((results) => {
 	 expect(report.every(validation => validation.severity.name !== 'Critical')).to.be.true;
 	});
Now that we have access to the results object, any number of assertions is possible, depending on the flexibility of your automation SDK. You could potentially assert based on the number of issues, issue type, issue severity, Web Content Accessibility Guideline (WCAG) tag or even specific element.

Interpreting Results

When an issue is discovered, the report from your automation SDK should contain everything needed to resolve the issue quickly. This includes the issue description, element locator, broken DOM snippet, WCAG success criteria and recommended fixes. The atomic nature of component testing ensures that issue reports are easily tracked directly to the component being tested.

Summary

Your mileage may vary, but components might be an essential way to build accessibility into your development flow. It’s a way to “shift left” on accessibility, resulting in a faster, cleaner, more accessible product, especially between audits. That’s a win everybody should have.
TRENDING STORIES
SHARE THIS STORY
TRENDING STORIES
SHARE THIS STORY
TRENDING STORIES
TNS DAILY NEWSLETTER Receive a free roundup of the most recent TNS articles in your inbox each day.
The New Stack does not sell your information or share it with unaffiliated third parties. By continuing, you agree to our Terms of Use and Privacy Policy.