DEV Community

Cover image for The most abused Cypress command ever: cy.wait(TIME)

The most abused Cypress command ever: cy.wait(TIME)

Sebastian Clavijo Suero on May 05, 2024

The inexorable(?) ticking TIME bomb! ACT 1: Exposition How often have you seen a cy.wait(5000) in a peer's pull request, or a cy.wai...
Collapse
 
jasonstitt profile image
Jason Stitt

Not sure which is worse, the test suite taking forever to run or the arbitrary interval that may not be correct. Thanks for sharing.

Collapse
 
sebastianclavijo profile image
Sebastian Clavijo Suero

I would say definitely the the application under test that takes that much time to show results to the user. :)

Collapse
 
jasonstitt profile image
Jason Stitt

Good point!

Collapse
 
joydeep100 profile image
Joydeep D

The most comprehensive article on wait management. Great one.

Collapse
 
sebastianclavijo profile image
Sebastian Clavijo Suero • Edited

Thank you very much @joydeep100 ! 🙌

Collapse
 
marktnoonan profile image
Mark Noonan

Nicely written, lots of information, really useful examples, but an approachable style 💯

Collapse
 
sebastianclavijo profile image
Sebastian Clavijo Suero

Thank you @marktnoonan , really appreciated!

Collapse
 
mcondon profile image
Micah Condon

Nice! There is almost always a better option than wait, if you understand exactly what outcome you're really waiting for

Collapse
 
sebastianclavijo profile image
Sebastian Clavijo Suero

Thank you Micah. Glad you found it insightful.

Collapse
 
walmyrlimaesilv profile image
Walmyr

Excellent blog post! Thanks for sharing it.

Collapse
 
sebastianclavijo profile image
Sebastian Clavijo Suero

@walmyrlimaesilv thank you very much! 🤲