Registry / testing / axe-playwright-python

axe-playwright-python

JSON →
library0.1.7pypypiunverified

Axe Playwright Python facilitates automated web accessibility testing by integrating the axe-core engine with Playwright. It allows developers to scan web pages for accessibility violations within their Playwright test suites. The current version is 0.1.7. Release cadence appears to be irregular, with updates typically occurring every few months based on the project's changelog, often driven by updates to the underlying axe-core JavaScript library.

testing
Install & Compatibility
Where this runs
tested against v0.1.1 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
glibc
py 3.10
✓ —
✓ 3.58s
py 3.11
✓ —
✓ 3.3s
py 3.12
✓ —
✓ 3.08s
py 3.13
✓ —
✓ 3s
py 3.9
✕ build_error
✓ 3.9s
94MB installed
● package 94MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

from axe_playwright_python.sync_playwright import Axe

Used for setting up Playwright in synchronous tests.

from playwright.sync_api import sync_playwright

This quickstart demonstrates how to initialize Axe, launch a Playwright browser, navigate to a page, run an accessibility scan, and print the number of violations. It also includes an example of iterating through detected violations.

from playwright.sync_api import sync_playwright from axe_playwright_python.sync_playwright import Axe axe = Axe() with sync_playwright() as playwright: browser = playwright.chromium.launch() page = browser.new_page() page.goto("https://www.google.com") results = axe.run(page) browser.close() print(f"Found {results.violations_count} violations.") if results.violations_count > 0: print("Accessibility violations found:") for violation in results.violations: print(f" - {violation['id']}: {violation['description']} (Impact: {violation['impact']})") print(f" Help: {violation['helpUrl']}") else: print("No accessibility violations found.")
Debug
Known footguns
breakingPlaywright removed its built-in `page.accessibility` API. Users migrating from older Playwright versions or examples might try to use this deprecated method, leading to `AttributeError` or similar errors.
gotchaUpgrades to the underlying `axe-core` JavaScript engine (which `axe-playwright-python` wraps) can lead to changes in the number, type, or severity of reported accessibility violations. This means test results might differ across `axe-playwright-python` versions even if the application under test remains unchanged.
gotchaWhile PyPI classifiers for `axe-playwright-python` indicate compatibility with Python >=3.8, the project's explicit dependencies section specifies `Python >= 3.10`. Users on Python 3.8 or 3.9 might encounter unexpected runtime issues or compatibility problems.
gotchaDepending on the browser and `axe-core` integration, popup blockers might interfere with `axe.run()` if it attempts to open a new window for analysis. This can lead to the scan failing or hanging.
Upgrade
Version history

Breaking-change detection hasn't run for this library yet.

Audit
Security & dependencies

CVE tracking and dependency tree are planned for a later release.

Agent activity
18 hits · last 30 days
gptbot
4
ahrefsbot
4
bingbot
3
bytedance
3
script
1
googlebot
1
chatgpt-user
1
Resources