cypress-image-snapshot
cypress-image-snapshot copied to clipboard
snapFilenameExtension breaks snapshot comparison
Hi,
I configured snapFilenameExtension to an empty string to not have the .snap for each snapshot, but it does seems to break everything.
these are the issues it creates
- does not fail the test if the snapshot is different
- it modifies the original snapshot
it does however still creates a .diff snapshot, which is normal.
this is my current config
const options: CypressImageSnapshotOptions = {
failureThreshold: 0.1,
allowSizeMismatch: true,
failureThresholdType: 'percent',
capture: 'viewport',
comparisonMethod: 'ssim',
customSnapshotsDir: `./cypress/reports/mochareports/snapshots/something`,
e2eSpecDir: Cypress.spec.relative,
snapFilenameExtension: '',
};
I tried to remove the snapFilenameExtension and add the .snap on each snapshot and then everything works fine.
Just to clarify the issue, you were aiming to not have the .snap at all?
- cypress/snapshots/someTest/takes a snapshot of the page.snap.png
+ cypress/snapshots/someTest/takes a snapshot of the page.png
Hi @simonsmith
That is what I indeed want, but it seems that using the option breaks stuff
Just looking again at this because it might be similar to #61
There is a test here that asserts that a snapshot is created without the .snap extension. In your example above can you perhaps reduce the options down to as little as possible to see if that works?
I'm wondering if it's another option you've added that is causing a problem
Hi, sorry I completely forgot to respond.
From my testing it seems related to the configuration option retries of cypress. With retries not set to 0, I can see when debugging cypress that the snapshots actually fails and it has a created a diff image but cypress itself does not flag it as a failed test.
It seems you do not have a test case for this, would it be useful to add one? It might just be a cypress issue in the end