I need to help. I have code that is controlling if some value is greater than other value.
It looks like this:
cy.get(':nth-child(1) > .offer-block > :nth-child(1) > .flex-col > .offer-price').then(($span) => {
// capture what num is right now
const num1 = $span.text();
cy.get(':nth-child(2) > .flex-column').click();
cy.wait(5000);
cy.get(':nth-child(1) > .offer-block > :nth-child(1) > .flex-col > .offer-price').then(($span) => {
// now capture it again
const num2 = $span.text();
// make sure it's what we expected
expect(num1).to.be.greaterThan(num2);
});
});
Problem is that saved text isn't only simple number but it allways ends with " Kč". Is there some way to delete this text (" Kč")?
I was trying to parse text to float but it didn't end well.
Thanks for all your help.