Intercepted request never happens when using cy.session #19232
Labels
E2E
Issue related to end-to-end testing
stale
no activity on this issue for a long period
topic: auth
topic: session
Issues when using session command
type: bug
Current behavior
I’m having an issue that only happens when using the experimental
cy.session
command.Let me explain it.
I’m testing an app that has the following stack: Angular JS in the frontend, express for the server, and MongoDB as a database.
When using
cy.session
with the server pointing to a local MongoDB, everything works fine. However, when pointing the server to a remote MongoDB, after the user logs in (with or without the session cached), a request that I expect doesn’t happen after a visit to a page, and so the tests fail when I try to wait for the alias I gave to the intercept.The only way to make it work when pointing to the remote MongoDB is not to use
cy.session
, but then, tests get slower (because they always have to login via the GUI).Here’s a comment from the repo where I’m facing the issue so that you can try to reproduce it (if you want it) brmodeloweb/brmodelo-app#254 (comment).
Has anyone faced an issue like this? Could this be an issue with
cy.session
?Any help is appreciated.
Desired behavior
I expect that
cy.session
should work when the server points to a remote MongoDB, as it does when pointing to a local one.Test code to reproduce
For details, see this comment from the project where the issue is happening brmodeloweb/brmodelo-app#254 (comment).
To setup the local MongoDB, I had to use the second answer from this StackOverflow question https://stackoverflow.com/questions/58034955/read-only-file-system-when-attempting-mkdir-data-db-on-mac.
Cypress Version
9.1.0
Other
No response
The text was updated successfully, but these errors were encountered: