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

Support Cypress 10 #7

Open
Michael-1 opened this issue Jun 17, 2022 · 2 comments
Open

Support Cypress 10 #7

Michael-1 opened this issue Jun 17, 2022 · 2 comments

Comments

@Michael-1
Copy link

For compatibility for Cypress 10, a few changes are required, notably

  • changing the documentation on how to configure the plugin, moving from cypress/support/index.js to cypress.config.js
  • using excludeSpecPattern instead of ignoreTestFiles
@abrioy
Copy link

abrioy commented Jun 20, 2022

I have a quick fix to get this plugin running with Cypress 10 until it's updated.

If you have this error :

Error running e2e.setupNodeEvents()

The ignoreTestFiles configuration option is now invalid when set on the config object in Cypress version 10.0.0.
It is now renamed to excludeSpecPattern and configured separately as a testing type property: e2e.excludeSpecPattern

You can remplace the config argument of cypressDataSnapshot in cypress.config.ts by an empty object.

const cypressDataSnapshot = require("cypress-data-snapshot/plugin");

function setupNodeEvents(on, config) => {
  cypressDataSnapshot(on, {});

  return config;
}

And add the excludeSpecPattern yourself in the Cypress config.

@abrioy
Copy link

abrioy commented Jun 20, 2022

I don't know if it's because I use @badeball/cypress-cucumber-preprocessor or if it's an issue with Cypress 10, but I get an error when I try and create a snapshot:

Cannot read properties of null (reading 'match')

In order to fix this one I have to override the getTestFilePath command:

Cypress.Commands.add('getTestFilePath', () => {
  return cy.wrap(Cypress.spec.absolute);
});

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

2 participants