cy.wrap does not respect timeout
See original GitHub issueThis example spec file fails with the error below:
describe('Cypress wait', () => {
it('wrap does not wait', () => {
cy.wrap(
new Promise((resolve) => setTimeout(resolve, 5000)), {timeout: 20000});
});
});
Cypress wait
1) wrap does not wait
0 passing (4s)
1 failing
1) Cypress wait wrap does not wait:
Error: Cypress command timeout of '4000ms' exceeded.
at http://localhost:57838/__cypress/runner/cypress_runner.js:103532:25
Shouldn’t cy.wrap
respect the timeout
option? The test passes if I pass --config defaultCommandTimeout=6000
on the command line, but I want to pass a specific timeout for this cy.wrap
command.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:6
- Comments:9 (3 by maintainers)
Top Results From Across the Web
Cypress Test timeout on then() not respecting timeout option
I've been trying to figure out when the . then() function in Cypress is not respecting the timeout option. The then() function is...
Read more >wrap - Cypress Documentation
If the promise is rejected, cy.wrap() will fail the test. cy.wrap() will automatically retry until all chained assertions have passed. Timeouts.
Read more >cypress-io/cypress - Gitter
hey guys, Cypress does not seem to respect the pageLoadTimeout setting on the ... but then cy.wrap() times out and says CypressError: Timed...
Read more >cypress-wait-until - npm
nested cy.waitUntil calls don't respect timeout options. timeout and interval are converted to a number of retries. If the parent ...
Read more >8 Tricks I Learned From Cypress - Blog - ServMask
In other words, Cypress waits for a selector within a certain timeout. It's most likely that you're going to interact with DOM, so...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hello here is a workaround to force Cypress to wait for a promise:
And in-use example
Released in
4.8.0
.This comment thread has been locked. If you are still experiencing this issue after upgrading to Cypress v4.8.0, please open a new issue.