cypress-io / cypress

Fast, easy and reliable testing for anything that runs in a browser.
https://cypress.io
MIT License
47.07k stars 3.19k forks source link

Replace x.top: experimentalSourceRewriting does not solve the issue on Cypress: "13.15.0" #30421

Open fderraz opened 1 month ago

fderraz commented 1 month ago

Current behavior

Hello,

My Cypress test fails because the home page is not loaded:

(uncaught exception)TypeError: top.getTabFrom is not a function 
(uncaught exception)TypeError: top.getParamWindow is not a function
 The following error originated from your application code, not from Cypress. > top.getTabFrom is not a function

I addedto the cypress.json file, the following params: “experimentalSourceRewriting”: true Except that it doesn't fix my problem

Version Cypress: "13.15.0"

Any suggestions you may have to solve this problem, will be appreciated :)

Error

Please find enclosed my code: Test.cy.js The following code snippet corrects the loading problem, except that it's not a relevant solution because the win.top is used everywhere in the application under Test ==> it's not possible to include it after each click.

cy.window().then((win) => {
        win.top.getTabFrom = win.top[0].getTabFrom; 
        win.top.getParamWindow = win.top[0].getParamWindow; 
    });
Test

Desired behavior

Display the content of the Home Page

Test code to reproduce

Test

Cypress Version

13.15.0

Node version

v20.18.0

Operating System

Windows 10 Professionnel

Debug Logs

No response

Other

No response

fderraz commented 1 week ago

Hello Jennifer Shehane,

Could you please share with me the existing workaround that you have taged?

Thanks.