Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: User should expect that the baseline images will get updated when the "Update screenshot" button is clicked #259

Open
2 of 3 tasks
velosoLB opened this issue Jun 27, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@velosoLB
Copy link

velosoLB commented Jun 27, 2023

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

  1. Set up a folder with some reference images (e.g. "reference_images/logo.png", "reference_images/progressBar.png", "reference_images/form.png"
  2. Define a folder called "visual_testing" through the option "pluginVisualRegressionImagesPath" on Cypress config
  3. Call .matchImage({ matchAgainstPath: 'reference_images/logo.png' }) and the other reference images as well on your script
  4. Run the test case once using Cypress GUI
  5. Make some changes to the element you're testing, so that it has a visual difference higher than the threshold applied
  6. Run the test a second time. When the error appears, click on "See comparison" and click on the "Update screenshot" button
  7. 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
@velosoLB velosoLB added the bug Something isn't working label Jun 27, 2023
@mduivcap
Copy link

We're experiencing the same issue with a similar structure (snapshot folder is not the default folder), the baseline image is not being updated when clicking the update screenshot button.
The workaround is to manually delete this image and run the test again so it will be created again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants