cypress-real-events icon indicating copy to clipboard operation
cypress-real-events copied to clipboard

Support for/compatibility with cy.origins

Open norbertvannobelen opened this issue 2 years ago • 4 comments

The real* commands stop working with the experimental feature experimentalSessionAndOrigin: true, which is required to pass some parameters from one website to another in a scenario I am creating.

The code:

cy.origin('https://123.abc', { args: { someParm } }, ({someParm}) => {
cy.visit('https://123.abc')
cy.contains('someText', {matchCase: false}).realClick({force: true})
})

fails on realClick or on any other part of the real-events package.

Now we have to miss out of the way more practical real events package.

norbertvannobelen avatar Sep 16 '22 20:09 norbertvannobelen

Thats unfortunate. Need to find some time to debug it.

dmtrKovalenko avatar Oct 09 '22 08:10 dmtrKovalenko

Hi @dmtrKovalenko is there any update on this issue?

jbshu4546 avatar Dec 04 '23 18:12 jbshu4546

No updates yet, if you have any issues, the list of problems, or ideas on how to fix them please mention here. Also, PRs are welcome.

dmtrKovalenko avatar Dec 04 '23 19:12 dmtrKovalenko

This may be by design in Cypress, see: https://docs.cypress.io/api/cypress-api/require

Example code with issue remediated:

cy.origin('test.com', { args: { testArg } }, (
        { testArg }
    ) => {
        Cypress.require('cypress-real-events');  
        cy.realPress('Tab')
    })

Make sure to add the following in cypress.config.js

e2e: {
        experimentalOriginDependencies: true,

jbshu4546 avatar Dec 04 '23 19:12 jbshu4546