0
0
Cypresstesting~10 mins

Why Cypress is built for modern web testing - Test Your Understanding

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

Complete the code to visit a webpage using Cypress.

Cypress
cy.[1]('https://example.com')
Drag options to blanks, or click blank then click option'
Aget
Bclick
Cvisit
Dtype
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'click' instead of 'visit' to open a page.
2fill in blank
medium

Complete the code to check if an element contains specific text.

Cypress
cy.get('.message').[1]('contain.text', 'Success')
Drag options to blanks, or click blank then click option'
Ashould
Bclick
Ctype
Dvisit
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'click' or 'type' instead of 'should' for assertions.
3fill in blank
hard

Fix the error in the code to wait for an API call to complete.

Cypress
cy.intercept('GET', '/api/data').as('getData')
cy.[1]('@getData')
Drag options to blanks, or click blank then click option'
Aclick
Bwait
Cget
Dvisit
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'get' or 'visit' instead of 'wait' to pause for API calls.
4fill in blank
hard

Fill both blanks to create a test that checks a button click changes text.

Cypress
cy.get('[1]').click()
cy.get('[2]').should('contain.text', 'Clicked!')
Drag options to blanks, or click blank then click option'
A#submit-btn
B.result
C#output
D.button
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing class and id selectors incorrectly.
5fill in blank
hard

Fill all three blanks to write a test that types into input, submits form, and checks success message.

Cypress
cy.get('[1]').type('hello@example.com')
cy.get('[2]').click()
cy.get('[3]').should('contain.text', 'Thank you')
Drag options to blanks, or click blank then click option'
A#email-input
B#submit-button
C.success-message
D.error-message
Attempts:
3 left
💡 Hint
Common Mistakes
Using error message selector instead of success message.