Fixed flaky test checkout coupons

This commit is contained in:
Veljko 2021-03-15 13:14:48 +01:00
parent 54edb576d5
commit 5897027080
1 changed files with 6 additions and 0 deletions

View File

@ -66,6 +66,9 @@ const runCheckoutApplyCouponsTest = () => {
it('allows customer to apply fixed product coupon', async () => {
await applyCoupon(couponFixedProduct);
await expect(page).toMatchElement('.woocommerce-message', {text: 'Coupon code applied successfully.'});
// Verify discount applied and order total
await page.waitForSelector('.order-total');
await expect(page).toMatchElement('.cart-discount .amount', {text: '$5.00'});
await expect(page).toMatchElement('.order-total .amount', {text: '$4.99'});
await removeCoupon(couponFixedProduct);
@ -84,6 +87,9 @@ const runCheckoutApplyCouponsTest = () => {
it('allows customer to apply multiple coupons', async () => {
await applyCoupon(couponFixedProduct);
await expect(page).toMatchElement('.woocommerce-message', {text: 'Coupon code applied successfully.'});
// Verify discount applied and order total
await page.waitForSelector('.order-total');
await expect(page).toMatchElement('.order-total .amount', {text: '$0.00'});
});