Skip to main content

pytest-axe-playwright-snapshot

A pytest plugin that runs Axe-core on Playwright pages and takes snapshots of the results.

Installation

  1. Install the plugin:

    python3 -m pip install pytest-axe-playwright-snapshot
    
  2. Install Playwright browsers:

    python3 -m playwright install --with-deps
    

Usage

In your tests, use the page fixture from pytest-playwright along with our plugin'saxe_pytest_snapshot fixture. Once you've navigated to a page, call axe_pytest_snapshot with the page fixture as an argument:

from playwright.sync_api import Page

def test_violations(page: Page, axe_pytest_snapshot):
    page.goto("https://www.example.com")
    axe_pytest_snapshot(page)

When you run a test for the first time, you must tell it explicitly to save a snapshot:

pytest --snapshot-update

The plugin will take a snapshot of the page and save it to a file in the snapshots directory. The snapshot directory will be named after the test function, and the file will be named 'violations.txt'.

On subsequent runs, the plugin will compare the latest snapshot against the snapshot and report any difference in the violations.

Metadata

Release files for pytest-axe-playwright-snapshot 0.0.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pytest-axe-playwright-snapshot 0.0.6
File Size Uploaded
pytest_axe_playwright_snapshot-0.0.6.tar.gz 6.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pytest-axe-playwright-snapshot 0.0.6
File Interpreter ABI Platform
pytest_axe_playwright_snapshot-0.0.6-py3-none-any.whl Python 3 none any Details

Total release size: 10.9 kB

Release files / pytest_axe_playwright_snapshot-0.0.6.tar.gz

Download URL pytest_axe_playwright_snapshot-0.0.6.tar.gz
Size 6.8 kB
Tags Source
SHA-256 checksum
How to use checksums
b9844487d73f5f0fd129e7ced998fad20e73e94c2074d7e2d0fdd69e069d4c82
BLAKE2b-256 checksum
How to use checksums
e611c0e6c2d1e56d374eb363492de5844f14bd49a07a36a8eb40bed5b857d953
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.31.0

Release files / pytest_axe_playwright_snapshot-0.0.6-py3-none-any.whl

Download URL pytest_axe_playwright_snapshot-0.0.6-py3-none-any.whl
Size 4.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
74702e978ddfbce5ac5c675d30a4ce0b743c982a3cfe70a3a4c05ac2c1b7c70c
BLAKE2b-256 checksum
How to use checksums
702e8c330adef5d038af3a9a0488247ec73d3cf4804dd49ac84cdf15267b87b1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.31.0

Release history Release notifications | RSS feed

This release

0.0.6 This release

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page