A plugin to compare image snapshot
npm i git+https://github.com/MrDant/cypress-goldentest-plugin.git
./cypress.config.js
import { defineConfig } from 'cypress';
import goldenTest from 'cypress-golden-test'
export default defineConfig({
e2e: {
...
setupNodeEvents(on, config) {
goldenTest(on, config)
},
},
...
});
./cypress/support/e2e.(js/ts)
import goldenTest from "cypress-golden-test/src/command";
./cypress/exemple.cy.js
describe("Home goldenTest", () => {
it("goldenTest", () => {
cy.visit("/");
cy.get("header");
cy.goldenTest();
});
});