You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We're newly integrating Cypress into our project for component testing and have also integrated a snapshot testing plugin for our UI components. However, when I run snapshot testing, it's failing even though the snapshots appear visually identical.
I suspect this might be due to the DPI (Dots Per Inch) settings being different between the devices where the initial snapshots were taken and where the tests are currently running.
What configuration settings can we adjust in Cypress to ensure snapshots are taken that are identical across all devices?
snapshot taken by cy.matchImageSnapshot(image-name)
The text was updated successfully, but these errors were encountered:
GeetanshuGulati
changed the title
Snapshot failing for image having no difference
Configuring Cypres-image-snapshot for Cross-Device Consistency
Jun 1, 2024
Simplest way to solve this is to run your Cypress tests in a Docker container to ensure consistency across platforms. This extends to things like inputs, fonts etc across different platforms.
You will struggle to generate snapshots on a Mac and then run the tests on a Linux OS on a CI machine for example
We're newly integrating Cypress into our project for component testing and have also integrated a snapshot testing plugin for our UI components. However, when I run snapshot testing, it's failing even though the snapshots appear visually identical.
I suspect this might be due to the DPI (Dots Per Inch) settings being different between the devices where the initial snapshots were taken and where the tests are currently running.
What configuration settings can we adjust in Cypress to ensure snapshots are taken that are identical across all devices?
command.ts file:
cypress.config file:
snapshot taken by
cy.matchImageSnapshot(image-name)
The text was updated successfully, but these errors were encountered: