Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

snapFilenameExtension breaks snapshot comparison #48

Open
maximegheraille opened this issue Feb 22, 2024 · 2 comments
Open

snapFilenameExtension breaks snapshot comparison #48

maximegheraille opened this issue Feb 22, 2024 · 2 comments
Assignees

Comments

@maximegheraille
Copy link

maximegheraille commented Feb 22, 2024

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.

@simonsmith simonsmith self-assigned this Feb 22, 2024
@simonsmith
Copy link
Owner

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

@maximegheraille
Copy link
Author

maximegheraille commented Feb 23, 2024

Hi @simonsmith

That is what I indeed want, but it seems that using the option breaks stuff

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants