Thursday, 2 December 2021

Get native HTML element in Cypress

How do I get an underlying native HTMLElement (or Element or Node...) from a Cypress query?

const el = cy.get('.foo').children().first()
//    ^ this is of type Cypress.Chainable<JQuery<HTMLElement>>

I would like to access the native HTMLElement instance in el.
I have tried el[0] but the result is of type any.



from Get native HTML element in Cypress

No comments:

Post a Comment