Recall & Review
beginner
What is command timeout in Cypress?
Command timeout is the maximum time Cypress waits for a command to complete before failing the test. It applies to actions like clicking or typing.
Click to reveal answer
beginner
What does assertion timeout mean in Cypress?
Assertion timeout is the time Cypress waits for an assertion to become true before failing the test. It is used when checking conditions like element visibility or text content.
Click to reveal answer
intermediate
How does Cypress handle command timeout differently from assertion timeout?
Command timeout waits for commands to finish (like clicking). Assertion timeout waits for conditions to be met (like element appears). They control different waiting behaviors.
Click to reveal answer
intermediate
Which timeout would affect
cy.get('.btn').click() if the button takes time to appear?The command timeout affects this because Cypress waits for the button to appear and be clickable before performing the click.
Click to reveal answer
intermediate
Which timeout applies to
cy.get('.msg').should('contain', 'Success')?The assertion timeout applies here because Cypress waits for the message to contain 'Success' before failing the test.
Click to reveal answer
In Cypress, what does the command timeout control?
✗ Incorrect
Command timeout controls how long Cypress waits for commands like click or type to finish.
Which timeout is used when Cypress waits for an element to contain specific text?
✗ Incorrect
Assertion timeout is used when waiting for conditions like text content to appear.
If a button is slow to appear, which timeout affects
cy.get('.btn').click()?✗ Incorrect
Command timeout affects waiting for the button to appear and be clickable.
What happens if an assertion does not pass within the assertion timeout?
✗ Incorrect
If the assertion does not pass within the timeout, Cypress fails the test with a timeout error.
Can command timeout and assertion timeout be configured separately in Cypress?
✗ Incorrect
Cypress allows configuring command timeout and assertion timeout separately.
Explain the difference between command timeout and assertion timeout in Cypress.
Think about what Cypress waits for in each case.
You got /3 concepts.
Describe a scenario where command timeout would cause a test to fail but assertion timeout would not.
Consider waiting for an element before clicking.
You got /3 concepts.