Skip to main content

Pytest plugin that auto-reports test results with screenshots to VisionSpec

Project description

pytest-visionspec

Pytest plugin that auto-reports test results with screenshots to VisionSpec.

Install

pip install pytest-visionspec

Setup

Set two environment variables:

VS_API_KEY=vs_your_project_api_key
VS_API_URL=https://visionspec-dev.helpfulhuman.xyz

Usage

Tag tests with @pytest.mark.vs("journey-id"):

@pytest.mark.vs("login-happy-path")
def test_login(page):
    page.goto("/login")
    page.fill("[name=email]", "user@example.com")
    page.click("button[type=submit]")
    assert page.url == "/dashboard"

The plugin automatically:

  1. Captures a Playwright screenshot after each test
  2. Uploads it to VisionSpec storage
  3. Posts the result (pass/fail + screenshot URL) to VisionSpec

Markers

  • @pytest.mark.vs("journey-id") — link test to a VisionSpec journey spec
  • @pytest.mark.vs_surface("mobile") — override the reported surface (default: desktop)

Page fixture detection

By default, the plugin looks for a page fixture. Configure custom fixture names in pyproject.toml:

[tool.pytest.ini_options]
vs_page_fixtures = ["v2app", "v1app", "page"]

The plugin checks each name in order and uses the first one it finds.

Environment variables

Variable Required Description
VS_API_KEY Yes Project API key from VisionSpec
VS_API_URL Yes VisionSpec server URL
VS_SUT_VERSION No Version of the system under test
VS_VERBOSE No Set to 1 for debug logging
VS_VERSION No App version metadata
VS_FRONTEND_VERSION No Frontend version metadata
VS_BACKEND_VERSION No Backend version metadata

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pytest_visionspec-0.2.1.tar.gz (5.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pytest_visionspec-0.2.1-py3-none-any.whl (5.8 kB view details)

Uploaded Python 3

File details

Details for the file pytest_visionspec-0.2.1.tar.gz.

File metadata

  • Download URL: pytest_visionspec-0.2.1.tar.gz
  • Upload date:
  • Size: 5.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.12

File hashes

Hashes for pytest_visionspec-0.2.1.tar.gz
Algorithm Hash digest
SHA256 e7d319b6a87216e6503228234ab8fce6e8691d52da872afeb8cdf12e45c5364f
MD5 f3d7aa77cd0dbcf90a76f0a1ffc7c1b1
BLAKE2b-256 143983a2ae5069421e97cfa631a9241b423858a42091f95566bd5ebe4ce7788b

See more details on using hashes here.

File details

Details for the file pytest_visionspec-0.2.1-py3-none-any.whl.

File metadata

File hashes

Hashes for pytest_visionspec-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f1d8208fef5923dec3c538488bcb8557228844318f454d7a6c60437185e7c346
MD5 ff020aa280e22ca689de2a2d9a75eb66
BLAKE2b-256 15e76aaef77f4258d9c6527f326f0c260593504b5dae668171c3e21d1e599830

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page