Overview - Command timeout vs assertion timeout
What is it?
In Cypress testing, command timeout and assertion timeout are two settings that control how long Cypress waits for actions or checks to complete. Command timeout is the maximum time Cypress waits for a command like clicking or typing to finish. Assertion timeout is the time Cypress waits for a condition in a test assertion to become true. Both help tests handle delays in web page responses or element availability.
Why it matters
Without these timeouts, tests might fail too quickly when a page is slow or elements take time to appear, causing false failures. Proper timeout settings make tests more reliable and reduce flaky test results, saving time and frustration. They help balance waiting long enough for real conditions and failing fast when something is truly broken.
Where it fits
Before learning about these timeouts, you should understand basic Cypress commands and assertions. After this, you can learn about advanced test retries, custom commands, and performance tuning in Cypress.