Giter Club home page Giter Club logo

pypom-axe's Introduction

pypom-axe

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.

You can disable accessibility tests by setting the environment variable ACCESSIBILITY_DISABLED to true.

You can enable output of the JSON results by setting the environment variable ACCESSIBILITY_REPORTING to true. This will output files to ./results/, which must be created if it does not already exist.

base.py

from pypom_axe.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. 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', 'serious' 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.

from pypom_axe.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

pypom-axe's People

Contributors

kimberlythegeek avatar mozilla-github-standards avatar

Watchers

 avatar  avatar

pypom-axe's Issues

CODE_OF_CONDUCT.md file missing

As of January 1 2019, Mozilla requires that all GitHub projects include this CODE_OF_CONDUCT.md file in the project root. The file has two parts:

  1. Required Text - All text under the headings Community Participation Guidelines and How to Report, are required, and should not be altered.
  2. Optional Text - The Project Specific Etiquette heading provides a space to speak more specifically about ways people can work effectively and inclusively together. Some examples of those can be found on the Firefox Debugger project, and Common Voice. (The optional part is commented out in the raw template file, and will not be visible until you modify and uncomment that part.)

If you have any questions about this file, or Code of Conduct policies and procedures, please reach out to [email protected].

(Message COC001)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.