0
0
Cypresstesting~10 mins

cy.wait() for explicit waiting in Cypress - Interactive Code Practice

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

Complete the code to wait explicitly for 2 seconds before continuing the test.

Cypress
cy.[1](2000);
Drag options to blanks, or click blank then click option'
Apause
Bwait
Cdelay
Dsleep
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'pause' or 'sleep' instead of 'wait'.
Not specifying the time in milliseconds.
2fill in blank
medium

Complete the code to wait explicitly for 500 milliseconds before clicking the button.

Cypress
cy.[1](500);
cy.get('#submit').click();
Drag options to blanks, or click blank then click option'
Adelay
Bsleep
Cpause
Dwait
Attempts:
3 left
💡 Hint
Common Mistakes
Using non-Cypress commands like 'sleep' or 'delay'.
Forgetting to specify the wait time in milliseconds.
3fill in blank
hard

Fix the error in the code to wait explicitly for 1 second before checking the text.

Cypress
cy.wait([1]);
cy.get('.message').should('contain', 'Success');
Drag options to blanks, or click blank then click option'
A1000
B'1000ms'
C'1s'
D1
Attempts:
3 left
💡 Hint
Common Mistakes
Passing a string with units like '1000ms' or '1s'.
Passing a number without units but too small like 1.
4fill in blank
hard

Fill both blanks to wait explicitly for 3 seconds and then check if the button is visible.

Cypress
cy.[1]([2]);
cy.get('button#start').should('be.visible');
Drag options to blanks, or click blank then click option'
Await
Bpause
C3000
D5000
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'pause' instead of 'wait'.
Using 5000 instead of 3000 for the wait time.
5fill in blank
hard

Fill all three blanks to wait explicitly for 4 seconds, then get the input field and type 'Hello'.

Cypress
cy.[1]([2]);
cy.get('[3]').type('Hello');
Drag options to blanks, or click blank then click option'
Await
B4000
C#name-input
D.input-field
Attempts:
3 left
💡 Hint
Common Mistakes
Using a class selector instead of the id selector for the input.
Using incorrect wait time or command.