Merge pull request #29383 from woocommerce/e2e/e2e-fix-flaky-checkout-coupons

Fixed flaky e2e test checkout coupons
This commit is contained in:
Greg 2021-03-17 08:49:14 -06:00 committed by GitHub
commit b6f3c2b0be
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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'});
});