Additional options for updating images
Is your feature request related to a problem? Please describe.
To avoid issues causes by Windows/Linux rendering, we capture all our screenshots in a separate CI job using the updateImages option. But this has two limitations:
- Missing images are generated regardless of value of
updateImages - All images are captured, not just those for tests that fail
Describe the solution you'd like Two news options:
-
createMissingImages- defaults to true. When false causes compariosn to fail if no 'old' image is found -
updateImagesOnFailure- update images only when comparison fails
Describe alternatives you've considered
I tried implementing updateImagesOnFailure outside the library by catching test failures then updating images, but it's a bit cumbersome and does not handle missing images how I would like.
Please could you let me know your thoughts on this?
Hey! Sorry for some delay, I needed to focus on my day-to-day job.
I think createMissingImages option might be really useful - create a PR for it: https://github.com/FRSOURCE/cypress-plugin-visual-regression-diff/pull/222
Regarding updateImagesOnFailure - I'd say it might be better to add additional possible value to updateImages like updateImages='failures-only' as this option will be connected to updating images themselves (there is no way to update on failure if updateImages=false). What do you think?
Hey, no problem! I have been delayed in replying too 😂
Thank you for creating the PR for createMissingImages, that looks good to me!
Your other suggestion sounds good, I'm working on a PR for that, will let you know when it's open.
Perfect! Keep me updated about your PR! Both of these changes are non-breaking, so they can be released quite quickly - I'll try to release createMissingImages today
Okay, createMissingImages was released in version 3.3.0 - @dhulme you can try it already if you wish!