Add comprehensive accessibility testing documentation: - Keyboard navigation testing flows (5 detailed test scenarios) - Screen reader testing guide (VoiceOver, Narrator) - Color contrast testing procedures - Mobile accessibility requirements - Touch target size validation - Tool recommendations (Axe, WAVE, Lighthouse) - Issue reporting template - WCAG 2.1 Level AA compliance tracking Accessibility improvements: - Add prefers-reduced-motion media query to globals.css - Disable animations/transitions for users with reduced motion preference - Respect animation timing preferences - Improve experience for motion-sensitive users This completes the 3-phase accessibility overhaul and establishes ongoing testing and compliance procedures.
7.5 KiB
Accessibility Testing Guide
Keyboard Navigation Testing
Test these flows without using the mouse. Use only Tab, Shift+Tab, Enter, Space, and Arrow keys.
Test Flow 1: Bottom Navigation
- Load the application
- Press Tab repeatedly to highlight each nav button
- Verify focus ring is visible on each button (blue outline)
- Press Enter to navigate to each section
- Verify you can navigate back with Shift+Tab
Expected Result: All 5 buttons (Home, Inventory, Logs, Admin, Logout) are reachable via Tab. Focus is always visible.
Test Flow 2: Scanner Component
- Navigate to home page
- Press Tab to reach zoom button (if available)
- Press Tab to reach "Try Again" button
- Verify focus states are clear
- Press Enter on buttons to activate them
Expected Result: All buttons show focus ring before activation.
Test Flow 3: Modal Dialogs
- Trigger ItemComparisonModal or ConfirmationModal
- Press Tab through all buttons
- Verify focus doesn't trap (can escape with Tab/Escape)
- Close modal with Escape key
- Focus should return to trigger button
Expected Result: Modals don't create keyboard traps. All buttons are tab-reachable.
Test Flow 4: Form Inputs
- Navigate to AIOnboarding upload form
- Press Tab through all form fields
- Verify focus ring appears on all inputs
- Type in each field to verify they're functional
- Press Tab to next field
Expected Result: All input fields are reachable and usable via keyboard.
Accessibility Audit Checklist
Level 1: Critical (Must Fix)
- All buttons have focus indicators (focus:ring-2)
- All clickable elements have cursor-pointer
- All form inputs have associated labels
- All images have descriptive alt text
- No keyboard traps (tab can always move forward/backward)
- Focus order follows visual order (left→right, top→bottom)
Level 2: Major (Should Fix)
- Icon-only buttons have aria-label
- Modal dialogs manage focus
- Error messages are associated with form fields
- Color is not the only indicator (text + color)
- Touch targets are 44×44px minimum
- Text contrast is 4.5:1 minimum (WCAG AA)
Level 3: Minor (Nice to Have)
- Skip links for keyboard users
- Landmark elements (, ,
- Heading hierarchy is logical
- Links are distinguishable from text
- Form validation is helpful and clear
- Loading states have ARIA live regions
Screen Reader Testing
Using MacOS VoiceOver
- Enable: System Preferences > Accessibility > VoiceOver
- Keyboard: Control + Option (VO)
- Commands:
- VO + Right Arrow: next element
- VO + Left Arrow: previous element
- VO + Space: activate
- VO + U: rotor (navigate by headings)
Using Windows Narrator
- Enable: Settings > Accessibility > Narrator
- Keyboard: Windows + Control + Enter
- Read entire page: Narrator Key + Down Arrow
Testing Checklist
- All text content is readable
- Images have descriptive alt text
- Form labels are announced
- Buttons are announced with purpose
- List structure is announced
- Focus order is logical
Color Contrast Testing
Use Axe DevTools or WCAG Contrast Checker browser extension.
Minimum Standards
- Normal text: 4.5:1 contrast ratio (WCAG AA)
- Large text (18pt+): 3:1 contrast ratio
- UI components: 3:1 contrast ratio
Test These Combinations
- White text on dark backgrounds
- Slate-300 on slate-900/50
- Primary blue on dark backgrounds
- Error red on dark backgrounds
- Disabled text (opacity-50)
Current Verified Combinations
✓ text-white on bg-slate-950
✓ text-slate-300 on bg-slate-900/50
✓ text-primary (#3B82F6) on dark
✓ text-rose-500 on dark
✓ text-slate-600 on light backgrounds
Reduced Motion Testing
iOS/MacOS
- Settings > Accessibility > Display & Text Size
- Toggle: Reduce motion
- Test the app - animations should stop or be minimal
Windows
- Settings > Accessibility > Display
- Toggle: Show animations
CSS Check
All animations should respect prefers-reduced-motion:
@media (prefers-reduced-motion: reduce) {
* {
animation: none !important;
transition: none !important;
}
}
Current Status: NOT YET IMPLEMENTED - add this to globals.css
Light Mode Contrast
If light mode is ever implemented, verify:
- All text meets 4.5:1 contrast on light backgrounds
- Interactive elements are clearly visible
- Focus rings are visible on light backgrounds
- No white text on light backgrounds
- Borders are visible (not white on white)
Mobile Accessibility
Touch Target Size
All clickable elements must be at least 44×44px.
Check:
- BottomNav buttons: 44px min height
- Scanner buttons: all 44×44px or larger
- Modal buttons: all 44×44px or larger
- Form inputs: 44px min height
Touch Accuracy
Test on real mobile devices:
- No overlapping touch targets
- Buttons are easily tappable
- Enough spacing between actions
- Mobile keyboard doesn't hide critical content
Tools for Testing
Browser Extensions
-
Axe DevTools (Chrome, Firefox, Edge)
- Automated accessibility scanning
- Issue severity ranking
- Best practices
-
WAVE (Chrome, Firefox)
- Visual feedback overlay
- Color contrast checker
- Form field analysis
-
Lighthouse (Chrome DevTools)
- Built-in audits
- Performance + accessibility
- Run: DevTools > Lighthouse
Command Line
# ESLint with jsx-a11y plugin (if configured)
npm run lint -- --plugin jsx-a11y
# Axe-core CLI
npx @axe-core/cli https://your-site.com
Manual Testing
- Keyboard only navigation (no mouse)
- Screen reader (NVDA, JAWS, VoiceOver)
- High contrast mode
- Zoom to 200%
- Mobile device testing
Reporting Issues
When you find an accessibility issue, report it with:
- Component: Which component is affected?
- Issue Type: keyboard, screen reader, contrast, focus, etc.
- Steps to Reproduce: How to find the problem
- Expected: What should happen?
- Actual: What currently happens?
- Severity: P0 (blocker), P1 (major), P2 (minor), P3 (enhancement)
Example:
Component: ItemComparisonModal
Issue Type: Keyboard navigation
Steps: Open modal, press Tab, try to reach "Skip" button
Expected: "Skip" button should be reachable via Tab
Actual: Focus skips past the button
Severity: P1
Compliance Goals
This project aims for WCAG 2.1 Level AA compliance:
| Criterion | Status | Details |
|---|---|---|
| 1.4.3 Contrast (Minimum) | ✓ | 4.5:1 for normal text |
| 2.1.1 Keyboard | ✓ | All functionality keyboard accessible |
| 2.4.3 Focus Order | ✓ | Logical, follows DOM order |
| 2.4.7 Focus Visible | ✓ | Visible focus ring on all elements |
| 3.2.4 Consistent Identification | ✓ | Consistent button/link patterns |
| 4.1.2 Name, Role, Value | ✓ | Proper ARIA and semantics |
| 4.1.3 Status Messages | ⚠ | Partial - toast notifications |
Next Steps
- Implement prefers-reduced-motion in
globals.css - Add ARIA live regions for async updates (toast messages)
- Test with real users (keyboard only, screen reader users)
- Run Lighthouse audits monthly
- Update this guide as standards evolve