Skip to content

Commit 833fd54

Browse files
committed
feat: Add threshold usage test
1 parent ec3b27b commit 833fd54

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

cypress/specs/image-diff-spec.js

+5
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@ it('should compare screenshot of the entire page', () => {
33
cy.compareSnapshot('wholePage')
44
})
55

6+
it('should compare screenshot of the entire page', () => {
7+
cy.visit('../../report-example.html')
8+
cy.compareSnapshot('wholePageThreshold', 0.2)
9+
})
10+
611
it('should compare screenshot from a given element', () => {
712
cy.visit('../../report-example.html')
813
cy.get('#report-header').compareSnapshot('element')

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"main": "dist/command.js",
66
"scripts": {
77
"test:unit": "jest src/",
8-
"test:e2e": "npx run build && cypress run --browser chrome",
8+
"test:e2e": "npm run build && cypress run --browser chrome --headless",
99
"build": "npx babel src -d dist"
1010
},
1111
"repository": {

0 commit comments

Comments
 (0)