Cypress · Junior · Question 11 of 75

What does cy.contains('Save') find?

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.

Further reading

Problem with a question

Cypress · Junior · question 11

Test yourself

Take the Cypress · Junior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz