Is it possible to use Cypress to find and delete an element from the HTML? And how to do it?
Edit: This works:
cy.get(selector).then((elem) => {
const elemHtml = elem.get(0)
elemHtml.remove()
})
Is it possible to use Cypress to find and delete an element from the HTML? And how to do it?
Edit: This works:
cy.get(selector).then((elem) => {
const elemHtml = elem.get(0)
elemHtml.remove()
})
get() yields the DOM element(s) it found which can then be removed.
cy.get(selector).then($el => $el.remove());