Cypress Best Practices | Dynamic Wait | Cypress
Vložit
- čas přidán 21. 08. 2024
- The goal of this video is to discuss best practices regarding the use of dynamic waits in comparison with static hard-coded waits. Moreover, I have shared project experience such as what kind of challenges you might face with static waits.
This video is only intended to educate on the best practices.
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.*/
}
})