Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

VisTest

PyPI Python CI

Screenshot assertions for Python Playwright and pytest. VisTest marks what changed in the screenshot and describes the change in the test failure.

Baseline, actual screenshot with an added blue underline, and the VisTest diff highlighting the line

Run the demo ↓ · Add a pytest check · Русский

Run the demo

With Python 3.11+, compare two screenshots from the browser corpus. The CLI runs the comparison directly.

python -m pip install vistest==0.2.0a5
curl -fLO https://raw.githubusercontent.com/marshlw/vistest/9cd30b0ad550df84bc0c476c3dca0191b6b9c706/tests/browser_corpus/frames/table/base.png
curl -fLO https://raw.githubusercontent.com/marshlw/vistest/9cd30b0ad550df84bc0c476c3dca0191b6b9c706/tests/browser_corpus/frames/table/underline--on.png
vistest compare base.png underline--on.png

VisTest reports line added: 57×1 px, #2563eb, exits with code 1 for the detected difference, and writes the annotated screenshot to vistest-diff/boxes.png.

Add a pytest check

[browser] installs Playwright and pytest-playwright, which provides the page fixture.

python -m pip install --pre "vistest[browser]"
python -m playwright install chromium

Point the test at your running application and save it as tests/test_visual.py.

from vistest import expect_screenshot


def test_home(page):
    page.goto("http://localhost:8000")
    expect_screenshot(page, "home.png")

Create the missing baseline locally and rerun the comparison.

python -m pytest tests/test_visual.py --vistest-update=missing
python -m pytest tests/test_visual.py

Review and commit the PNG and its renderer metadata under tests/__vistest__/. Add .vistest/ to .gitignore for run artifacts.

On a failure, open .vistest/report/index.html for the baseline, actual screenshot, diff, and changed regions. You can also capture a Playwright locator or mask dynamic areas. Capture options

Run in CI

Pin the runner image and Playwright version. Compare against baselines captured in the same environment. Install pytest-xdist for parallel workers.

python -m pytest tests/test_visual.py -n auto --vistest-require-checks \
  --vistest-json-report=.vistest/results.json

Upload .vistest/ after the job even if pytest fails. Use --vistest-require-snapshots=ci/required.json when a job must compare specific snapshot and platform pairs. CI JSON and manifest format · GitHub Actions example

After reviewing an intentional change, use the baseline path from the failure, relative to tests/__vistest__/.

python -m pytest tests/test_visual.py --vistest-update=changed \
  --vistest-update-snapshot=linux-chromium-1x-1280x720/home.png

To investigate inconsistent verdicts, save one JSON report per run with the same test selection, environment and baseline set.

vistest diagnose run-1.json run-2.json run-3.json

Documentation

Metadata

Release files for vistest 0.2.0a6

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

Source distribution (sdist)

Source distribution for vistest 0.2.0a6
File Size Uploaded Provenance Actions
vistest-0.2.0a6.tar.gz 679.9 kB With provenance Details for vistest-0.2.0a6.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for vistest 0.2.0a6
File Interpreter ABI Platform Actions
vistest-0.2.0a6-py3-none-any.whl Python 3 none any Details for vistest-0.2.0a6-py3-none-any.whl

Total release size: 1.1 MB

Release files / vistest-0.2.0a6.tar.gz

Download URL vistest-0.2.0a6.tar.gz
Size 679.9 kB
Tags Source
SHA-256 checksum
How to use checksums
9dfcc8a1796abf5e2890d732ec2fa5b37dde54005d7303d26c952aa7d6842f90
BLAKE2b-256 checksum
How to use checksums
465fb8bf94783b3afefde48baeefaac19171575a4e30b2d5ac1e1893f1d32232
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 29, 2026.

Transparency log

Release files / vistest-0.2.0a6-py3-none-any.whl

Download URL vistest-0.2.0a6-py3-none-any.whl
Size 418.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d1c72a5b6398d73dfab5478760747ad4946c90dbb53686e4c4a974bae00f0b8e
BLAKE2b-256 checksum
How to use checksums
f90dd6fd2ace76abe43fee417f9d453001d4509738c1f6bb04eff39282c74238
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 29, 2026.

Transparency log

Security for vistest 0.2.0a6

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for vistest-0.2.0a6.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 29, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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