Skip to main content

Open source, self hosted solution for visual testing and managing results of visual testing.

Project description

Python SDK for Visual Regression Tracker

Codacy Badge Codacy Badge

Install

pip install visual_regression_tracker

Usage

Import

from visual_regression_tracker import VisualRegressionTracker, Config, TestRun

Configure connection

config = Config(
    # apiUrl - URL where backend is running 
    apiUrl='http://localhost:4200',

    # project - Project name or ID
    project='Default project',

    # apiKey - User apiKey
    apiKey='tXZVHX0EA4YQM1MGDD',

    # ciBuildId - Current git commit SHA
    ciBuildId='commit_sha',

    # branch - Current git branch 
    branchName='develop',

    # enableSoftAssert - Log errors instead of exceptions
    enableSoftAssert=False,
)

vrt = VisualRegressionTracker(config)

Setup / Teardown

As context manager:

with vrt:
    ...
    # track test runs
    ...

Without context manager:

vrt.start()
...
# track test runs
...
vrt.stop()

Assert

vrt.track(TestRun(
    # Name to be displayed
    # Required
    name='Image name',

    # Base64 encoded string
    # Required
    imageBase64=image,

    # Allowed mismatch tollerance in %
    # Optional
    # Default: 0%
    diffTollerancePercent=1,

    # Optional
    os='Mac',

    # Optional
    browser='Chrome',

    # Optional
    viewport='800x600',

    # Optional
    device='PC',

    # Array of areas to be ignored
    ignoreAreas=[
        IgnoreArea(
            # X-coordinate relative of left upper corner
            # Required
            x=10,
            # Y-coordinate relative of left upper corner
            # Required
            y=20,
            # Area width in px
            # Required
            width=300,
            # Height width in px
            # Required
            height=400
        )
    ],
))

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

visual_regression_tracker-4.5.0.tar.gz (8.6 kB view details)

Uploaded Source

Built Distribution

visual_regression_tracker-4.5.0-py2.py3-none-any.whl (9.7 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file visual_regression_tracker-4.5.0.tar.gz.

File metadata

  • Download URL: visual_regression_tracker-4.5.0.tar.gz
  • Upload date:
  • Size: 8.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.3

File hashes

Hashes for visual_regression_tracker-4.5.0.tar.gz
Algorithm Hash digest
SHA256 d1decf893558a7b776dcea4e068819914eb406ffec6f59596a3d08c226998515
MD5 36265af2653b355ebb6e4e578eb1a4ff
BLAKE2b-256 6f016a76fef835727764cf7472e321fd8d1927bb95a1e2ff816196c03b48dcb2

See more details on using hashes here.

Provenance

File details

Details for the file visual_regression_tracker-4.5.0-py2.py3-none-any.whl.

File metadata

  • Download URL: visual_regression_tracker-4.5.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 9.7 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.3

File hashes

Hashes for visual_regression_tracker-4.5.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 b8c2ecbb5cb09d4b981001075fe3348a6e09738206f71b84c33dab5d0e5aed41
MD5 26415d9133f076e1b118148cf0f906bc
BLAKE2b-256 fce33450a0b3b956ebcf8e02b1a77bec54b321862909db4f123cb6bfe035fa7d

See more details on using hashes here.

Provenance

Supported by

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