cypress set timeout for locator 1

cypress set timeout for locator

cy
  .get('.mobile-nav', { timeout: 10000 }) // 10 seconds
  .should('be.visible')

Here is what the above code is Doing:
1. Visit the page
2. Wait for the element with the class “mobile-nav” to be visible
3. Assert that the element is visible

Similar Posts