-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Cypress blocks web app's inner xhr requests #29843
Comments
Just switched off blocking uncaught exception if it helps |
The problem is in that cypress blocks the requests with the same domain but different ports. For example, I have frontend on http://localhost:3000/ and backend server running on http://localhost:8000/. Requests to frontend are addressed fine, but all the requests to backend issued like XHR are blocked. I found the workaround -- added alias on localhost like 127.0.0.1 localhost back.localhost --- that solved the problem but created another one with httponly cookies -- axios refuse to match domains. So that a pitty it turns out cypress are not able testing spa apps. There is the discussions connected to my problem direcly #26154 so I would say it's not my unique problem. |
Can You provide example repo that reproduce the problem? |
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. |
Current behavior
I test an SPA web app that issues hxr requests sent under the hood and triggered by visiting some pages. So they are triggered by
cy.visit()
method.The problem exists on mac only. It works fine on windows.
I have rather the simple test
The test fails with cypress info.
Browser's console shows that all the XHR sent failed with EMPTY RESPONSE ERR
If I try to test the same using Selenium Web Driver or manually -- everything is OK.
If I paste the url of API endpoint to ordinary browser outside the cypress -- everything is OK.
But if I paste the same in the browser launched via cypress it fails -- displays nothing because of empty response
I can't get why it stoped working cause it was OK initially some time. I guess it can be connected with cross origin browser's constrains but I can't explain why it goes with cypress only. Neither manually nor by Selenium nor pytest it haven't been reproduced.
Desired behavior
The test passes and all the inner XHR passes too.
Test code to reproduce
Cypress Version
13.13.0
Node version
v21.6.2
Operating System
macOS Sohoma 14.5
Debug Logs
Here is some log info it's seen that some requests left without response
No response
Other
No response
The text was updated successfully, but these errors were encountered: