How to use the cypress-image-snapshot/command.addMatchImageSnapshotCommand function in cypress-image-snapshot

To help you get started, we’ve selected a few cypress-image-snapshot examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github cockroachdb / cockroach-gen / pkg / ui / cypress / support / commands.ts View on Github external
"get",
  (originalFn: typeof cy.get, selector: string, options?: CommandOptions) => {
    const log = options?.log || true;
    const logMessage = options?.logMessage || selector;

    if (log) {
      Cypress.log({
        displayName: "GET",
        message: [logMessage],
      });
    }
    return originalFn(selector, { log: false });
  }
);

addMatchImageSnapshotCommand("matchImageSnapshot", {
  capture: "fullPage",
  failureThreshold: 0.03,
  failureThresholdType: "percent",
});

declare global {
  namespace Cypress {
    interface Chainable {
      stopNode: (nodeId: number) => Chainable;
      decommissionNode: (nodeId: number, wait?: boolean) => Chainable;
      startCluster: () => Chainable;
      teardown: () => Chainable;
      matchImageSnapshot: () => Chainable;
    }

    interface Loggable {

cypress-image-snapshot

Cypress bindings for jest-image-snapshot.

MIT
Latest version published 3 years ago

Package Health Score

51 / 100
Full package analysis

Similar packages