cy.get('selector')
.should('have.attr', 'aria-checked', 'true')
cy.get('ul')
.find('li')
.each((el) => {
expect(Cypress.$(el)).to.have.class(
'classname'
)
})
cy.get('input').invoke('attr', 'placeholder').should('contain', 'username')
// have.attr comes from chai-jquery
cy.get('#header a').should('have.attr', 'href', '/users')
let $el = Cypress.$("myselector");
if ($el.attr("myattr") === "myvalue") {
do.A();
} else {
do.B();
}