I need to reverse taking element from array. I have to start from the last one. I can't find any different solution to use in Cypress than jQuery 'reverse' but I have problem to use it.
Don't work in both way:
cy.get('.btn-remove.action.delete').reverse().each(($el, index, $list) => {
cy.get($el).click({force:true})
cy.wait(1000)
})
answer from Cypress - TypeError: cy.get(...).reverse is not a function
And
cy.get('.btn-remove.action.delete').invoke('reverse').each(($el, index, $list) => {
cy.get($el).click({force:true})
cy.wait(1000)
})
answer from Cypress - CypressError: Timed out retrying: cy.invoke() errored because the property: 'reverse' does not exist on your subject.
Or maybe there is different way than reverse()?