| 6dd74de | | | 1 | // *********************************************** |
| 6dd74de | | | 2 | // This example commands.js shows you how to |
| 6dd74de | | | 3 | // create various custom commands and overwrite |
| 6dd74de | | | 4 | // existing commands. |
| 6dd74de | | | 5 | // |
| 6dd74de | | | 6 | // For more comprehensive examples of custom |
| 6dd74de | | | 7 | // commands please read more here: |
| 6dd74de | | | 8 | // https://on.cypress.io/custom-commands |
| 6dd74de | | | 9 | // *********************************************** |
| 6dd74de | | | 10 | // |
| 6dd74de | | | 11 | // |
| 6dd74de | | | 12 | // -- This is a parent command -- |
| 6dd74de | | | 13 | // Cypress.Commands.add("login", (email, password) => { ... }) |
| 6dd74de | | | 14 | // |
| 6dd74de | | | 15 | // |
| 6dd74de | | | 16 | // -- This is a child command -- |
| 6dd74de | | | 17 | // Cypress.Commands.add("drag", { prevSubject: 'element'}, (subject, options) => { ... }) |
| 6dd74de | | | 18 | // |
| 6dd74de | | | 19 | // |
| 6dd74de | | | 20 | // -- This is a dual command -- |
| 6dd74de | | | 21 | // Cypress.Commands.add("dismiss", { prevSubject: 'optional'}, (subject, options) => { ... }) |
| 6dd74de | | | 22 | // |
| 6dd74de | | | 23 | // |
| 6dd74de | | | 24 | // -- This is will overwrite an existing command -- |
| 6dd74de | | | 25 | // Cypress.Commands.overwrite("visit", (originalFn, url, options) => { ... }) |
| 6dd74de | | | 26 | |
| 6dd74de | | | 27 | import { addMatchImageSnapshotCommand } from 'cypress-image-snapshot/command'; |
| 6dd74de | | | 28 | |
| 6dd74de | | | 29 | // The SSIM comparison method can be used if the pixelmatch is throwing lots of false positives. |
| 6dd74de | | | 30 | // SSIM actually does not catch minute changes in the image, so it is not as accurate as pixelmatch. |
| 6dd74de | | | 31 | // addMatchImageSnapshotCommand({ |
| 6dd74de | | | 32 | // comparisonMethod: 'ssim', |
| 6dd74de | | | 33 | // failureThreshold: 0.01, |
| 6dd74de | | | 34 | // failureThresholdType: 'percent', |
| 6dd74de | | | 35 | // customDiffConfig: { |
| 6dd74de | | | 36 | // ssim: 'fast', |
| 6dd74de | | | 37 | // }, |
| 6dd74de | | | 38 | // blur: 1, |
| 6dd74de | | | 39 | // }); |
| 6dd74de | | | 40 | |
| 6dd74de | | | 41 | addMatchImageSnapshotCommand(); |