Hi everyone
First of all, thank for your great job. We are trying this plugin and give us exactly what we need... until now :)
Preconditions
CRA (Create react app) fresh installed with npx
cypress installed (version 4.9.0)
cypress-image-snapshot installed (version 3.1.1)
addMatchImageSnapshotCommand added to cypress/support/commands.js without any parameter. Just use the default behavior. (I've tried also with the options given in the README and get the same result)
addMatchImageSnapshotPlugin added to cypress/plugins/index.js
test created calling cy.matchImageSnapshot('root'); in cypress/visual.spec.js
script "cy:run":"cypress run" added in package.json
In one bash terminal: npm start to run the react app
In another bash terminal: npm run cy:run
2.1 Also tried to run previously npm run cy:open to create the cypress folder and the cypress.json config file
Actual and Expected result
Expected behavior
When the test run, cypress-image-snapshot shoudl check if a previous screenhost has been taken, As for the first run, it will see there is not previous screenshot, so it will create a new one.
The test shouldn't fail, becasue there is no previous screenshot to compare.
Actual behavior:
The test fails with a message:
- Error: Image was NaN% different from saved snapshot with undefined different pixels. See diff for details: undefined
But also, if the test is failing, the plugin should create a cypress/snapshots/__diff_output__ folder with. This folder is not created when the test fails.
My files
support/commands.js
import { addMatchImageSnapshotCommand } from "cypress-image-snapshot/command";
addMatchImageSnapshotCommand();
Hi everyone First of all, thank for your great job. We are trying this plugin and give us exactly what we need... until now :)
Preconditions
npx
cypress
installed (version 4.9.0)cypress-image-snapshot
installed (version 3.1.1)addMatchImageSnapshotCommand
added tocypress/support/commands.js
without any parameter. Just use the default behavior. (I've tried also with the options given in the README and get the same result)addMatchImageSnapshotPlugin
added tocypress/plugins/index.js
cy.matchImageSnapshot('root');
incypress/visual.spec.js
"cy:run":"cypress run"
added inpackage.json
npm --version
: 6.13.4 8.3node --version
: 12.10.0Steps to reproduce
npm start
to run the react appnpm run cy:run
2.1 Also tried to run previouslynpm run cy:open
to create thecypress
folder and thecypress.json
config fileActual and Expected result
Expected behavior
When the test run,
cypress-image-snapshot
shoudl check if a previous screenhost has been taken, As for the first run, it will see there is not previous screenshot, so it will create a new one. The test shouldn't fail, becasue there is no previous screenshot to compare.Actual behavior:
The test fails with a message:
But also, if the test is failing, the plugin should create a
cypress/snapshots/__diff_output__
folder with. This folder is not created when the test fails.My files
support/commands.js
cypress/plugins/index.js
cypress/visual.spec.js
package.json
Log