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

Add ability to call cy.visit(url) with string and URL type #22687

Open
tit opened this issue Jul 6, 2022 · 1 comment
Open

Add ability to call cy.visit(url) with string and URL type #22687

tit opened this issue Jul 6, 2022 · 1 comment
Labels
E2E Issue related to end-to-end testing topic: visit Problems with cy.visit command Triaged Issue has been routed to backlog. This is not a commitment to have it prioritized by the team. type: enhancement Requested enhancement of existing feature

Comments

@tit
Copy link

tit commented Jul 6, 2022

What would you like?

Sometimes I need to pass the url parameter to the cy.visit() method not as a string, but as a URL type.

class PageObjectLogin {
  constructor() {
    this.url = new URL('https://example.com/auth')
  }

  visit(loginChallenge) {
    const url = new URL(this.url.href)
    url.searchParams.append('login_challenge', loginChallenge)

    cy.visit(url.href)
  }
}

Synthetic example

Why is this needed?

Sometimes the address to go to is formed dynamically. It will be convenient if it can be generated via the URL type.

Other

No response

@cypress-bot cypress-bot bot added the stage: investigating Someone from Cypress is looking into this label Jul 11, 2022
@chrisbreiding
Copy link
Contributor

Thanks for the feature request. We'll take it under consideration.

@cypress-bot cypress-bot bot added stage: routed to e2e-core and removed stage: investigating Someone from Cypress is looking into this labels Jul 12, 2022
@chrisbreiding chrisbreiding removed their assignment Jul 13, 2022
@chrisbreiding chrisbreiding added type: enhancement Requested enhancement of existing feature topic: visit Problems with cy.visit command E2E-core labels Jul 13, 2022
@mschile mschile added triage and removed triage labels Aug 18, 2022
@nagash77 nagash77 added E2E Issue related to end-to-end testing and removed E2E-core labels Nov 8, 2022
@nagash77 nagash77 added Triaged Issue has been routed to backlog. This is not a commitment to have it prioritized by the team. and removed routed-to-e2e labels Apr 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
E2E Issue related to end-to-end testing topic: visit Problems with cy.visit command Triaged Issue has been routed to backlog. This is not a commitment to have it prioritized by the team. type: enhancement Requested enhancement of existing feature
Projects
None yet
Development

No branches or pull requests

5 participants