Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cypress 9.1 open wrong URL when there is a ~ (tilde) in the link #19083

Closed
lephuongbg opened this issue Nov 24, 2021 · 7 comments · Fixed by #19239
Closed

Cypress 9.1 open wrong URL when there is a ~ (tilde) in the link #19083

lephuongbg opened this issue Nov 24, 2021 · 7 comments · Fixed by #19239
Assignees
Labels
topic: network topic: visit Problems with cy.visit command type: bug type: regression A bug that didn't appear until a specific Cy version release v9.1.0 🐛 Issue present since 9.1

Comments

@lephuongbg
Copy link

lephuongbg commented Nov 24, 2021

Current behavior

In Cypress 9.1, some of our tests failed due to Cypress process the URL in visit() calls incorrectly.

This code:

cy.visit('/?q=~%28match_status~%28~%27invoiced%29%29')

causes Cypress to visit this link:

/?q=%5Cx7e%28match_status~%28~%27invoiced%29%29

Note the strange %5Cx7e right after the q=.

Desired behavior

Cypress should not alter the visit URL in anyway.

Test code to reproduce

https://github.com/lephuongbg/cypress-test-tiny/tree/cypress-9.1-url-bug

Quick link to diff:

cypress-io/cypress-test-tiny@master...lephuongbg:cypress-9.1-url-bug

Cypress Version

9.1.0

Other

No response

@lephuongbg
Copy link
Author

lephuongbg commented Nov 29, 2021

These also look like the same issue:

#19084
#19115
#19096

@chrisbreiding chrisbreiding added topic: visit Problems with cy.visit command type: bug type: regression A bug that didn't appear until a specific Cy version release v9.1.0 🐛 Issue present since 9.1 labels Nov 29, 2021
@chrisbreiding
Copy link
Contributor

Thanks for the report and the reproduction. This appears to be a regression, so we'll look into addressing it.

@lephuongbg lephuongbg changed the title Cypress 9.1 open wrong URL when there is a special sequence of characters in the link Cypress 9.1 open wrong URL when there is a ~ (tilde) in the link Dec 2, 2021
@Narretz
Copy link
Contributor

Narretz commented Dec 2, 2021

Hi @chrisbreiding while you're investigating: it appears that this issue also affects requests via cy.request(): #19084

(Fixing one will probably fix the other because both use the cypress-request lib?)

@chrisbreiding
Copy link
Contributor

(Fixing one will probably fix the other because both use the cypress-request lib?)

I think you're right. Here's all the other issues so far reporting this for various commands:

@barboramartinkova
Copy link

We have the same problem with writing a response body into a fixture file, it converts ~ into \7x and then when cypress tries to read from that fixture, it's throwing an error that it's an invalid JSON because of the \ char 😢

@cypress-bot
Copy link
Contributor

cypress-bot bot commented Dec 3, 2021

The code for this is done in cypress-io/cypress#19239, but has yet to be released.
We'll update this issue and reference the changelog when it's released.

@cypress-bot
Copy link
Contributor

cypress-bot bot commented Dec 4, 2021

Released in 9.1.1.

This comment thread has been locked. If you are still experiencing this issue after upgrading to
Cypress v9.1.1, please open a new issue.

@cypress-bot cypress-bot bot locked as resolved and limited conversation to collaborators Dec 4, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
topic: network topic: visit Problems with cy.visit command type: bug type: regression A bug that didn't appear until a specific Cy version release v9.1.0 🐛 Issue present since 9.1
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants