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.
- Initialization: Create the necessary directories for storing expected and actual images.
- Comparison: Compare images in the
vrt-expectedandvrt-actualdirectories and generate a difference image if discrepancies are found. - Approval: Approve actual images and move them to the
vrt-expecteddirectory, renaming them as required.
pip install vrt-pythonTo set up the necessary directories (vrt-expected and vrt-actual), run:
vrt initThis 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.
To compare images between the vrt-expected and vrt-actual directories, run:
vrt compareThis command will:
- Compare each image in
vrt-expectedwith the corresponding image invrt-actual. - Generate a difference image in the
vrt-differencedirectory if discrepancies are found. - Print the percentage of difference for each image.
To approve the actual images and move them to the vrt-expected directory, run:
vrt approveThis command will:
- Copy images from the
vrt-actualdirectory to thevrt-expecteddirectory. - Rename the images by replacing the
actual_prefix withexpected_.
This project is licensed under the MIT License. See the LICENSE file for details.