axe-selenium-python integrates aXe and selenium to enable automated web accessibility testing.
This version of axe-selenium-python is using firstname.lastname@example.org.
You will need the following prerequisites in order to use axe-selenium-python:
- selenium >= 3.0.0
- Python 2.7 or 3.6
- The appropriate driver for the browser you intend to use, downloaded and added to your path, e.g. geckodriver for Firefox:
To install axe-selenium-python:
$ pip install axe-selenium-python
axe.run() accepts two parameters:
For more information on
options, view the aXe documentation here.
Fork the repository and submit PRs with bug fixes and enhancements; contributions are very welcome.
Node dependencies must be installed by running npm install inside the axe-selenium-python directory.
You can run the tests using tox:
Breaks backwards compatibility:
- The Axe class method
executehas been renamed to
runto mirror the method in the axe-core API.
- Created package.json file to maintain axe-core dependency
- Replaced unit tests with more meaningful integration tests - included a sample html file for integration tests
- All functionalities that are not part of axe-core have been moved into a separate package,
pytest-axe. This includes:
get_rulesAxe class method
runAxe class method
impact_includedAxe class method
analyzeAxe class method.
The purpose of this change is to separate implementations that are specific to the Mozilla Firefox Test Engineering team, and leave the base
axe-selenium-python package for a more broad use case. This package was modeled off of Deque's Java package, axe-selenium-java, and will now more closely mirror it.
All functionalities can still be utilized when using
axe-selenium-python in conjunction with
- Added the analyze method to the Axe class. This method runs accessibility checks, and writes the JSON results to file based on the page URL and the timestamp.
- Writing results to file can be enabled by setting the environment variable
ACCESSIBILITY_REPORTING=true. The files will be written to
results/directory, which must be created if it does not already exist.
- Accessibility checks can be disabled by setting the environment variable
- Updated axe to
- Modified impact_included class method to reflect changes to the aXe API:
- There are now only 3 impact levels: 'critical', 'serious', and 'minor'
- Updated usage examples in README
- Added docstrings to methods lacking documentation
- Removed unused files
- Added run method to Axe class to simplify the usage in existing test suites
- run method includes the ability to set what impact level to test for: 'minor', 'moderate', 'severe', 'critical'
- Added selenium instance as a class attribute
- Changed file paths to OS independent structure
- Fixed file read operations to use with keyword
- Fixed include of aXe API file and references to it
- Updated README