question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

cy.request does not work with followRedirect: false and Set-Cookie in 3.5.0

See original GitHub issue

Hi! 👋

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:closed
  • Created 4 years ago
  • Reactions:13
  • Comments:10 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
jkroepkecommented, Nov 11, 2019

I can confirm this error.

If followRedirect: false is defined, the error The "url" argument must be of type string. Received type undefined is thrown

2reactions
Postavshikcommented, Nov 13, 2019

I confirm. Same issue for me in 3.6.1. Version 3.6.0 works fine

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found