pytest fixture for axe-selenium-python
Project description
pytest fixture for axe-selenium-python
Requirements
You will need the following prerequisites in order to use pytest-axe:
Python 2.7 or 3.6
pytest-selenium >= 3.0.0
axe-selenium-python
Installation
To install pytest-axe:
$ pip install -i https://testpypi.python.org/pypi pytest-axe
Usage
To run tests using pytest-selenium (a dependency of axe-selenium-python), tests must be marked with the non-destructive pytest decorator:
@pytest.mark.nondestructive
def test_my_test_function():
assert true
Test suites using axe-selenium-python must import pytest and the Axe class.
pytest-selenium relies on the base_url fixture, which can be set in a configuration file, or as a command line argument.
Configuration File
[pytest]
base_url = http://www.example.com
Command Line Argument
$ pytest --base-url http://www.example.com
Example Test Function
test_accessibility.py
import pytest
from axe_selenium_python import Axe
import pytest_axe
@pytest.mark.nondestructive
def test_accessibility(self, axe):
response = axe.execute()
assert len(response['violations']) == 0, axe.report()
Resources
CHANGELOG
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
pytest-axe-0.0.171.tar.gz
(2.4 kB
view hashes)
Built Distribution
Close
Hashes for pytest_axe-0.0.171-py2-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d0bdca26989ad06ac5230b477978b188faabf80ad21dca9016b85d65bf117c0b |
|
MD5 | 7ccd861b3b9c2760f316c277866f48e3 |
|
BLAKE2b-256 | 00f0d1d569988acdba3da85b54fd88fdfeacff187edccf3dbc03b39a145f67eb |