Current behavior:
Cypress does not support URL encoding at all. Ok I know this is the responsible of the HTTP 'client', but it would be nice if the cy.visit() function would support URL encoding in a similar way as any other JS REST client does.
Just for clarification: I am talking about URL parameters. Not HTTP headers. And also not POST body.
Desired behavior:
cy.visit() should have a parameter params of type object. The passed values in this object will be URL encoded and then all attributes are sent as parameters in the request URL.
Steps to reproduce: (app code and test code)
This code should work:
cy.visit('/search, { params: { searchQuery: "some example string with spaces" }}
// => GET /search?searchQuery=some%20example%20string%20with%20spaces
cy.visit({
method: 'GET',
url: '/fetch
params: {
foo: 'bar'
}
}
// =>GET /fetch?foo=bar
Versions
all cypress versions. Yes ok, this is a feature request.
Current behavior:
Cypress does not support URL encoding at all. Ok I know this is the responsible of the HTTP 'client', but it would be nice if the cy.visit() function would support URL encoding in a similar way as any other JS REST client does.
Just for clarification: I am talking about URL parameters. Not HTTP headers. And also not POST body.
Desired behavior:
cy.visit() should have a parameter params of type object. The passed values in this object will be URL encoded and then all attributes are sent as parameters in the request URL.
Steps to reproduce: (app code and test code)
This code should work:
Versions
all cypress versions. Yes ok, this is a feature request.