This project performs automated accessibility testing using Playwright and Axe. It scans multiple URLs, generates individual accessibility reports for each page, and creates a summary report aggregating all violations.
- Uses Playwright for web page automation.
- Uses Axe-core for accessibility testing.
- Generates individual HTML reports for each scanned URL.
- Creates an aggregated summary report with all detected violations.
- Supports WCAG 2.0 & 2.1 (A & AA) compliance testing.
- Provides inline documentation within the code for better understanding.
Ensure you have the following installed:
- Node.js (LTS recommended)
- Playwright
- [axe-html-reporter][https://github.com/lpelypenko/axe-html-reporter]
- Clone the repository:
git clone <repo-url> cd <repo-folder>
- Install dependencies:
npm install
Create a urls.txt
file in the root directory and list the URLs to be tested, one per line.
Execute the following command:
npx playwright test
This will:
- Load URLs from
urls.txt
- Scan each page for accessibility violations
- Generate individual reports in
accessibility-reports/
- Create an aggregated summary report
- Individual reports are stored in
accessibility-reports/
- The aggregated report is saved as
accessibility-reports/<PROJECT_KEY>-a11y-summary.html
You can set a custom project key by defining:
export PROJECT_KEY=MyProject
If not set, the default PROJECT_KEY
is A11Y
.
- Modify
withTags
inscanPage()
to test different WCAG levels. - Adjust
test.setTimeout()
if testing large pages. - Inline comments are included in the code for better readability and understanding.
Distributed under the GNU GENERAL PUBLIC LICENSE.