cy.request does not work with followRedirect: false and Set-Cookie in 3.5.0
See original GitHub issueHi! 👋
We have a test where we want to test redirects, unfortunately it breaks after update to cypress 3.6.1 from 3.3.2:
it('test', () => {
cy.request({
url: '/pages/somePage',
followRedirect: false,
}).then(resp => {
expect(resp.status).to.eq(302)
expect(resp.redirectedToUrl).to.eq("https://example.com/")
})
})
Error
CypressError: cy.request() failed trying to load:
http://localhost:8000/pages/somePage
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:
> The "url" argument must be of type string. Received type undefined
Versions
3.6.1
Issue Analytics
- State:
- Created 4 years ago
- Reactions:13
- Comments:10 (2 by maintainers)
Top Results From Across the Web
Cypress cy.visit does not send cookies with request
My cookie was set with the secure: true flag. After setting it to secure: false (Only in the Testing-Environment) the cookie was successfully...
Read more >Changelog - Cypress Documentation
With this change, cy.session() will no longer fail validation when false is ... cy.request() with followRedirect: false would fail if a Set-Cookie header ......
Read more >visit - Cypress Documentation
But if your app makes a request upon being initialized, the above code will not work. cy.visit() will resolve once its load event...
Read more >click - Cypress Documentation
Click a DOM element. It is unsafe to chain further commands that rely on the subject after .click(). Syntax Usage Correct Usage Incorrect...
Read more >@cypress/eslint-plugin-dev: Versions | Openbase
Fixed a bug where cy.route2 would not automatically JSONify an empty array ... cy.request() with followRedirect: false would fail if a Set-Cookie header...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I can confirm this error.
If
followRedirect: false
is defined, the errorThe "url" argument must be of type string. Received type undefined
is thrownI confirm. Same issue for me in 3.6.1. Version 3.6.0 works fine