Skip to content

fix: cy.visit() allows the URLs with double dots. #8629

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

Merged
merged 6 commits into from
Sep 25, 2020

Conversation

sainthkh
Copy link
Contributor

Thanks, @ryan-snyder!

User facing changelog

Allows cy.visit() to visit the URLs with .. like https://google.com?q=..

Additional details

  • Why was this change necessary? => Perfectly fine URL was not allowed.
  • What is affected by this change? => N/A
  • Any implementation details to explain? => When there are consecutive dots, it is not a valid URL. But $Location.isUrlLike() treats it's fine. Fixed that issue.

How has the user experience changed?

N/A

PR Tasks

  • Have tests been added/updated?
  • Has the original issue been tagged with a release in ZenHub?
  • [N/A] Has a PR for user-facing changes been opened in cypress-documentation?
  • [N/A] Have API changes been updated in the type definitions?
  • [N/A] Have new configuration options been added to the cypress.schema.json?

Sorry, something went wrong.

@cypress-bot
Copy link
Contributor

cypress-bot bot commented Sep 21, 2020

Thanks for taking the time to open a PR!

@sainthkh sainthkh changed the title fix: cy.visit() allows the URLs with .. fix: cy.visit() allows the URLs with double dots. Sep 21, 2020
@sainthkh sainthkh marked this pull request as ready for review September 21, 2020 07:31
@sainthkh
Copy link
Contributor Author

Flaky tests.

@bahmutov bahmutov requested a review from flotwig September 21, 2020 19:34

Verified

This commit was signed with the committer’s verified signature. The key has expired.
flotwig Zach Bloomquist

Verified

This commit was signed with the committer’s verified signature. The key has expired.
flotwig Zach Bloomquist

Verified

This commit was signed with the committer’s verified signature. The key has expired.
flotwig Zach Bloomquist
Copy link
Contributor

@flotwig flotwig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR @sainthkh, LGTM. I was also curious if we could replace some of the Location methods using the URL API (https://developer.mozilla.org/en-US/docs/Web/API/URL) and it seems to work well.

@sainthkh
Copy link
Contributor Author

@flotwig It's much simpler. LGTM.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

cy.visit() page with baseUrl and two dots doesn't work
2 participants