Hi, I am trying to use the Window object to pass ...
# e2e-testing
g
Hi, I am trying to use the Window object to pass variables between a cypress test using request to get an authentication token from the backend and then passing that token to a svelte app so that, if cypress is running, can set the token. To do this, I have extended the Window object in svelte and imported this into cypress as well, to add extra properties like authToken. The result so far that request authenticates, receives the token and uses cy.window to set the win.authToken. The test then visits "/" - the svelte app. In the svelte app, if cypress is running then various store values are set from window.authToken (for instance). And the browser should go straight past the authentication screen into the main part of the app. But it does not, it goes to the login screen. Console.log show that the authToken is undefined. So the window found by cy.window() is not updating the window object in the svelte app. Any idea what I am doing wromg? If anyone wants code, just ask.