Search code examples
javascriptcypress

Increase Timeout for specific its-Method of cypress.io


With cypress.io get-Method we can define a timeout only valid for this specific get-method call:

cy.get('.mobile-nav', { timeout: 10000 })

Is there a way to define a timeout for a specific its-method call like:

cy.window().its('MyClass')

Or do I need to increase defaultCommandTimeout in cypress.json?


Solution

  • Place this in the its block before you want it used:

    Cypress.config('defaultCommandTimeout', 10000);
    

    Cypress.config() documentation