Skip to content

How can I get "request URL" data from the request? #20006

Discussion options

You must be logged in to vote

For those who are stuck on this like me... :)
I have found a solution that met my needs:

If the request is: website.com/1234567?payment_success
then the code is:

cy.intercept(/website\.com\/.*\?payment_success/).as('myAlias')
cy.wait('@myAlias').then((interception) => {
cy.visit(interception.request.url)
})

Here are relevant doc:
https://docs.cypress.io/api/commands/intercept#Using-the-yielded-object

The thread could be closed

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
2 replies
@jjhelguero
Comment options

@MaxAllianov
Comment options

Comment options

You must be logged in to vote
1 reply
@jjhelguero
Comment options

Answer selected by MaxAllianov
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants