Cypress · Junior · Question 11 of 75
What does cy.contains('Save') find?
- 1Every button on the page with any text
- 2An element containing the text "Save"
- 3The first element with class
save
Show the answer
Correct answer: An element containing the text "Save"
Explanation
cy.contains searches by text, optionally within a selector: cy.contains('button', 'Save'). It retries like cy.get.