On my ecommerce page the price of an item is reduced.
It shows the old price struck out (600.00€) and the new price not struck out (499.00€).
But when I query the page, I just get the text value
cy.get('#normalprice span')
.invoke('text')
.should('eq', '600.00€`)
How do I test the text is struck out? I was expecting <s>600.00€</s> but cy.get('#normalprice span s') fails.
Most likely it's using
text-decorationto do the strikethrough.Try getting the CSS value,
The strikethrough can be also be applied on a parent, so you may need to add a
.parents()selector