Reputation: 67
cy.get('#btnPulisciFiltri', { timeout: 15000 }).should('be.visible').click()
use 15sec but cypress ignore this always have
CypressError Timed out retrying after 4050ms: cy.click() failed because this element:
...
Upvotes: 1
Views: 991
Reputation: 4064
If you want an individual test timeout to exceed the defaultCommandTimeout
, then you will need to tell Cypress as such.
describe("everything", () => {
it("tests something", { defaultCommandTimeout: 20000 }, () => { // <1>
cy.get('#btnPulisciFiltri', { timeout: 15000 }).should('be.visible').click();
});
});
<1> Note the defaultCommandTimeout
setting
The reference for this can be found here - https://docs.cypress.io/guides/references/configuration#Test-specific-Configuration
Upvotes: 0
Reputation: 7163
Fody's answer is perfect for applying the timeout to only one command. If you wanted to apply the timeout globally, you can set the timeout value in your cypress.json
.
{
"defaultCommandTimeout": 15000
}
Upvotes: 1
Reputation: 32128
It's referring to the .click()
which has it's own timeout option
cy.get('#btnPulisciFiltri', { timeout: 15000 })
.should('be.visible')
.click({ timeout: 15000 })
What is the full error message?
Upvotes: 3