Skip to main content

pypom-axe is a PyPOM extension to integrate accessibility tests using the aXe API.

Project description

pypom-axe integrates the aXe accessibility testing API with PyPOM.

License PyPI wheel Issues

Requirements

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

  • Python 2.7 or 3.6

  • PyPOM >= 1.2.0

Installation

To install pypom-axe:

$ pip install pypom-axe

Usage

pypom-axe will run the aXe accessibility checks by default whenever its wait_for_page_to_load() method is called.

If you overload wait_for_page_to_load(), you will need to call super([YOUR CLASS NAME], self).wait_for_page_to_load() within your overloaded method.

base.py

from pypom_axe import AxePage as Page

class Base(Page):

def wait_for_page_to_load(self, context=None, options=None, impact=None):
  super(Base, self).wait_for_page_to_load()
  self.wait.until(lambda s: self.seed_url in s.current_url)
  return self

You also have the option to customize the accessibility analysis using the parameters context, options, and impact. context and options directly reflect the parameters used in axe-core.

impact allows you to specify the impact level you wish to check for.

Running with an impact of minor checks for any violations with a severity of minor or higher.

The same applies to running with an impact of serious.

An impact of critical will only check for critical violations.

from pypom_axe import AxePage as Page

class Base(Page):

def wait_for_page_to_load(self, context=None, options=None, impact=None):
  super(Base, self).wait_for_page_to_load(None, None, 'serious')
  self.wait.until(lambda s: self.seed_url in s.current_url)
  return self

Resources

CHANGELOG

version 0.0.7

  • Modified impact_included class method to reflect changes to the aXe API:

  • There are now only 3 impact levels: 'critical', 'serious', and 'minor'

Project details


Download files

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

Source Distribution

pypom-axe-0.0.6.tar.gz (63.7 kB view hashes)

Uploaded Source

Built Distribution

pypom_axe-0.0.6-py2.py3-none-any.whl (65.1 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page