In Cypress, ** is a wildcard character that can match any number of characters in a URL. Let's say you have this as intercept url '/users/**' , this means that any request with a URL that starts with /users/, regardless of what follows after it, will be intercepted.
Then you can use a wildcard for the URL and the query parameter separately like this: cy.intercept({ method: 'GET', url: '**/secure/**', query: { slug: /abcde.*/ } })
Have you tried the same code in headless mode. Its not working in headless
What does ** mean here in the code. Can you help me
In Cypress, ** is a wildcard character that can match any number of characters in a URL. Let's say you have this as intercept url '/users/**' , this means that any request with a URL that starts with /users/, regardless of what follows after it, will be intercepted.
What if we have query param as **/secure/?slug=abcde ?
Then you can use a wildcard for the URL and the query parameter separately like this:
cy.intercept({
method: 'GET',
url: '**/secure/**',
query: {
slug: /abcde.*/
}
})