simonsmith/cypress-image-snapshot

Snapshots with images randomly fails on firefox

Closed this issue · 3 comments

Hi,

we currently have components where we have assets some text. All snapshots are taken on firefox, chrome and edge.

Both edge and chrome are always fine, but firefox keeps randomly failing them because the image seems different (which is not case).

my setting are as follows

const options: CypressImageSnapshotOptions = {
			failureThreshold: 0.01,
			allowSizeMismatch: true,
			failureThresholdType: 'percent',
			capture: 'viewport',
			comparisonMethod: 'ssim',
			customSnapshotsDir: `./cypress/reports/mochareports/snapshots/${Cypress.spec.fileName}`,
			e2eSpecDir: Cypress.spec.relative,
			snapFilenameExtension: '.snap',
};

when using just the cypress screenshot without the plugging and comparing multiples run screenshots, it works. those are never different, so something must be wrong with this package.

test1 diff
test2 diff

The image comparison is handled by jest-image-snapshot so if you think you have a reproducible issue I'd report it there as this package simply calls it with your options

Hi @simonsmith, i created a repo where the issue is reproducible. here are the steps to reproduce the issue:

  1. build the docker image
  2. run the docker image with pnpm run cypress:run
  3. check the diff folder with failed snapshots

Hey @simonsmith

It would be awesome if you could have a look and create an issue in their repo if needed 😄
You are the probably the best person to explain it correctly, so they can investigate.
In case you don't want I will make an issue in their repository myself