Cypress · Junior · Question 66 of 75
How do you assert that a text appears somewhere in an element?
- 1
.should('equal', 'Saved') - 2
.should('contain', 'Saved') - 3
.should('be', 'Saved')
Show the answer
Correct answer: .should('contain', 'Saved')
Explanation
contain checks a substring; have.text checks the exact text.