Accessibility Testing
In one line
Accessibility testing ensures your app works with screen readers, keyboard-only navigation, and meets WCAG standards for users with disabilities.
In simple words
Accessibility (a11y) testing ensures your application is usable by everyone, including people with disabilities. It's both a moral imperative and a legal requirement (ADA, WCAG).
What accessibility testing checks:
- Screen reader support — semantic HTML, ARIA labels, alt text
- Keyboard navigation — all interactive elements reachable via Tab key
- Color contrast — text/background contrast meets WCAG ratios (4.5:1 for normal text)
- Focus management — visible focus indicators, logical tab order
- Form labels — every input has an associated label
- Heading hierarchy — h1 → h2 → h3, no skipped levels
- Dynamic content — ARIA live regions for screen reader announcements
WCAG levels:
- A — minimum (must support)
- AA — standard (should support, legal requirement in many countries)
- AAA — enhanced (nice to have)
Tools: axe-core, Lighthouse, WAVE, Pa11y, Storybook a11y addon. Manual testing with screen readers (NVDA, VoiceOver) is also essential.
Example
// axe-core accessibility test with Jest
import { configureAxe } from 'jest-axe';
import { render } from '@testing-library/react';
import MyComponent from './MyComponent';
const axe = configureAxe({
rules: {
'color-contrast': { enabled: true },
},
});
test('MyComponent has no accessibility violations', async () => {
const { container } = render(<MyComponent />);
const results = await axe(container);
expect(results).toHaveNoViolations();
});
// Playwright + axe
import { injectAxe, checkA11y } from 'axe-playwright';
test('homepage is accessible', async ({ page }) => {
await page.goto('https://example.com');
await injectAxe(page);
await checkA11y(page, null, {
detailedReport: true,
});
});axe-core scans the DOM for WCAG violations. Automated tests catch ~40% of issues — manual testing with screen readers is still essential for full coverage.
Common confusions
Confused with: responsive testing
The difference: Accessibility testing ensures the app is usable by people with disabilities (screen readers, keyboard, contrast). Responsive testing ensures the app works on different screen sizes (mobile, tablet, desktop). They're related but different concerns — an app can be responsive but inaccessible, or accessible but not responsive.
Related terms
Related Resources
Related Lessons
- UI Testing
Accessibility testing.
Decode error messages
Plain-English explanations of common errors — what they mean, why they happen, and how to fix them.