cypress: cy.request() fails in 3.5.0
Current behavior:
A simple cy.request() test failed after upgrading to 3.5.0. The URL has two 302 redirects.
https://XXX/backoffice (302)-> https://XXX/backoffice/ (302)-> https://XXX/backoffice/login.zul (200)
cy.request({
url: link,
retryOnStatusCodeFailure: true,
retryOnNetworkFailure: true,
});
Cypress Error:
CypressError: cy.request() failed trying to load:
https://XXX/backoffice
We attempted to make an http request to this URL but the request failed without a response.
We received this error at the network level:
> true
-----------------------------------------------------------
The request we sent was:
Method: GET
URL: https://XXX/backoffice
-----------------------------------------------------------
Common situations why this would fail:
- you don't have internet access
- you forgot to run / boot your web server
- your web server isn't accessible
- you have weird network configuration settings on your computer
The stack trace for this error is:
Error: true
at maybeWrapAsError (C:\Users\mriehema\AppData\Local\Cypress\Cache\3.5.0\Cypress\resources\app\packages\server\node_modules\bluebird\js\release\util.js:61:12)
at C:\Users\mriehema\AppData\Local\Cypress\Cache\3.5.0\Cypress\resources\app\packages\server\node_modules\bluebird\js\release\nodeback.js:38:50
at Chrome._handleMessage (C:\Users\mriehema\AppData\Local\Cypress\Cache\3.5.0\Cypress\resources\app\packages\server\node_modules\chrome-remote-interface\lib\chrome.js:256:17)
at WebSocket.<anonymous> (C:\Users\mriehema\AppData\Local\Cypress\Cache\3.5.0\Cypress\resources\app\packages\server\node_modules\chrome-remote-interface\lib\chrome.js:234:22)
at WebSocket.emit (events.js:194:13)
at Receiver.receiverOnMessage (C:\Users\mriehema\AppData\Local\Cypress\Cache\3.5.0\Cypress\resources\app\packages\server\node_modules\ws\lib\websocket.js:789:20)
at Receiver.emit (events.js:194:13)
at Receiver.dataMessage (C:\Users\mriehema\AppData\Local\Cypress\Cache\3.5.0\Cypress\resources\app\packages\server\node_modules\ws\lib\receiver.js:422:14)
at C:\Users\mriehema\AppData\Local\Cypress\Cache\3.5.0\Cypress\resources\app\packages\server\node_modules\ws\lib\receiver.js:379:23
at C:\Users\mriehema\AppData\Local\Cypress\Cache\3.5.0\Cypress\resources\app\packages\server\node_modules\ws\lib\permessage-deflate.js:298:9
at C:\Users\mriehema\AppData\Local\Cypress\Cache\3.5.0\Cypress\resources\app\packages\server\node_modules\ws\lib\permessage-deflate.js:376:7
at afterWrite (_stream_writable.js:485:3)
at onwrite (_stream_writable.js:476:7)
at InflateRaw.afterTransform (_stream_transform.js:94:3)
at Zlib.processCallback (zlib.js:560:8)
Desired behavior:
The same tests works in Cypress 3.4.1. Calling the URL https://XXX/backoffice manually works too (200 after two 302).
Versions
Cypress 3.5.0 with Chrome Windows 10 and macOS
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 2
- Comments: 17 (9 by maintainers)
Works! Thanks everyone!!
Are you guys setting cookies for auth during your redirects? @srideeps I notice that you’re getting a 403, could that be because the expected cookies are not being set on redirect?
Setting cookies on a redirect is partially broken in 3.5.0, but there is a fix already: #5432
Let me know if this fits your situation.