Skip to main content
Warning: You are using the test version of PyPI. This is a pre-production deployment of Warehouse. Changes made here affect the production instance of TestPyPI (testpypi.python.org).
Help us improve Python packaging - Donate today!

Python library to integrate axe and selenium for web accessibility testing.

Project Description

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

Requirements

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

Optional

  • tox

Installation

To install axe-selenium-python:

$ pip install axe-selenium-python

To install pytest-axe:

$ pip install pytest-axe

Usage

test_accessibility.py

import pytest

 @pytest.mark.nondestructive
 def test_header_accessibility(selenium, base_url, axe):
     selenium.get(base_url)
     violations = axe.run('header', None, 'critical')
     assert len(violations) == 0, axe.report(violations)

The above example runs aXe against only the content within the <header> tag, and filters for violations labeled critical.

The method axe.run() accepts three parameters: context, options, and impact.

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

The third parameter, impact, allows you to filter violations by their impact level. The options are critical, severe, moderate, and minor, with the default value set to None.

This will filter violations for the impact level specified, and all violations with a higher impact level.

To run the above test you will need to specify the browser instance to be invoked, and the base_url.

$ pytest --base-url http://www.mozilla.com --driver Firefox test_accessibility.py

Resources

CHANGELOG

version 1.0.0

  • Updated usage examples in README
  • Added docstrings to methods lacking documentation
  • Removed unused files

version 0.0.3

  • 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’

version 0.0.276

  • Added pytest-axe usage example to README

version 0.0.275

  • Added usage example to README

version 0.0.273

  • Added selenium instance as a class attribute
  • Changed file paths to OS independent structure
  • Fixed file read operations to use with keyword

version 0.0.21

  • Fixed include of aXe API file and references to it
  • Updated README
Release History

Release History

This version
History Node

1.1.0

History Node

1.0.100

History Node

1.0.0

History Node

0.1.0

History Node

0.0.2811

History Node

0.0.2775

History Node

0.0.2774

History Node

0.0.2773

History Node

0.0.2772

History Node

0.0.2771

History Node

0.0.458

History Node

0.0.457

History Node

0.0.456

History Node

0.0.455

History Node

0.0.454

History Node

0.0.453

History Node

0.0.452

History Node

0.0.451

History Node

0.0.450

History Node

0.0.441

History Node

0.0.316

History Node

0.0.315

History Node

0.0.314

History Node

0.0.313

History Node

0.0.312

History Node

0.0.311

History Node

0.0.289

History Node

0.0.288

History Node

0.0.287

History Node

0.0.286

History Node

0.0.285

History Node

0.0.284

History Node

0.0.283

History Node

0.0.282

History Node

0.0.281

History Node

0.0.277

History Node

0.0.276

History Node

0.0.275

History Node

0.0.274

History Node

0.0.273

History Node

0.0.272

History Node

0.0.271

History Node

0.0.267

History Node

0.0.266

History Node

0.0.265

History Node

0.0.264

History Node

0.0.263

History Node

0.0.262

History Node

0.0.261

History Node

0.0.236

History Node

0.0.235

History Node

0.0.234

History Node

0.0.233

History Node

0.0.232

History Node

0.0.231

History Node

0.0.230

History Node

0.0.44

History Node

0.0.43

History Node

0.0.42

History Node

0.0.41

History Node

0.0.40

History Node

0.0.39

History Node

0.0.38

History Node

0.0.37

History Node

0.0.36

History Node

0.0.35

History Node

0.0.34

History Node

0.0.33

History Node

0.0.32

History Node

0.0.31

History Node

0.0.28

History Node

0.0.25

History Node

0.0.24

History Node

0.0.23

History Node

0.0.22

History Node

0.0.21

History Node

0.0.3

History Node

0.0.2

Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
axe_selenium_python-1.1.0-py2.py3-none-any.whl (67.8 kB) Copy SHA256 Checksum SHA256 py2.py3 Wheel Sep 4, 2017
axe-selenium-python-1.1.0.tar.gz (64.3 kB) Copy SHA256 Checksum SHA256 Source Sep 4, 2017

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting