Open LuizVithor opened 1 month ago
I had similar problem those weeks and in the end it was about queuing cy commands since they are async.
I moved my wait
in "cy.request.toTrigger.then" block and specified which exactly response to wait.
cy.request().then(res=>{
....
})
If it suits your case, I found where to look for my conditions here: Docs: cy.request(Yields)
So, from what I understand, the error is only in 204 requests, instead of it returning the status code "204" in the interception, it returns an error, for now I'm aligning it with my back end so it doesn't send 204 anymore, but this It bothers me because 204 is not an error, but a success
We'd need a way to test this ourselves to narrow it down. It does seem strange.
Current behavior
I'm making requests in an api but when I'm using Cypress it returns error 400 or net::ERR_EMPTY_RESPONSE on a specific route with a specific method, but when I access it in a normal browser, other than Cypress, it works normally.
Literally the same request but in Cypress it gives an error...
in some cases it gives the error "net::ERR_EMPTY_RESPONSE" and in others it gives a 400 error bringing an api error but the same request in the normal browser works.
My cypress.config.ts:
I noticed that most, if not all requests that give an error, in the normal browser return 204 no content
Desired behavior
it should have just been successful and the interception returned a common request with statuscode 204, as 204 is not an http error
Test code to reproduce
I'm not going to have a test code, but basically I was simulating a website and one of the requests I needed to make, returned 204, and I realized that all that returned 204 gave an error
Cypress Version
13.13.1
Node version
v20.12.1
Operating System
windows 11
Debug Logs
No response
Other
No response