Recall & Review
beginner
What is assertion timeout customization in Cypress?
It is the ability to change how long Cypress waits for an assertion to pass before failing the test. This helps when elements or conditions take longer to appear or update.
Click to reveal answer
beginner
How do you set a custom timeout for an assertion in Cypress?
You add the option { timeout: milliseconds } to the command, for example: cy.get('button', { timeout: 10000 }).should('be.visible') waits up to 10 seconds.
Click to reveal answer
beginner
Why might you want to increase assertion timeout in a test?
Because some elements or data may load slowly due to network delays or animations, increasing timeout prevents false test failures by giving more time for the condition to become true.
Click to reveal answer
beginner
What is the default assertion timeout in Cypress?
The default timeout for assertions in Cypress is 4,000 milliseconds (4 seconds).
Click to reveal answer
intermediate
Can you customize assertion timeout globally in Cypress?
Yes, you can set a global default timeout in the Cypress configuration file (cypress.config.js) using the 'defaultCommandTimeout' option.
Click to reveal answer
How do you increase the timeout for a single assertion in Cypress?
✗ Incorrect
You can add { timeout: milliseconds } directly to the command to increase wait time for that assertion.
What happens if an assertion times out in Cypress?
✗ Incorrect
If the assertion does not pass within the timeout, Cypress fails the test and shows a timeout error.
What is the default timeout for assertions in Cypress?
✗ Incorrect
Cypress uses a default timeout of 4000 milliseconds (4 seconds) for assertions.
Where can you set a global default timeout for all commands and assertions in Cypress?
✗ Incorrect
Global timeouts are set in the Cypress configuration file, typically cypress.config.js.
Why is customizing assertion timeout useful?
✗ Incorrect
Increasing timeout helps tests wait longer for elements or conditions that take time to appear.
Explain how to customize assertion timeout for a specific command in Cypress and why you might do this.
Think about slow loading pages or animations.
You got /3 concepts.
Describe how to set a global default timeout for all assertions and commands in Cypress.
Look for configuration settings in Cypress.
You got /3 concepts.