Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yadler97/accessibility-tester
A Python script to test a web page on visual accessibility based on six testing criteria
https://github.com/yadler97/accessibility-tester
accessibility accessibility-testing automation beautifulsoup4 selenium selenium-python wcag
Last synced: 3 months ago
JSON representation
A Python script to test a web page on visual accessibility based on six testing criteria
- Host: GitHub
- URL: https://github.com/yadler97/accessibility-tester
- Owner: yadler97
- Created: 2020-08-27T12:34:06.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2022-01-29T15:02:16.000Z (almost 3 years ago)
- Last Synced: 2024-04-20T12:06:42.759Z (9 months ago)
- Topics: accessibility, accessibility-testing, automation, beautifulsoup4, selenium, selenium-python, wcag
- Language: Python
- Homepage:
- Size: 86.9 KB
- Stars: 3
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[![Python 3.10](https://img.shields.io/badge/python-3.10-blue.svg)](https://www.python.org/downloads/release/python-3101/)
# Accessibility Tester
A Python script to test a web page for six testing criteria regarding accessibility. The criteria are based on a report from WebAIM and are implemented by following the Web Content Accessibility Guidelines 2.1 (WCAG 2.1).
## Testing Criteria
1. Low contrast text
2. Missing alternative texts for images
3. Empty links
4. Missing form input labels
5. Empty buttons
6. Missing document language## How to run
First, you need a WebDriver for your browser of choice:
- **Chrome**: https://chromedriver.chromium.org/
- **Firefox**: https://github.com/mozilla/geckodriver
- **Edge**: https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver/
- **Opera**: https://github.com/operasoftware/operachromiumdriver
- **Safari**: https://developer.apple.com/documentation/webkit/testing_with_webdriver_in_safari(Make sure that the selected WebDriver version matches your current browser version)
The path to the webdriver must be in your PATH.
\
Then, install all dependencies with pip:pip install -r requirements.txt
\
A test for a specific web page can then be executed with the following command:python accessibility_tester.py [OPTIONS] WEBPAGE
For help, run:
python accessibility_tester.py --help
The required accessibility level is a value between 0 and 1. It is compared with the actual accessibility level that is achieved in the test, which is calculated by dividing the successful checks through the total number of executed checks. If the achieved accessibility level is equal to or higher than the required accessibility level, the program will return an exit code of 0, otherwise an exit code of 1 will be returned.