MrDant / cypress-goldentest-plugin

Cypress plugin to compare image snapshot

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cypress goldentest plugin

A plugin to compare image snapshot

Install

npm i git+https://github.com/MrDant/cypress-goldentest-plugin.git

Setup

./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";

To use

./cypress/exemple.cy.js

describe("Home goldenTest", () => {
  it("goldenTest", () => {
    cy.visit("/");
    cy.get("header");
    cy.goldenTest();
  });
});

About

Cypress plugin to compare image snapshot


Languages

Language:JavaScript 100.0%