Sitelet https://github.com/neverstew/axe-selenium-python/tree/2818e8a2da31704cc1d9e668857570c9ebd29fab
Skip to content

About

aXe Selenium Integration python package

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

axe-selenium-python

axe-selenium-python integrates aXe and selenium to enable automated web accessibility testing.

This version of axe-selenium-python is using axe-core@3.0.1.

License PyPI Travis wheel Issues Updates Python 3

Requirements

You will need the following prerequisites in order to use axe-selenium-python:

Installation

To install axe-selenium-python:

$ pip install axe-selenium-python

Usage

import pytest
 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.execute()
     # Write results to file
     axe.write_results('a11y.json', results)
     driver.close()
     # Assert no violations are found
     assert len(results["violations"]) == 0, axe.report(results["violations"])

The method axe.execute() accepts two parameters: context and options.

For more information on context and options, view the aXe documentation here.

Contributing

Fork the repository and submit PRs with bug fixes and enhancements; contributions are very welcome. You can run the tests using Docker:

$ docker build -t axe-selenium-python .
$ docker run -it axe-selenium-python tox

Resources

About

aXe Selenium Integration python package

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages