mirror of
https://bitbucket.org/wisemapping/wisemapping-frontend.git
synced 2024-11-22 14:47:56 +01:00
Set threshold for cypress-image-snapshot
This commit is contained in:
parent
5e66f1f160
commit
86780ed0e9
@ -3,7 +3,10 @@ import { addMatchImageSnapshotCommand } from 'cypress-image-snapshot/command';
|
|||||||
// make matchImageSnapshot() call the real implementation only if CYPRESS_imageSnaphots is set
|
// make matchImageSnapshot() call the real implementation only if CYPRESS_imageSnaphots is set
|
||||||
// otherwise it calls a noop
|
// otherwise it calls a noop
|
||||||
if (Cypress.env('imageSnaphots')) {
|
if (Cypress.env('imageSnaphots')) {
|
||||||
addMatchImageSnapshotCommand();
|
addMatchImageSnapshotCommand({
|
||||||
|
failureThreshold: 0.001,
|
||||||
|
failureThresholdType: 'percent',
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
Cypress.Commands.add(
|
Cypress.Commands.add(
|
||||||
'matchImageSnapshot',
|
'matchImageSnapshot',
|
||||||
|
@ -3,7 +3,10 @@ import { addMatchImageSnapshotCommand } from 'cypress-image-snapshot/command';
|
|||||||
// make matchImageSnapshot() call the real implementation only if CYPRESS_imageSnaphots is set
|
// make matchImageSnapshot() call the real implementation only if CYPRESS_imageSnaphots is set
|
||||||
// otherwise it calls a noop
|
// otherwise it calls a noop
|
||||||
if (Cypress.env('imageSnaphots')) {
|
if (Cypress.env('imageSnaphots')) {
|
||||||
addMatchImageSnapshotCommand();
|
addMatchImageSnapshotCommand({
|
||||||
|
failureThreshold: 0.001,
|
||||||
|
failureThresholdType: 'percent',
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
Cypress.Commands.add(
|
Cypress.Commands.add(
|
||||||
'matchImageSnapshot',
|
'matchImageSnapshot',
|
||||||
|
@ -1,12 +1,13 @@
|
|||||||
import { addMatchImageSnapshotCommand } from 'cypress-image-snapshot/command';
|
import { addMatchImageSnapshotCommand } from 'cypress-image-snapshot/command';
|
||||||
import '@testing-library/cypress/add-commands';
|
import '@testing-library/cypress/add-commands';
|
||||||
|
|
||||||
addMatchImageSnapshotCommand();
|
|
||||||
|
|
||||||
// make matchImageSnapshot() call the real implementation only if CYPRESS_imageSnaphots is set
|
// make matchImageSnapshot() call the real implementation only if CYPRESS_imageSnaphots is set
|
||||||
// otherwise it calls a noop
|
// otherwise it calls a noop
|
||||||
if (Cypress.env('imageSnaphots')) {
|
if (Cypress.env('imageSnaphots')) {
|
||||||
addMatchImageSnapshotCommand();
|
addMatchImageSnapshotCommand({
|
||||||
|
failureThreshold: 0.001,
|
||||||
|
failureThresholdType: 'percent',
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
Cypress.Commands.add(
|
Cypress.Commands.add(
|
||||||
'matchImageSnapshot',
|
'matchImageSnapshot',
|
||||||
|
Loading…
Reference in New Issue
Block a user