Home > Net >  Why Cypress.config('defaultCommandTimeout', 10000); is not working in my script for this s
Why Cypress.config('defaultCommandTimeout', 10000); is not working in my script for this s

Time:01-28

I know there is this solution by adding 'defaultCommandTimeout' in the cypress.json file, but I do not want to add wait in my entire test framework and need to only wait for one particular element. Please go through the screenshots and help me out!

    add.getCountry().type('India');
    Cypress.config('defaultCommandTimeout', 10000);
    add.selectCountry().click();

Cypress result:

cypress result

CodePudding user response:

You can add timeouts to individual cypress commands, something like:

cy.get('.suggestions > ul > li > a', { timeout: 10000 }).should('be.visible')
  •  Tags:  
  • Related