Skip to content

Commit 9d253bd

Browse files
committed
Adding example to README.md
1 parent 54efe37 commit 9d253bd

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,17 @@ You can target a single HTML element as well:
8383
cy.get('#my-header').compareSnapshot('just-header')
8484
```
8585

86+
You can pass arguments to `cy.screenshot()` as well, in that case the error threshold can be passed as `errorThreshold` property of object:
87+
88+
```js
89+
it('should display the login page correctly', () => {
90+
cy.visit('/03.html');
91+
cy.compareSnapshot('login', {
92+
capture: 'fullPage',
93+
errorThreshold: 0.1
94+
});
95+
});
96+
```
8697
> Looking for more examples? Review [docker/cypress/integration/main.spec.js](https://github.com/mjhea0/cypress-visual-regression/blob/master/docker/cypress/integration/main.spec.js).
8798
8899

0 commit comments

Comments
 (0)