jaredpalmer / cypress-image-snapshot

Catch visual regressions in Cypress
MIT License
887 stars 160 forks source link

Image Size Issues on gitlab Ci #196

Open Temi89 opened 3 years ago

Temi89 commented 3 years ago

Hi there is there a way to ignore image size as this is a major blocker on CI or is there a work around .

Currently I am having to capture base images on Ci and would have been nice to update base images without having to push to ci .

I have also tried specifying view port but still get the same issue as well as using the "clip" configuration resulting to the same issues.

Error: Image size (200x102) different than saved snapshot size (100x52) Switching the viewport to a default preset almost does it but still fails : Error: Image size (704x51) different than saved snapshot size (704x52).

I am also using the following configs : addMatchImageSnapshotCommand({ failureThreshold: 0.1, // threshold for entire image failureThresholdType: 'percent', // percent of image or number of pixels customDiffConfig: {threshold: 0.2}, // threshold for each pixel capture: 'viewport', // capture viewport clip: { x: 0, y: 0, width: 10000, height: 100 } });

For capture object (I have used all 3 possible options and still same issue)

Any suggestion will be appreciated please.

melibe23 commented 3 years ago

I am having the same issue, did you find a solution? @Temi89 image

hassanzohaib commented 2 years ago

@melibe23 is there any way to add diff images to any kind of report file?

melibe23 commented 2 years ago

@hassanzohaib Yes, the plugin offers one Run Cypress with --reporter cypress-image-snapshot/reporter in order to report snapshot diffs in your test results. This can be helpful to use with --env failOnSnapshotDiff=false in order to quickly view all failing snapshots and their diffs

And here someone tried to injected them on mochawesome reports https://stackoverflow.com/questions/62141050/inject-cypress-image-snapshot-diff-images-to-mochawesome-reports

i didn't test either of them, but hope it is helpful.