Skip to content

This is a basic Python class that you can add to your UI tests. Add it to your utilities to help with testing.

License

Notifications You must be signed in to change notification settings

vshkodin/vrt-python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Visual Regression Testing (VRT) CLI Tool

This CLI tool is designed to help with visual regression testing by comparing images from two directories (vrt-expected and vrt-actual). It also provides functionality to approve new baseline images.

Features

  • Initialization: Create the necessary directories for storing expected and actual images.
  • Comparison: Compare images in the vrt-expected and vrt-actual directories and generate a difference image if discrepancies are found.
  • Approval: Approve actual images and move them to the vrt-expected directory, renaming them as required.

Installation

pip install vrt-python

Usage

1. Initialize Directories

To set up the necessary directories (vrt-expected and vrt-actual), run:

vrt init

This command will create the following directories:

  • vrt-expected: Where you store your expected baseline images.
  • vrt-actual: Where you store the actual images to compare against the baseline.

2. Compare Images

To compare images between the vrt-expected and vrt-actual directories, run:

vrt compare

This command will:

  • Compare each image in vrt-expected with the corresponding image in vrt-actual.
  • Generate a difference image in the vrt-difference directory if discrepancies are found.
  • Print the percentage of difference for each image.

3. Approve Actual Images

To approve the actual images and move them to the vrt-expected directory, run:

vrt approve

This command will:

  • Copy images from the vrt-actual directory to the vrt-expected directory.
  • Rename the images by replacing the actual_ prefix with expected_.

License

This project is licensed under the MIT License. See the LICENSE file for details.

About

This is a basic Python class that you can add to your UI tests. Add it to your utilities to help with testing.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages