Cypress · Matcher
have.attr
The have.attr matcher checks that a selected HTML element has an attribute. It can also verify the attribute's value.
Last updated
Syntax
cy.get(selector).should('have.attr', attributeName[, expectedValue])In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.
SubscribeRelated
cy.getshouldCypress.isBrowserAccessibility Testing