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.274
^^^^^^^^^^^^^^^^
- 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
====================
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.274
^^^^^^^^^^^^^^^^
- 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
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file axe-selenium-python-0.0.274.tar.gz.
File metadata
- Download URL: axe-selenium-python-0.0.274.tar.gz
- Upload date:
- Size: 61.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
83bf74cae1a5987527777ef26a008e0749d8a9a9943f57927391575dfdfa40ad
|
|
| MD5 |
9d4d9d9b682df09405378d3375761180
|
|
| BLAKE2b-256 |
36d5d68bf4651bbc07fc2597311047e24c417f8ce53389001a2cc9cdb147efd6
|
File details
Details for the file axe_selenium_python-0.0.274-py2.py3-none-any.whl.
File metadata
- Download URL: axe_selenium_python-0.0.274-py2.py3-none-any.whl
- Upload date:
- Size: 63.2 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f6be95b56c068c408763b15e2d7f68656e6e296b21f7e70fe4fddc0310435971
|
|
| MD5 |
262ab54b1faab0ce5aa7d5edead34e6e
|
|
| BLAKE2b-256 |
f1235c1dfa9f0939c8fd10064111e6aaa40338fc85d919f37e5a30dc61b2bc5f
|