Python library to integrate axe and selenium for web accessibility testing.
Project description
axe-selenium-python-dev was forked from https://github.com/mozilla-services/axe-selenium-python on date 29/10/2020 all credits to them, there was no official pypi distribution available which supports axe-core 3.3.2 so took the opportunity to create this to support others like us
This version of axe-selenium-python-dev supports all changes in repo https://github.com/mozilla-services/axe-selenium-python before date 29/10/2020
This version of axe-selenium-python-dev is using axe-core@3.3.2.
Requirements
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:
geckodriver downloaded and added to your PATH
Installation
To install axe-selenium-python-dev:
$ pip install axe-selenium-python-dev
Usage
from selenium import webdriver
from axe_selenium_python import Axe
def test_google():
driver = webdriver.Firefox()
driver.get("http://www.google.com")
axe = Axe(driver)
# Inject axe-core javascript into page.
axe.inject()
# Run axe accessibility checks.
results = axe.run()
# Write results to file
axe.write_results(results, 'a11y.json')
driver.close()
# Assert no violations are found
assert len(results["violations"]) == 0, axe.report(results["violations"])
The method axe.run() accepts two parameters: context and options.
For more information on context and options, view the aXe documentation here.
Resources
CHANGELOG
version 1.1.1
Updated readme
version 1.1.0
Created package.json file to maintain axe-core dependency
version 1.0.0
Forked https://github.com/mozilla-services/axe-selenium-python updated code and initial pypi deploy
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for axe-selenium-python-dev-1.1.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6820a6f00f9a2642522e7b3db5fc39a3aef17395f39427b48ed86b14ed6306d2 |
|
MD5 | 9941ebb59815bc64818865c28959cb8f |
|
BLAKE2b-256 | 4afa854bd7ba7f5175064db4f69b7c9c0ccd0b9ae7d33e36fa7d41c3a2ad7453 |
Hashes for axe_selenium_python_dev-1.1.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d0279efeb2966e2ccf025721e4bd6b2b83060db751c863fd1f4c630c2f4143de |
|
MD5 | 6d5d3bb2c61115c510729caaaa0fa60f |
|
BLAKE2b-256 | e465923901b88fde90b258f0c4fd683454857b1caaeced7a17d131c3b858634c |