0
0
Cypresstesting~10 mins

cy.click() 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 click on a button with id 'submitBtn'.

Cypress
cy.get('#submitBtn').[1]()
Drag options to blanks, or click blank then click option'
Acheck
Bclick
Cselect
Dtype
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'type' instead of 'click' to simulate clicking.
Using 'select' which is for dropdowns, not buttons.
2fill in blank
medium

Complete the code to click on the first element with class 'item'.

Cypress
cy.get('.item').[1]()
Drag options to blanks, or click blank then click option'
Aclick
Bdblclick
Cfirst
Dlast
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'first()' without chaining click() afterwards.
Using 'dblclick()' which clicks twice.
3fill in blank
hard

Fix the error in the code to click on a button with text 'Submit'.

Cypress
cy.contains('Submit').[1]()
Drag options to blanks, or click blank then click option'
Aselect
Btype
Cclick
Dcheck
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'type' instead of 'click' after contains().
Using 'select' which is for dropdowns.
4fill in blank
hard

Fill both blanks to click on a button with id 'saveBtn' forcing the click even if covered.

Cypress
cy.get('#saveBtn').[1]({ force: [2] })
Drag options to blanks, or click blank then click option'
Aclick
Btrue
Cfalse
Dtype
Attempts:
3 left
💡 Hint
Common Mistakes
Using type instead of click.
Setting force to false which disables forcing.
5fill in blank
hard

Fill all three blanks to click on a button with class 'btn' at coordinates (10, 20) with force enabled.

Cypress
cy.get('.btn').[1]({ [2]: { x: 10, y: 20 }, [3]: true })
Drag options to blanks, or click blank then click option'
Aclick
Bposition
Cforce
Dtype
Attempts:
3 left
💡 Hint
Common Mistakes
Using type instead of click.
Confusing position with force options.