Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cy.task('Matching image snapshot') failed with the following error #235

Open
lasithdilshan20 opened this issue Dec 8, 2021 · 7 comments

Comments

@lasithdilshan20
Copy link

Hi, I'm using image snapshot lib and I got the following issue with it.

image

@mersanuzun
Copy link

I faced the same issue. Which cypres version do you use? I use cypress: 10.1.0 so that I added following code to my cypress.config.ts file and it was solved for me.

// cypress.config.ts
import {addMatchImageSnapshotPlugin} from 'cypress-image-snapshot/plugin';

export default defineConfig({
    ...restConfigs
    setupNodeEvents(on, config) {
        addMatchImageSnapshotPlugin(on, config);
    },
    ...restConfigs
});

@believer-ufa
Copy link

believer-ufa commented Jul 28, 2022

Little addition: you need to set setupNodeEvents inside e2e or component config sections as described in Cypress documentation.

@jxe142
Copy link

jxe142 commented Jul 28, 2022

Has this been resolved? I am using Cypress 9 and still have this issue

@believer-ufa
Copy link

that's not an issue. you just need properly configure your plugin, instructions already given above.

@robbertvancaem
Copy link

robbertvancaem commented Jul 30, 2022

I ran into this as well and thought it might help to share the full cypress.config.js I have:

const { defineConfig } = require('cypress')
const { addMatchImageSnapshotPlugin } = require('cypress-image-snapshot/plugin')

module.exports = defineConfig({
  e2e: {
    setupNodeEvents(on, config) {
      // implement node event listeners here
      addMatchImageSnapshotPlugin(on, config)
    },
  }
})

As you can see, there's no need to create a plugins folder with configuration anymore.

Cypress version: 10.3.1

@Estherokafor05
Copy link

Kudos, this just fixed my error

@Pavel-Y96
Copy link

Pavel-Y96 commented May 26, 2023

Thanks you so much! )) (c)0990. 4599===2sd

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants