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

Intercepted request never happens when using cy.session #19232

Closed
wlsf82 opened this issue Dec 3, 2021 · 4 comments
Closed

Intercepted request never happens when using cy.session #19232

wlsf82 opened this issue Dec 3, 2021 · 4 comments
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

Comments

@wlsf82
Copy link

wlsf82 commented Dec 3, 2021

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

@wlsf82
Copy link
Author

wlsf82 commented Dec 3, 2021

Cc @miltonbsn.

@jennifer-shehane jennifer-shehane added the topic: session Issues when using session command label Dec 3, 2021
@wlsf82
Copy link
Author

wlsf82 commented Dec 13, 2021

Update: We are not using the cy.session feature anymore in the BR Modelo App project.
Instead, we use programmatic login, which solves our issue and makes our tests faster.
When I say it solves our issue, I mean that when logging in programmatically, all requests happen correctly, and we can successfully wait for the intercepted ones.

@mjhenkes mjhenkes added this to the 11.0 milestone May 6, 2022
@mjhenkes mjhenkes assigned mschile and unassigned emilyrohrbough May 13, 2022
@nagash77 nagash77 removed this from the experimentalSessionAndOrigin GA milestone Jul 18, 2022
@nagash77 nagash77 added E2E Issue related to end-to-end testing topic: auth and removed E2E-auth labels Nov 8, 2022
@mschile mschile removed their assignment Apr 26, 2023
@cypress-app-bot
Copy link
Collaborator

This issue has not had any activity in 180 days. Cypress evolves quickly and the reported behavior should be tested on the latest version of Cypress to verify the behavior is still occurring. It will be closed in 14 days if no updates are provided.

@cypress-app-bot cypress-app-bot added the stale no activity on this issue for a long period label May 15, 2023
@cypress-app-bot
Copy link
Collaborator

This issue has been closed due to inactivity.

@cypress-app-bot cypress-app-bot closed this as not planned Won't fix, can't repro, duplicate, stale Jun 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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
Projects
None yet
Development

No branches or pull requests

7 participants