Focus Management Audit Plan
As Sherlock, the detective of digital accessibility at Trailblazer Labs, I'll outline a comprehensive, methodical audit plan to evaluate focus management in your web application or site. This plan ensures keyboard flows, aria-live regions, and focus traps align with WAI-ARIA 1.2 best practices and WCAG 2.2 Success Criteria (e.g., 2.1.1 Keyboard, 2.4.3 Focus Order, 2.4.7 Focus Visible, 4.1.3 Status Messages).
The audit emphasizes manual testing for real-world usability, supplemented by automated tools for efficiency. Assume a modern web app (e.g., React/Vue/Angular); adapt for static sites as needed.
1. Preparation (1-2 hours)
Objectives
- Define scope: Entire site/app, prioritizing interactive components (forms, modals, menus, dynamic updates).
- Identify key pages/user flows: Homepage, login, forms, modals/popups, notifications, search results.
Tools & Setup
| Category | Tools | Purpose |
|---|
| Browsers | Chrome, Firefox, Safari (latest) | Cross-browser keyboard/focus testing. |
| DevTools | Chrome DevTools (Elements/Accessibility panes), Firefox Accessibility Inspector | Inspect focus, ARIA attributes, computed styles. |
| Screen Readers | NVDA (Windows), VoiceOver (macOS), JAWS (if available) | Announce aria-live; verify keyboard navigation. |
| Automated | axe DevTools (browser extension), WAVE, Lighthouse (Accessibility audit), pa11y-ci | Flag ARIA violations, focus issues. |
| Keyboard Testing | Physical keyboard or on-screen keyboard; disable mouse. | Simulate keyboard-only users. |
| Other | BrowserStack or similar for OS/browser combos; code inspector for tabindex, aria-*. | Edge cases. |
- Test Environment: No mouse/trackpad; full keyboard navigation. Enable
prefers-reduced-motion. Test zoomed (200%) and high-contrast modes.
- Baseline: Run automated tools first; note false positives for manual verification.
2. Audit Phases
Conduct in order: Keyboard flows → aria-live → Focus traps. Test each in isolation, then end-to-end user flows.
Phase 1: Keyboard Flows (4-6 hours)
Goal: Ensure logical, trap-free navigation (WCAG 2.4.3, ARIA: Focus Management).
Steps:
-
Tab Order Check:
- Tab forward/backward through the page.
- Verify: Logical reading order (headings → links → form controls → buttons).
- Flag:
tabindex > 0 (avoid; use DOM order), negative tabindex (only for skip links).
- Expected: 100% interactive elements focusable; no skips/jumps.
-
Focus Indicators (WCAG 2.4.7):
- Inspect
:focus-visible styles (min 2px border/outline, high contrast).
- Test custom focus styles override browser defaults.
-
Skip Links & Landmarks:
- Verify skip-to-content links (first focusable; aria-label="Skip to main content").
- Use
role="main", role="navigation" for logical flow.
-
Dynamic Content:
- Load AJAX/SPA updates; ensure focus moves to new content or managed via aria-live.
-
Edge Cases:
- Arrow keys (e.g., menus, carousels).
- Enter/Space on buttons/links/checkboxes.
- No keyboard traps (infinite loop; use devtools to monitor activeElement).
Checklist:
| Check | Pass Criteria | WAI-ARIA Ref |
|---|
| Logical tab order | Matches visual/DOM order | APG: Keyboard |
| Visible focus | 3:4.5:1 contrast | 2.4.7 Focus Visible |
| No traps | Tab reaches footer | Keyboard Traps |
| Skip links | Announces & focuses main | APG: Skip Links |
Test Scenarios: E-commerce checkout, multi-step form.
Phase 2: aria-live Regions (2-4 hours)
Goal: Polite/assertive announcements for dynamic updates without disrupting focus (WCAG 4.1.3, ARIA: Live Regions).
Steps:
-
Identification:
- Search DOM/code for
aria-live="polite|assertive|off", aria-atomic, aria-relevant.
- Common: Toasts, errors, loading spinners, chat messages.
-
Announcement Testing:
- Trigger updates (e.g., form validation, notifications).
- With screen reader: Content reads immediately (assertive) or queued (polite).
- Verify: Doesn't steal focus (focus stays on trigger).
-
Attributes Validation:
aria-live="polite" for non-urgent (e.g., new search results).
aria-live="assertive" for critical (e.g., errors).
aria-atomic="true" for full region reads.
aria-relevant="additions|removals|text" as needed.
- Empty initially (hidden via
aria-hidden or display:none).
-
Interruptions:
- Test polite vs. assertive priority.
- No focus shift unless intended (use
aria-describedby instead).
Checklist:
| Check | Pass Criteria | WAI-ARIA Ref |
|---|
| Correct live value | Polite for non-emergency | Live Region States |
| No focus steal | Focus unchanged | APG: Live |
| Screen reader announces | Full/partial as atomic/relevant | ARIA 1.2 §3.13 |
| Hidden initially | Screen reader ignores | aria-hidden |
Test Scenarios: Live search, validation errors, real-time notifications.
Phase 3: Focus Traps (3-5 hours)
Goal: Contain focus in overlays/modals (ARIA: Dialog/Modal Patterns).
Steps:
-
Identification:
- Modals, dropdowns, sidebars, custom selects.
-
Activation:
- Open via keyboard (Enter on trigger).
- Focus shifts to first focusable element (e.g., close button).
-
Trapping:
- Tab/Shift+Tab cycles within trap only.
- Last → first, first → last.
- Esc closes, returns focus to trigger (use
aria-modal="true").
-
Backdrop & Scoping:
- Backdrop:
inert polyfill or aria-hidden on rest of page.
- Nested traps handled (outer pauses).
-
Dismissal:
- Focus restores to originating element.
Checklist:
| Check | Pass Criteria | WAI-ARIA Ref |
|---|
| Focus on open | First/last focusable | Dialog Pattern |
| Trap cycle | No escape via Tab | Focus Trap |
| Esc closes | Focus returns | APG: Modal |
| aria-modal | Prevents background interaction | ARIA 1.2 §5.4 |
Test Scenarios: Login modal, dropdown menu, full-screen overlay.
3. End-to-End Flows & Regression (2 hours)
- Critical paths: Login → dashboard → modal → submit.
- Screen reader + keyboard combo.
- Mobile: VoiceOver + swipe gestures.
4. Documentation & Reporting
- Template: Google Sheet/Jira with columns: Location (URL/component), Issue, Severity (Critical/Major/Minor), WCAG/ARIA Ref, Screenshot/Video, Fix Recommendation.
- Severity:
| Level | Impact |
|---|
| Critical | Blocks keyboard access |
| Major | Disrupts flow/announcements |
| Minor | Suboptimal styling/priority |
- Output: Executive summary (pass/fail %), detailed findings, prioritized fixes.
- Timeline: 12-20 hours total; retest post-fix.
This plan is exhaustive yet actionable—execute it methodically, and your app will pass accessibility muster. Need me to audit a specific URL, sample code, or refine for your stack? Provide details! 🔍