Skip to main content

The Selenium Accessibility Project

Project description

The Selenium Accessibility Package

Get basic accessibility information using the axe-core npm library on websites visited using Selenium.

Contact Deque for more information about axe™ functionality and results.

Note: This project does not support all of the features available in axe™, but is provided for the flexibility and convenience of Ruby users.

Prerequisites

  • Install python

  • Install pip

  • Install npm

Installing

$ pip install sa11y

Usage

Just pass in a valid driver instance to the Analyze class constructor and call the #results method.

driver = webdriver.Chrome() Analyze(driver).results()

By default, sa11y inspects elements in all frames and iframes on the page. If your site does not use frames, you can improve performance slightly by turning off frame checks:

driver = webdriver.Chrome() analyze = Analyze(driver, frames=false) analyze.results()

By default, sa11y does not inspect frames from cross origins. If you need to analyze frames originating from a different domain, you need to turn this on:

driver = webdriver.Chrome() analyze = Analyze(driver, cross_origin=false) analyze.results()

This gem comes packaged with the latest axe™ version at release. If you want to change this, specify the JS library you want to use:

driver = webdriver.Chrome() js_lib = open(“tests/resources/old.axe.min.js”, “r”).read() Analyze(driver, js_lib=js_lib).results()

Development

This project will be developed in Python 3.x so please create a virtual environment:

python3 -m venv venv

source venv/bin/activate

To install dependencies, do the following:

pip install -r requirements.txt

To install required scripts:

python setup.py npm_install

Deployment

The project needs to include a dynamically generated axe.min.js file, and can be built with this command:

python setup.py npm_install install sdist

To release, makes sure you have twine installed and run:

twine upload -r pypi dist/*

Contributing

Please read [CONTRIBUTING.md](../CONTRIBUTING.md) for details on our process for submitting pull requests to us, and please ensure you follow the [CODE_OF_CONDUCT.md](../CODE_OF_CONDUCT.md).

Versioning

We use [SemVer](http://semver.org/) for versioning. For the versions available, see the [tags on this repository](https://github.com/saucelabs/sa11y/tags).

Acknowledgments

Testing

To run all tests, run the following:

pytest

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

sa11y-0.2.3-py3-none-any.whl (114.6 kB view details)

Uploaded Python 3

File details

Details for the file sa11y-0.2.3-py3-none-any.whl.

File metadata

  • Download URL: sa11y-0.2.3-py3-none-any.whl
  • Upload date:
  • Size: 114.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.9.6

File hashes

Hashes for sa11y-0.2.3-py3-none-any.whl
Algorithm Hash digest
SHA256 7ffa3b41b57f1d69955bb14384e6f145853e2df3250b29818e8797e71925af69
MD5 9e33508098bd412c80c63d1da93b0f3e
BLAKE2b-256 8c61adc52114868600760c73ef5160fb61a3d192385814049857a7146a03bd21

See more details on using hashes here.

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