Cypress · Matcher
have.class
have.class asserts that a Cypress subject has a CSS class. Cypress retries the assertion until it passes or the command times out.
Last updated
Syntax
cy.get(selector).should('have.class', className)In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.
SubscribeRelated
shouldandgethave.attrAssertions