Why Cypress.config('defaultCommandTimeout', 10000); is not working in my script for this suggestive drop-down button which shall wait for 10s

Viewed 520

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

1 Answers

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

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