Python library to integrate axe and selenium for web accessibility testing.
Project description
axe-selenium-python
====================
axe-selenium-python integrates aXe and selenium to enable automated web accessibility testing.
.. image:: https://img.shields.io/badge/license-MPL%202.0-blue.svg
:target: https://github.com/kimberlythegeek/axe-selenium-python/blob/master/LICENSE.txt
:alt: License
.. image:: https://img.shields.io/pypi/v/axe-selenium-python.svg
:target: https://pypi.org/project/axe-selenium-python/
:alt: PyPI
.. image:: https://img.shields.io/github/issues-raw/kimberlythegeek/axe-selenium-python.svg
:target: https://github.com/kimberlythegeek/axe-selenium-python/issues
:alt: Issues
Requirements
------------
You will need the following prerequisites in order to use pytest-html:
- Python 2.7 or 3.6
- pytest-selenium >= 3.0.0
Installation
------------
To install axe-selenium-python:
.. code-block:: bash
$ pip install axe-selenium-python
Usage
-----
To run tests using pytest-selenium (a dependency of axe-selenium-python), tests must be marked with the non-destructive pytest decorator:
.. code-block:: python
@pytest.mark.nondestructive
def test_my_test_function:
. . .
Test suites using axe-selenium-python must import pytest and the Axe class.
Tests not using the axe pytest fixture must use the selenium pytest fixture.
pytest-selenium relies on the `**base_url** <https://github.com/pytest-dev/pytest-base-url>`_ fixture, which can be set in a configuration file, or as a command line argument.
Configuration File
******************
.. code-block:: ini
[pytest]
base_url = http://www.example.com
Command Line Argument
*********************
.. code-block:: bash
$ pytest --base-url http://www.example.com
Example Test Function
*********************
*test_accessibility.py*
.. code-block:: python
import pytest
from axe_selenium_python import Axe
@pytest.mark.nondestructive
def test_accessibility(self, selenium):
axe = Axe(selenium)
response = axe.execute()
assert len(response['violations']) == 0, axe.report()
Resources
---------
- `Issue Tracker <http://github.com/kimberlythegeek/axe-selenium-python/issues>`_
- `Code <http://github.com/kimberlythegeek/axe-selenium-python/>`_
CHANGELOG
---------
version 0.0.272
^^^^^^^^^^^^^^^^
- Added selenium instance as a class attribute
- Changed file paths to OS independent structure
- Fixed file read operations to use with keyword
- Added usage example to README
version 0.0.21
^^^^^^^^^^^^^^
- Fixed include of aXe API file and references to it
- Updated README
====================
axe-selenium-python integrates aXe and selenium to enable automated web accessibility testing.
.. image:: https://img.shields.io/badge/license-MPL%202.0-blue.svg
:target: https://github.com/kimberlythegeek/axe-selenium-python/blob/master/LICENSE.txt
:alt: License
.. image:: https://img.shields.io/pypi/v/axe-selenium-python.svg
:target: https://pypi.org/project/axe-selenium-python/
:alt: PyPI
.. image:: https://img.shields.io/github/issues-raw/kimberlythegeek/axe-selenium-python.svg
:target: https://github.com/kimberlythegeek/axe-selenium-python/issues
:alt: Issues
Requirements
------------
You will need the following prerequisites in order to use pytest-html:
- Python 2.7 or 3.6
- pytest-selenium >= 3.0.0
Installation
------------
To install axe-selenium-python:
.. code-block:: bash
$ pip install axe-selenium-python
Usage
-----
To run tests using pytest-selenium (a dependency of axe-selenium-python), tests must be marked with the non-destructive pytest decorator:
.. code-block:: python
@pytest.mark.nondestructive
def test_my_test_function:
. . .
Test suites using axe-selenium-python must import pytest and the Axe class.
Tests not using the axe pytest fixture must use the selenium pytest fixture.
pytest-selenium relies on the `**base_url** <https://github.com/pytest-dev/pytest-base-url>`_ fixture, which can be set in a configuration file, or as a command line argument.
Configuration File
******************
.. code-block:: ini
[pytest]
base_url = http://www.example.com
Command Line Argument
*********************
.. code-block:: bash
$ pytest --base-url http://www.example.com
Example Test Function
*********************
*test_accessibility.py*
.. code-block:: python
import pytest
from axe_selenium_python import Axe
@pytest.mark.nondestructive
def test_accessibility(self, selenium):
axe = Axe(selenium)
response = axe.execute()
assert len(response['violations']) == 0, axe.report()
Resources
---------
- `Issue Tracker <http://github.com/kimberlythegeek/axe-selenium-python/issues>`_
- `Code <http://github.com/kimberlythegeek/axe-selenium-python/>`_
CHANGELOG
---------
version 0.0.272
^^^^^^^^^^^^^^^^
- Added selenium instance as a class attribute
- Changed file paths to OS independent structure
- Fixed file read operations to use with keyword
- Added usage example to README
version 0.0.21
^^^^^^^^^^^^^^
- Fixed include of aXe API file and references to it
- Updated README
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
Close
Hashes for axe-selenium-python-0.0.272.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2cc38fc409444cc02adb2531f4912e35b6f75bf0fd09d00a2c5cc5ebe4d65e37 |
|
MD5 | 0121b06b2a1198d21a22c168e7659f5f |
|
BLAKE2b-256 | d59b4ffe1729e3f3df5a151a90a366e2f47364fbf1212458c2e3f8f2dd0b89a4 |
Close
Hashes for axe_selenium_python-0.0.272-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e5024a222fe790d7673a4cc8dd6fc0100d95de4d3be105839d1501fe77979d8d |
|
MD5 | 8d85c9531166061f592834b0ec86a9bc |
|
BLAKE2b-256 | ee500a3ea2459832eb56a49cb01184b386b9b37e55704a9165aee1bf96104756 |