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

Update plugin to be compatible with Cypress 10 #259

Closed
admah opened this issue May 26, 2022 · 15 comments · Fixed by #266
Closed

Update plugin to be compatible with Cypress 10 #259

admah opened this issue May 26, 2022 · 15 comments · Fixed by #266
Labels

Comments

@admah
Copy link

admah commented May 26, 2022

Hello 👋 I'm writing on behalf of the Cypress DX team. We wanted to notify you that some changes may need to be made to this plugin to ensure that it works in Cypress 10.

For more information, here is our official plugin update guide.

@JoyceNg331
Copy link

Yes, kindly help, i'm usingCypress 10.0 facing the below installation issue.

PS C:\Cypress\OneIntel-Cypress> npm install cypress-real-events
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: [email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/cypress
npm ERR! cypress@"^10.0.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer cypress@"^4.x || ^5.x || ^6.x || ^7.x || ^8.x || ^9.x" from [email protected]
npm ERR! node_modules/cypress-real-events
npm ERR! cypress-real-events@"*" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR! See C:\Users\ngmeiche\AppData\Local\npm-cache\eresolve-report.txt for a full report.

@willoliveira-air
Copy link

Hello.

We are facing the same issue right now when installing the dependencies. Even though it is a warning, this fix will be useful.
warning " > [email protected]" has incorrect peer dependency "cypress@^4.x || ^5.x || ^6.x || ^7.x || ^8.x || ^9.x".

Thanks

@Abcmsaj
Copy link

Abcmsaj commented Jun 10, 2022

Bump! We've got the same issue as it's limited to v9

@dmtrKovalenko
Copy link
Owner

dmtrKovalenko commented Jun 10, 2022

Yes I need some time to do this, unfortunately won’t have free time to work on open source in the nearest future.

If somebody will open PR I will be happy to revie it

@yegorkay
Copy link

@dmtrKovalenko I believe there is a PR that opened up yesterday:

#266

@dmtrKovalenko
Copy link
Owner

I think it must have some updates to work with cypress v10

@JoyceNg331
Copy link

JoyceNg331 commented Jun 11, 2022 via email

@dmtrKovalenko
Copy link
Owner

Need to test, but very likely — yes

@mmonteiroc
Copy link

likely

Means that you actually wont be able to even update. NPM install will crash, as this library will tell you that doesnt support cypress 10

@lmiller1990
Copy link

lmiller1990 commented Jun 25, 2022

I installed with yarn v1 and it's working fine with Cypress 10. Also, the Cypress code base is using this internally and it's working great. I don't think any code changes are necessary.

The only blocker is newer package managers will complain about the version in package.json. You can just do --force for now to install it. The package itself functions correctly once installed.

@joshwooding
Copy link
Contributor

I'm using it with yarn v3 with Cypress 10 and it works great.

@dmtrKovalenko
Copy link
Owner

Ok then I’ll update the version and publish today. Sorry for the delay.

@kris-luminar
Copy link

How do you import this plugin into Cypress 10? The instructions in the README are still for Cypress < 10.

Register new commands by adding this to your cypress/support/index.{js,ts} file.

import "cypress-real-events/support";

This fails with a message saying

Reference Error: Cypress is not defined

my config file looks like

/// <reference types='cypress' />

const { defineConfig } = require('cypress');

module.exports = defineConfig({
    e2e: {
        setupNodeEvents(on, config) {
            return require('cypress-real-events/support')(on, config);
        }
    }
});

@lmiller1990
Copy link

lmiller1990 commented Jul 26, 2022

That is your cypress.config.ts, or config file, what you want to do is import it in cypress/support/index.js (now called cypress/support/{e2e,component}.js.

setupNodeEvents executes in the Node.js context - you want the cypress-real-events in the supportFile, that runs on the browser before every test.

@dmtrKovalenko
Copy link
Owner

🎉 This issue has been resolved in version 1.7.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Successfully merging a pull request may close this issue.

10 participants