0
0
Cypresstesting~10 mins

Command timeout vs assertion timeout in Cypress - Interactive Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to set the command timeout to 10 seconds.

Cypress
cy.get('button', { timeout: [1] })
Drag options to blanks, or click blank then click option'
A10000
B2000
C5000
D30000
Attempts:
3 left
💡 Hint
Common Mistakes
Using seconds instead of milliseconds.
Setting timeout too low causing test failures.
2fill in blank
medium

Complete the code to set the assertion timeout to 5 seconds.

Cypress
cy.get('input').should('be.visible', { timeout: [1] })
Drag options to blanks, or click blank then click option'
A5000
B3000
C10000
D2000
Attempts:
3 left
💡 Hint
Common Mistakes
Confusing command timeout with assertion timeout.
Using too short timeout causing flaky tests.
3fill in blank
hard

Fix the error in the code to correctly set command timeout to 8 seconds.

Cypress
cy.get('div', { timeout: [1] })
Drag options to blanks, or click blank then click option'
A0.8
B8
C'8000'
D8000
Attempts:
3 left
💡 Hint
Common Mistakes
Using seconds instead of milliseconds.
Passing timeout as a string.
4fill in blank
hard

Fill both blanks to set command timeout to 7 seconds and assertion timeout to 3 seconds.

Cypress
cy.get('span', { timeout: [1] }).should('exist', { timeout: [2] })
Drag options to blanks, or click blank then click option'
A7000
B3000
C5000
D10000
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing up command and assertion timeouts.
Using the same timeout for both.
5fill in blank
hard

Fill all three blanks to set command timeout to 6 seconds, assertion timeout to 4 seconds, and check existence.

Cypress
cy.get('section', { timeout: [1] }).should('be.visible', { timeout: [2] }).and('[3]')
Drag options to blanks, or click blank then click option'
A6000
B4000
Cexist
Dbe.enabled
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'be.enabled' instead of 'exist' for presence check.
Confusing assertion timeout with command timeout.