-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Open
Description
🚀 Feature Request
It should be quite safe for most apps to store the snapshot images at half resolution. This should give enough fidelity for visual regression testing, but would cut file size by 40-75% depending on how much entropy is in the image.
The algorithm would be something like:
- run with
--update-snapshots- the snapshot is taken from the browser, scaled down and, if different, scaled written to disc in its scaled down version. - run otherwise - the snapshot is taken from the browser, scaled down and, if different from the scaled down version on disc, the test fails.
So long as the same scaling algorithm was used between runs (ie, the same interpolation, colour spaces etc), this would provide almost as good a guarantee that the rendering is correct for most apps, for a significantly smaller size in the repo.
Example
.toHaveScreenshot(fileName, { scale: 0.5 });Motivation
the tests will be just as effective at detecting visual regressions for almost all apps, but with a much smaller size in repositories
Metadata
Metadata
Assignees
Labels
No labels