mercredi 27 mai 2020

Transform value of Selector

I have a HTML element <div id="the-value">30 000</div> for which the content is calculated.

I need to assert the value of this element to be a valid number (>= 20000), however, the value property returns a string and I cannot assert it using .gte()

This assertion fails with: AssertionError: expected '30 000' to be a number or a date

await t.expect(Selector('#the-value').value).gte(20000);

How can I transform the string to a number before assertion?

Aucun commentaire:

Enregistrer un commentaire