Cypress · Matcher
contain
Use the contain matcher with .should() to check that a Cypress-selected element includes expected text. Cypress waits and retries the check when the page is still updating.
Last updated
Syntax
cy.get(selector).should('contain', text)In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.
SubscribeRelated
cy.get()cy.contains().should().type()cy.url()