81 lines
2.2 KiB
Markdown
81 lines
2.2 KiB
Markdown
# Accessibility Testing
|
|
|
|
This directory contains tests for WCAG 2.1 AAA compliance.
|
|
|
|
## Overview
|
|
|
|
The accessibility testing framework uses multiple tools to provide comprehensive coverage:
|
|
|
|
1. **axe-core**: JavaScript library for automated accessibility testing
|
|
2. **Pa11y**: Command-line tool for accessibility testing
|
|
3. **Manual testing checklist**: For criteria that cannot be automatically tested
|
|
|
|
## Requirements
|
|
|
|
- Node.js and npm
|
|
- Pa11y: `npm install -g pa11y`
|
|
- axe-core: `npm install axe-core`
|
|
- Playwright: `npm install playwright`
|
|
|
|
## Running Tests
|
|
|
|
To run all accessibility tests:
|
|
|
|
```bash
|
|
./run-accessibility-tests.sh [base-url]
|
|
```
|
|
|
|
Default base URL is `http://localhost:8080` if not specified.
|
|
|
|
## Individual Test Scripts
|
|
|
|
- `axe-test.js`: Runs axe-core against all pages
|
|
- `pa11y-test.sh`: Runs Pa11y against all pages
|
|
- `manual-checklist.md`: Checklist for manual testing
|
|
|
|
## WCAG 2.1 AAA Compliance
|
|
|
|
These tests check for WCAG 2.1 AAA compliance, which includes:
|
|
|
|
- **Perceivable**:
|
|
- 7:1 contrast ratio for text
|
|
- Text spacing customization
|
|
- No loss of content when text is resized
|
|
- Audio description for video
|
|
|
|
- **Operable**:
|
|
- No timing constraints
|
|
- No interruptions
|
|
- Multiple ways to find content
|
|
- Proper heading structure
|
|
|
|
- **Understandable**:
|
|
- Unusual words are defined
|
|
- Abbreviations are expanded
|
|
- Reading level appropriate for audience
|
|
- Context-sensitive help available
|
|
|
|
- **Robust**:
|
|
- Proper ARIA usage
|
|
- Compatibility with assistive technologies
|
|
|
|
## Test Reports
|
|
|
|
Reports are saved in the `../reports` directory:
|
|
|
|
- `axe-summary.json`: Summary of axe-core test results
|
|
- `pa11y-summary.json`: Summary of Pa11y test results
|
|
- `accessibility-summary.json`: Combined summary of all tests
|
|
|
|
## Manual Testing
|
|
|
|
Some WCAG 2.1 AAA criteria require manual testing. Use the `manual-checklist.md` file to document these tests.
|
|
|
|
## Additional Tools
|
|
|
|
For more comprehensive testing, consider using:
|
|
|
|
- **Accessibility Insights for Web**: Browser extension for detailed accessibility testing
|
|
- **NVDA or VoiceOver**: Screen readers for testing screen reader compatibility
|
|
- **Keyboard-only navigation**: Test all functionality without using a mouse
|