You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
describe('User login test',()=>{beforeEach(()=>{cy.viewport(1280,1080);cy.visit('');cy.getBySel('login-link').click();});it.only('Simple login story test',()=>{cy.url().should('include','auth');//User has to fill in the field with phone numbercy.getBySel('phone-field').as('phoneField').type('+79289888509');cy.getBySel('login-btn').click();cy.url().should('include','auth/login');cy.getBySel('passwd-field').type('qwertyqwe');cy.contains('button',' Login').click();});});
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
describe('User login test',()=>{beforeEach(()=>{cy.viewport(1280,1080);cy.visit('');cy.getBySel('login-link').click();});it.only('Simple login story test',()=>{cy.url().should('include','auth');//User has to fill in the field with phone numbercy.getBySel('phone-field').as('phoneField').type('+79289888509');cy.getBySel('login-btn').click();cy.url().should('include','auth/login');cy.getBySel('passwd-field').type('qwertyqwe');cy.contains('button','Войти').click();});});
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:
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.
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: