Recall & Review
beginner
What is the purpose of timeout configuration in Cypress tests?
Timeout configuration controls how long Cypress waits for an action or assertion before it fails the test. It helps handle delays in loading or responses.
Click to reveal answer
beginner
How do you set a custom timeout for a single command in Cypress?
You add the
{ timeout: milliseconds } option to the command, for example: cy.get('.btn', { timeout: 10000 }) waits up to 10 seconds.Click to reveal answer
beginner
What is the default timeout for most Cypress commands?
The default timeout is 4,000 milliseconds (4 seconds) for most commands like
cy.get().Click to reveal answer
intermediate
How can you globally change the default timeout for all commands in Cypress?
You can set
defaultCommandTimeout in the cypress.config.js file, for example: defaultCommandTimeout: 10000 sets 10 seconds globally.Click to reveal answer
intermediate
Why is it better to avoid very long timeouts in tests?
Long timeouts can make tests slow and hide real problems. It's better to use reasonable timeouts and fix slow app parts.
Click to reveal answer
What does the timeout option in
cy.get() do?✗ Incorrect
The timeout option tells Cypress how long to wait for the element to appear before it stops and fails the test.
Where do you set the global default timeout for all Cypress commands?
✗ Incorrect
The global timeout is set in the
cypress.config.js file using defaultCommandTimeout.What is the default timeout for most Cypress commands?
✗ Incorrect
Most Cypress commands have a default timeout of 4000 milliseconds (4 seconds).
Why should you avoid setting very long timeouts in tests?
✗ Incorrect
Long timeouts slow down tests and can hide real issues that should be fixed.
How do you set a 10-second timeout for a single
cy.get() command?✗ Incorrect
You pass the timeout option as an object:
{ timeout: 10000 } means 10,000 milliseconds or 10 seconds.Explain how timeout configuration works in Cypress and why it is important.
Think about waiting for things to appear on a webpage during tests.
You got /5 concepts.
Describe how to change the default timeout globally and for a single command in Cypress.
One is in config file, one is in the command itself.
You got /4 concepts.