Why Accessibility Testing Matters
Web accessibility (often abbreviated as a11y) ensures that people with disabilities can perceive, understand, navigate, and interact with websites. This includes people who are blind or have low vision, deaf or hard of hearing, have motor disabilities, cognitive disabilities, or temporary impairments.
Accessibility is not optional for QA:
- Legal requirement — Laws like the ADA (US), EAA (EU), and AODA (Canada) mandate web accessibility
- Business impact — 15-20% of the global population has some form of disability
- SEO benefit — Many accessibility practices improve search engine optimization
- Quality indicator — Accessible sites tend to be better-structured and more robust overall
WCAG 2.2 Overview
WCAG is organized around four principles (POUR):
Perceivable
Content must be presentable in ways users can perceive:
- Text alternatives for images (alt text)
- Captions for video/audio
- Content adaptable to different presentations
- Sufficient color contrast
Operable
Interface must be navigable and operable:
- All functionality available via keyboard
- Enough time to read and interact
- No content that causes seizures
- Clear navigation and wayfinding
Understandable
Content and interface must be understandable:
- Readable text
- Predictable behavior
- Input assistance (error identification, labels)
Robust
Content must work with current and future technologies:
- Valid HTML
- Proper ARIA usage
- Compatible with assistive technologies
Conformance Levels
| Level | Description | Typical Requirement |
|---|---|---|
| A | Minimum accessibility | Rarely sufficient |
| AA | Standard compliance | Most legal requirements |
| AAA | Enhanced accessibility | Specific contexts only |
Most organizations target WCAG 2.2 Level AA.
Manual Testing Techniques
Keyboard Navigation Testing
The most impactful manual test you can perform:
- Put your mouse aside. Navigate the entire page using only the keyboard.
- Tab through all interactive elements. Can you reach every link, button, form field, and menu?
- Check focus visibility. Is there a visible focus indicator on the currently focused element?
- Test keyboard traps. Can you Tab into and out of modals, dropdowns, and embedded content?
- Verify logical tab order. Does focus move in a logical reading order (left to right, top to bottom)?
| Key | Expected Action |
|---|---|
| Tab | Move to next interactive element |
| Shift+Tab | Move to previous interactive element |
| Enter | Activate links and buttons |
| Space | Toggle checkboxes, activate buttons |
| Arrow keys | Navigate within menus, radio groups, tabs |
| Escape | Close modals, dropdowns, popups |
Screen Reader Testing
Test with at least one screen reader:
| Platform | Screen Reader | Browser |
|---|---|---|
| Windows | NVDA (free) | Firefox |
| Windows | JAWS | Chrome |
| macOS | VoiceOver (built-in) | Safari |
| iOS | VoiceOver (built-in) | Safari |
| Android | TalkBack (built-in) | Chrome |
Basic VoiceOver testing on macOS:
- Press Cmd+F5 to enable VoiceOver
- Use VO+Right Arrow (Ctrl+Option+Right) to move through content
- Listen for: image descriptions, heading levels, link text, form labels
- Check that dynamic content updates are announced
Color and Visual Testing
- Test the page in grayscale — is information conveyed only by color?
- Check contrast ratios with browser extensions (e.g., WAVE, axe DevTools)
- Zoom to 200% — does the layout still work? Is content still readable?
- Test with high contrast mode on Windows
Automated Testing Tools
axe-core
The most widely used accessibility testing engine:
# Install axe-core for Playwright
npm install @axe-core/playwright
const { test, expect } = require('@playwright/test');
const AxeBuilder = require('@axe-core/playwright').default;
test('page has no accessibility violations', async ({ page }) => {
await page.goto('/');
const results = await new AxeBuilder({ page }).analyze();
expect(results.violations).toEqual([]);
});
Lighthouse Accessibility Audit
Covered in Lesson 5.18 — the Accessibility category checks ~50 automated rules.
WAVE Browser Extension
Free browser extension that provides visual overlay of accessibility issues directly on the page. Useful for manual review alongside automated checks.
Exercise: Accessibility Audit of a Web Page
Perform a comprehensive accessibility audit combining automated and manual testing.
Part 1: Automated Scan
Run an axe-core scan on a page of your choice:
- Install the axe DevTools browser extension
- Open the page and run a full scan
- Document all findings:
| Issue | Impact | Element | WCAG Criterion |
|---|---|---|---|
| Critical/Serious/Moderate/Minor |
Part 2: Keyboard Audit
Navigate the same page using only the keyboard:
| Check | Pass/Fail | Notes |
|---|---|---|
| All interactive elements reachable via Tab | ||
| Visible focus indicator on every element | ||
| Logical tab order | ||
| Can enter and exit modals with keyboard | ||
| Dropdown menus operable with arrow keys | ||
| Skip navigation link present | ||
| No keyboard traps |
Part 3: Screen Reader Check
Enable VoiceOver (Mac) or NVDA (Windows) and navigate the page:
| Check | Pass/Fail | Notes |
|---|---|---|
| All images have meaningful alt text | ||
| Headings form a logical hierarchy | ||
| Form fields have associated labels | ||
| Links have descriptive text | ||
| Dynamic content changes are announced | ||
| Page language is declared |
Part 4: Visual Checks
| Check | Pass/Fail | Notes |
|---|---|---|
| All text meets 4.5:1 contrast (normal) | ||
| All text meets 3:1 contrast (large) | ||
| Page works at 200% zoom | ||
| Info not conveyed by color alone | ||
| Focus indicator visible against all backgrounds |
Solution: Sample Accessibility Audit Report
Page audited: example-shop.com/products
Automated (axe-core) — 8 issues found:
| Issue | Impact | Count | Fix |
|---|---|---|---|
| Images missing alt text | Critical | 4 | Add descriptive alt attributes |
| Form inputs without labels | Critical | 2 | Associate <label> with each input |
| Insufficient color contrast | Serious | 3 | Increase contrast to 4.5:1 minimum |
| Missing page language | Serious | 1 | Add lang="en" to <html> |
Keyboard — 3 issues found:
- Product filter dropdown cannot be operated with arrow keys — FAIL
- Modal has no focus trap — Tab moves behind the modal — FAIL
- No skip navigation link — user must tab through 15 nav items — FAIL
Screen Reader — 2 issues found:
- Product prices are read as plain numbers without currency — confusing
- “Add to cart” confirmation is not announced to screen reader users
Visual — 1 issue found:
- Sale badge uses only color (red) to indicate sale status — no text label
Priority fixes:
- Add alt text to product images (Critical, easy fix)
- Add form labels (Critical, easy fix)
- Fix color contrast (Serious, CSS changes)
- Add focus trap to modal (Serious, JavaScript fix)
- Add
langattribute (Serious, one-line fix) - Announce cart confirmation to screen readers using aria-live region
Integrating A11y into Your Workflow
Shift-Left Approach
- Design phase: Review mockups for contrast, focus states, heading hierarchy
- Development: Use axe-core linter in IDE to catch issues before commit
- Code review: Check for alt text, ARIA attributes, semantic HTML
- Testing: Automated axe scans + manual keyboard/screen reader testing
- CI/CD: Fail builds on critical accessibility violations
Common ARIA Patterns to Verify
| Pattern | Verify |
|---|---|
aria-label | Element has no visible text but needs a name |
aria-labelledby | References an existing element ID |
aria-describedby | Provides additional descriptive text |
aria-expanded | Toggles between true/false for accordions |
aria-live="polite" | Dynamic content announces updates |
role="alert" | Urgent messages announced immediately |
Key Takeaways
- Accessibility testing requires both automated tools and manual testing — neither alone is sufficient
- Keyboard testing is the single most impactful manual test for accessibility
- Target WCAG 2.2 Level AA compliance as the minimum standard
- Use axe-core in your test automation and CI/CD pipeline for continuous checking
- Test with at least one screen reader to catch issues automated tools miss
- Accessibility bugs are often the easiest to fix (adding alt text, labels, contrast) but the most impactful for users