mardi 24 mars 2020

What is the best way to perform an assertion for numbers that are off by ".1" in testcafe

I need some assistance.This is a weird one.Basically I am writing out some testcafe tests where: a user goes to the order summary page and verifies that the total on the check out page matches the total on the order details page.

The issue: There are instances where the order details total is off by a penny(not a bug worthy of fixing any time soon. according to the developers).So for example, on the checkout page your order total is $3.50. On the order details page the total is $3.51

Is there a way to combat a penny extra in a testcafe assertion?

Here is what my assertion looks like:

await t
        .expect(totalOnCheckoutPage)
        .eql(totalOnOrderDetails);

totalOnCheckoutPage and totalOnOrderDetails are selector variables.

Aucun commentaire:

Enregistrer un commentaire