mirror of
https://github.com/johndoe6345789/snippet-pastebin.git
synced 2026-04-24 13:34:55 +00:00
- Created comprehensive test suites for quality validator module (430+ tests) * index.test.ts: QualityValidator main module * reporters/*.test.ts: ReporterBase and all reporters * scoring/*.test.ts: Scoring engine with edge cases * utils/*.test.ts: Validators, formatters, FileChangeDetector - Added UI component tests for sidebar menu and templates (800+ tests) * SidebarMenuButton, SidebarMenuSubButton, etc. * DashboardTemplate, BlogTemplate * ContentPreviewCardsSection, FormFieldsSection - Coverage improvements: * Statements: 56.62% → 60.93% (+4.31%) * Functions: 76.76% → 79.82% (+3.06%) * Branches: 84.37% → 85.92% (+1.55%) * Tests passing: 5,512 (added 363 new passing tests) Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
12 KiB
12 KiB
Screen Reader Testing Guide for Aria-Live Regions
Overview
This guide provides step-by-step instructions for testing aria-live regions and dynamic content announcements across different screen readers and platforms.
Quick Testing Checklist
- MonacoEditor status announcement
- PythonTerminal state updates
- Terminal output announcements
- Error alerts (assertive aria-live)
- Parameter list updates
- Empty state messaging
- Keyboard navigation
- Screen reader compatibility
Testing Tools & Platforms
Windows
NVDA (Free, Open Source)
- Download: https://www.nvaccess.org/download/
- Version: Latest stable
- Best for: Comprehensive testing, free option
JAWS (Commercial)
- Download: https://www.freedomscientific.com/products/software/jaws/
- Version: Latest version
- Best for: Enterprise testing, most features
macOS
VoiceOver (Built-in)
- Enable: Cmd + F5 or System Preferences > Accessibility > VoiceOver
- Disable: Cmd + F5 (toggle)
- Best for: Apple ecosystem testing
iOS
VoiceOver (Built-in)
- Enable: Settings > Accessibility > VoiceOver > On
- Navigation: Swipe right/left for next/previous item
- Best for: Mobile testing
Android
TalkBack (Built-in)
- Enable: Settings > Accessibility > TalkBack > On
- Navigation: Swipe right/left for next/previous item
- Best for: Android device testing
Test Scenarios
1. MonacoEditor Status Announcement
Location: Code editor components (SnippetDialog, etc.)
NVDA (Windows)
- Open application with NVDA running
- Navigate to code editor using Tab key
- Expected: Hear "Code editor loaded with [Language] syntax highlighting. Editable/Read-only mode."
- Focus on editor and press Alt+Down to read full description
JAWS (Windows)
- Start JAWS and load application
- Use arrow keys to navigate to editor
- Press Insert+F7 to open Find dialog
- Search for "code editor"
- Expected: Announcement includes language and mode
VoiceOver (macOS)
- Enable VoiceOver (Cmd + F5)
- Press VO+U to open rotor
- Navigate to status items
- Expected: See editor status announcement
Test Verification
Announcement should include:
- "Code editor loaded"
- Language name (JavaScript, TypeScript, etc.)
- Mode (Editable or Read-only)
- "syntax highlighting"
2. PythonTerminal Status Updates
Location: Python runner component
NVDA (Windows)
- Open Python terminal
- Click "Run" button
- Expected: Hear "Code is running"
- Wait for execution or errors
- Expected: Hear updated status messages
JAWS (Windows)
- Navigate to terminal with arrow keys
- Activate Run button (Enter/Space)
- Expected: Status announcements during execution
- If errors occur, should hear "Errors detected in output" (assertive)
VoiceOver (macOS)
- VO+U to open rotor
- Find "Python Terminal" region
- Press VO+Right Arrow to enter
- Expected: Hear status updates as code runs
Expected Announcements
Initial: "Terminal is initializing"
Running: "Code is running"
Input waiting: "Waiting for user input"
Complete: "[N] lines of output"
Errors: "Errors detected in output" (interrupting)
3. Terminal Output Announcements
Location: Terminal output area below Run button
NVDA (Windows)
- Run Python code that produces output
- Expected: Announcements of output lines
- If errors appear, should interrupt immediately
- Press Ctrl to stop speech, then arrow through output
JAWS (Windows)
- Run code and observe output
- Expected: Each new output line announced
- Errors should interrupt immediately
- Use arrow keys to review individual lines
Test Error Announcement
- Run code that produces error:
1/0(division by zero) - Expected: Immediate announcement: "Error: division by zero"
- Should interrupt any other announcements (assertive)
VoiceOver (macOS)
- Run code with errors
- Expected: Hear error immediately
- Use VO+Down Arrow to navigate through output
- Each error line should be marked as "alert"
4. Input Parameter List Updates
Location: Preview Configuration section in snippet editor
NVDA (Windows)
- Open snippet editor dialog
- Navigate to "Add Parameter" button
- Expected: Button label includes current parameter count
- Click button to add parameter
- Expected: Hear "1 parameter configured"
- Add more parameters
- Expected: Count updates ("2 parameters configured", etc.)
JAWS (Windows)
- Use arrow keys to navigate parameter list
- Expected: Hear parameter count announcement
- Add new parameter with button
- Expected: Parameter region announcement updates
- Delete parameter
- Expected: Count decreases with announcement
Parameter Announcement Examples
0 parameters: "0 parameters configured"
1 parameter: "1 parameter configured"
Multiple: "3 parameters configured"
5. Empty State Messaging
Location: Snippet list area when no snippets exist
NVDA (Windows)
- Delete all snippets or start fresh
- Navigate to snippet area
- Expected: Hear "No snippets available"
- Full announcement: "[Title]. [Description]"
JAWS (Windows)
- View empty snippet area
- Press Insert+A to read current window
- Expected: Empty state announcement
- Use arrow keys to find Create button
- Expected: Button guidance provided
VoiceOver (macOS)
- Navigate to empty state
- VO+U to open rotor
- Find status regions
- Expected: Empty state message announced
Expected Announcement
"No snippets yet. Create your first snippet to get started."
Aria-Live Urgency Testing
Polite vs Assertive
Testing aria-live="polite"
- Regular status updates (not critical)
- Parameter count changes
- Normal terminal output
- Behavior: Wait for natural pause in speech
- Expected: User hears other content first, then announcement
Testing aria-live="assertive"
- Error messages
- Critical alerts
- Validation errors
- Behavior: Interrupt current speech immediately
- Expected: User hears error alert right away
Test Procedure
- Have screen reader reading long content
- Trigger aria-live="assertive" event (error)
- Expected: Current speech stops, error announced
- Compare with aria-live="polite" event
- Expected: Polite event waits for pause
Keyboard Navigation Testing
Tab Order
- Start at page top
- Press Tab repeatedly
- Verify logical tab order:
Editor → Run Button → Output Area → Parameters → Create Button
Screen Reader Navigation
- NVDA: Use H to jump to headings, L for lists, B for buttons
- JAWS: Use arrow keys and Insert+F3 for Find
- VoiceOver: Use VO+U for rotor navigation
Testing Shortcuts
- Tab/Shift+Tab for forward/back
- Enter/Space to activate buttons
- Arrow keys within lists and regions
- Escape to close dialogs
Common Testing Scenarios
Scenario 1: Code Execution with Output
1. Open snippet editor
2. Add code: console.log("Hello")
3. Click Run
4. Expected sequence:
- "Terminal is initializing"
- "Code is running"
- Output line announced: "Hello"
- Status: "[1] lines of output"
Scenario 2: Code Execution with Error
1. Add code: throw new Error("Test")
2. Click Run
3. Expected sequence:
- "Terminal is initializing"
- "Code is running"
- "Errors detected in output" (INTERRUPTS)
- Error line announced: "Error: Test"
Scenario 3: Adding Parameters
1. Open snippet with parameters
2. See "0 parameters configured"
3. Click "Add Parameter"
4. Fill in parameter details
5. Expected: "1 parameter configured"
6. Repeat: "2 parameters configured"
Scenario 4: Empty State Flow
1. Delete all snippets or start fresh
2. Expected: "No snippets available"
3. Full message: "No snippets yet. Create your first snippet to get started."
4. Tab to Create button
5. Screen reader reads: "Create new snippet"
Platform-Specific Testing
Windows with NVDA
# Start NVDA
1. Download and install NVDA
2. Launch NVDA before opening browser
3. Navigate to application URL
4. Use Ctrl+Shift+Arrow for navigation modes
5. Press Ctrl to stop speech
6. Press F7 for review window
Windows with JAWS
# Start JAWS
1. Launch JAWS before browser
2. JAWS automatically reads webpage
3. Use arrow keys for normal navigation
4. Insert+Home for JAWS help
5. Insert+F7 for Find
macOS with VoiceOver
# Enable VoiceOver
1. Press Cmd + F5 to toggle
2. VO = Control + Option (by default)
3. VO + U to open rotor
4. VO + Arrow Keys to navigate
5. VO + Space to interact
iOS/Android Testing
1. Enable TalkBack (Android) or VoiceOver (iOS)
2. Swipe right to navigate forward
3. Swipe left to navigate backward
4. Double tap to interact
5. Two-finger swipe up to read all
Troubleshooting Common Issues
Issue: Announcement Not Heard
Solution:
- Verify aria-live region exists in DOM
- Check that text content is not empty
- Ensure role attribute is set correctly
- Confirm sr-only class isn't hiding region completely
- Check for JavaScript errors in console
Issue: Announcement Repeated
Solution:
- Verify aria-atomic value is correct
- Check that region isn't being recreated
- Ensure state updates don't duplicate content
- Use React DevTools to inspect re-renders
Issue: Wrong Announcement Urgency
Solution:
- Verify aria-live="assertive" for errors
- Confirm aria-live="polite" for normal updates
- Check dynamic aria-live switching logic
- Test with multiple screen readers
Issue: Keyboard Navigation Broken
Solution:
- Verify tab order is logical
- Check that buttons/inputs are focusable
- Ensure no tabindex conflicts
- Test with keyboard only (no mouse)
Automated Testing
Using axe-core
npm install --save-dev @axe-core/react
# Run accessibility tests
npm run test:a11y
Using WebAIM
# Check WCAG compliance
Visit: https://webaim.org/articles/screenreader_testing/
Using ARIA Test Suite
# Test aria-live specifically
npm install --save-dev aria-live-test-suite
Documentation Template
When testing, use this template to document findings:
Component: [Name]
Screen Reader: [NVDA/JAWS/VoiceOver/TalkBack]
Platform: [Windows/macOS/iOS/Android]
Browser: [Chrome/Firefox/Safari]
Test Case: [Description]
Expected: [What should be announced]
Actual: [What was heard]
Status: [PASS/FAIL/PARTIAL]
Notes: [Any additional observations]
Resources
- ARIA Authoring Practices Guide
- WebAIM Screen Reader Testing
- NVDA Documentation
- JAWS Documentation
- VoiceOver Guide
- WCAG 2.1 Guidelines
Compliance Checklist
- Aria-live regions implemented for all dynamic content
- Polite vs assertive urgency correctly applied
- Screen-reader-only announcements using sr-only class
- Semantic HTML roles (status, alert, log)
- Keyboard navigation fully functional
- Aria-labels provide clear context
- No duplicate announcements
- Tests written for all components
- Manual testing completed with NVDA
- Manual testing completed with JAWS
- Manual testing completed with VoiceOver
- Manual testing completed with TalkBack
- Accessibility audit passed (axe-core)
- WCAG 2.1 Level AA compliance verified