Skip to content

Latest commit

 

History

History

playwright

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

README.md

Playwright + SDK

example.py opens https://the-internet.herokuapp.com headless with Playwright for Python and tracks the full page and the heading element with the Playwright integration of sdk-python, with an ignore area, a diff tolerance and agent details.

Prerequisites

Setup

  • Copy vrt.json.example to vrt.json and set your connection, or use the VRT_* environment variables, which override the file
  • Install dependencies: pip install -r requirements.txt
  • Install the browser: playwright install chromium

Run

python example.py

What to expect

enableSoftAssert is on: the SDK logs a failed check instead of raising, so the script finishes and prints a link to each test run.

  • First run: No baseline for "Home page" and "Heading". The VRT UI shows a build with two new test runs. Approve them to make them the baseline for the branch.
  • Next runs: nothing is logged while the page looks the same. When it changes, Difference found, and the build shows the diff to approve or reject.

Set enableSoftAssert to false to make new and changed screenshots raise an error.