I have a list of products on a web page some of which have discounts. I want to get the old price and new price as pairs so I can compare the values, calculate the discount etc. I'm having trouble joining the values and returning them out of the selectors.
The HTML is something like <span class="el1"></span><span class="el2"></span>.
My test is
cy.get('.el1').then($el1 => {
cy.get('.el2').then($el2 => {
return [$el1, $el2]
})
})
// analyze pairs here