Cypress · Junior · Question 15 of 75
How do you tick a checkbox in Cypress?
- 1
cy.get('[type=checkbox]').check() - 2
cy.get('[type=checkbox]').tick() - 3
cy.get('[type=checkbox]').toggle()
Show the answer
Correct answer: cy.get('[type=checkbox]').check()
Explanation
.check() and .uncheck() work for checkboxes and radios and can take values to pick specific ones.