Description
Describe the Bug
Discussed in #230
Given the following context:
On my side, I have set up a folder with some reference images (e.g. "reference_images/logo.png", "reference_images/progressBar.png", "reference_images/form.png"
When I run a test case, the screenshots are saved in a folder called "visual_testing". This folder is defined through the option "pluginVisualRegressionImagesPath" on Cypress config.
I then compare the images, one by one on my test script using cy.matchImage({ matchAgainstPath: 'reference_images/logo.png' }) and so on...
This works fine when just comparing the images, but when I want to update a reference image using the "Update screenshot" button, it doesn't work, because it updates the screenshots on the "visual_testing" folder instead of the ones on the "reference_images" folder.
Steps to reproduce
- Set up a folder with some reference images (e.g. "reference_images/logo.png", "reference_images/progressBar.png", "reference_images/form.png"
- Define a folder called "visual_testing" through the option "pluginVisualRegressionImagesPath" on Cypress config
- Call
.matchImage({ matchAgainstPath: 'reference_images/logo.png' })
and the other reference images as well on your script - Run the test case once using Cypress GUI
- Make some changes to the element you're testing, so that it has a visual difference higher than the threshold applied
- Run the test a second time. When the error appears, click on "See comparison" and click on the "Update screenshot" button
- The screenshot is saved in the "visual_testing" folder instead of updating the image in the "reference_images" folder
Expected behavior
The baseline images should be updated when the "Update screenshot" button is clicked
Additional context
Cypress v12.16.0
Package version
3.3.10
Device
PC
OS and version
Windows 10
Browser and version
Chrome, Edge
Node version
16.14.0
I can work on it by myself
- Yes
- No
Code of Conduct
- I agree to follow this project's Code of Conduct