Registry / testing / pytest-playwright-visual

pytest-playwright-visual

JSON →
library2.1.2pypypiunverified

A pytest fixture for visual testing with Playwright. Version 2.1.2 (released 2025). Active development with monthly releases.

pip install pytest-playwright-visual
INSTALL
IMPORT
SIG · PYTEST-PLAYWRIGHT-
P
pytest-playwright-visual
testingpythonv2.1.2
Install
5.9s avg
Import
Disk
194MB
Pass rate
5/ 10
Env Coverage5 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v2.1.2 · 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
py 3.103.95 runs
build_error
glibc
py 3.103.95 runs
installs and imports cleanly · install 5.9s · import 0.000s · 195MB
194MB installed
● package 194MB
Code
Verified usage

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

VisualPlugin
from pytest_playwright_visual import VisualPlugin
from pytest_playwright_visual.plugin import VisualPlugin

Basic visual test using the page fixture (provided by pytest-playwright). First run creates snapshots; subsequent runs compare.

import pytest from playwright.sync_api import Page def test_visual(page: Page): page.goto('https://example.com') page.screenshot(path='screenshot.png') # snapshot auto-created on first run
Debug
Known issues
breakingv2.0 restructured snapshot folder from flat to hierarchical: snapshots/<file_name>/<test_name>/<test_name>[browser][os].png. All existing snapshots must be moved/recreated.
fix
Re-run tests with --update-snapshots after removing old snapshots, or manually restructure folders.
affects: >=2.0.0
breakingv2.0 fails on --update-snapshots to force users to manually review images. Tests will fail if snapshots are updated without manual review.
fix
Use --update-snapshots with caution; expect test failure to prompt manual review. Or use v1.x if automatic update is needed.
affects: >=2.0.0
gotchaSnapshot name argument ('snapshot_name') is optional in v2.0+. Default name is auto-generated as test_name[browser][os].png. If you explicitly pass a name, it may conflict with the auto-generated one.
fix
Either omit snapshot_name to use default, or ensure unique names.
affects: >=2.0.0
Upgrade
Version history
2.1.2latest on PyPI · released Apr 28, 2022
Audit
Dependencies
pytestrequiredTest framework
playwrightrequiredBrowser automation
Agent activity
24 hits · last 30 days
node
22
Resources
pytest-playwright-visual — pip install pytest-playwright-visual · libregistry