Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Python library to integrate axe and selenium for web accessibility testing.
selenium-axe-python integrates aXe and selenium to enable automated web accessibility testing.
Originally created as axe-selenium-python by Kimberly Sereduck. Unfortunately she is no longer assigned to the project which means the original project has gone stale. This is a fork of that project with some updates.
This version of selenium-axe-python is using axe-core@4.9.1
You will need the following prerequisites in order to use selenium-axe-python:
selenium >= 4.7.0
Python 3.8
The appropriate driver for the browser you intend to use, downloaded and added to your path, e.g. geckodriver for Firefox:
To install selenium-axe-python:
$ pip install selenium-axe-python
from selenium import webdriver
from selenium_axe_python import Axe
def test_google():
driver = webdriver.Firefox()
driver.get("http://www.google.com")
axe = Axe(driver)
# Inject axe-core javascript into page.
axe.inject()
# Run axe accessibility checks.
results = axe.run()
# Write results to jsfile
axe.write_results(results, 'a11y.json')
driver.close()
# Assert no violations are found
assert len(results["violations"]) == 0, axe.report(results["violations"])
The method axe.run()
accepts two parameters: context
and options
.
For more information on context
and options
, view the aXe documentation here.
You want to contribute? Great! Here are the things you should do before submitting your PR:
dev
install the project package:
pip install -e .[dev]
poetry install --extras dev
tox
to perform tests frequently.The original project required you to run npm install
(or in most cases did it at install for you) but this
limited the use of the package to systems that have npm. This fork includes the latest version of
axe-core.
You can run the tests using tox:
$ tox
Alternatively you can use the makefile in the root of the repo:
$ make pre-check-in
axe-core@4.9.1
axe-core@4.8.3
axe-core@4.7.2
Breaks backwards compatibility:
execute
has been renamed to run
to mirror the method in the axe-core API.All functionalities that are not part of axe-core have been moved into a separate package, pytest-axe
. This includes:
run_axe
helper methodget_rules
Axe class methodrun
Axe class methodimpact_included
Axe class methodanalyze
Axe class method.The purpose of this change is to separate implementations that are specific to the Mozilla Firefox Test Engineering team,
and leave the base selenium-axe-python
package for a more broad use case. This package was modeled off of Deque's
Java package, axe-selenium-java, and will now more closely mirror it.
All functionalities can still be utilized when using selenium-axe-python
in conjunction with pytest-axe
.
ACCESSIBILITY_REPORTING=true
. The files will be written to results/
directory, which must be created if it does not already exist.ACCESSIBILITY_DISABLED=true
.axe-core@2.6.1
FAQs
Python library to integrate axe and selenium for web accessibility testing.
We found that selenium-axe-python demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.