From 57f3eccc956b865de1288d2e98a3a50d24e1eecb Mon Sep 17 00:00:00 2001 From: Veljko V Date: Mon, 4 Jan 2021 15:20:40 +0100 Subject: [PATCH] Fix conflict with another tests We're using dynamic coupon creation now. I updated other test to search for specific coupon name because in order edit page there's only lowercased coupon names, but we're using uppercased for two reasons at least. --- .../specs/merchant/wp-admin-order-apply-coupon.test.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/e2e/core-tests/specs/merchant/wp-admin-order-apply-coupon.test.js b/tests/e2e/core-tests/specs/merchant/wp-admin-order-apply-coupon.test.js index 4319e8606cb..a51d435e1d0 100644 --- a/tests/e2e/core-tests/specs/merchant/wp-admin-order-apply-coupon.test.js +++ b/tests/e2e/core-tests/specs/merchant/wp-admin-order-apply-coupon.test.js @@ -50,7 +50,7 @@ const runOrderApplyCouponTest = () => { // Verify the coupon list is showing await page.waitForSelector('.wc-used-coupons'); await expect(page).toMatchElement('.wc_coupon_list', { text: 'Coupon(s)' }); - await expect(page).toMatchElement('.wc_coupon_list li.code.editable', { text: couponCode }); + await expect(page).toMatchElement('.wc_coupon_list li.code.editable', { text: 'code-fixed cart discount' }); // Check that the coupon has been applied await expect(page).toMatchElement('.wc-order-item-discount', { text: '5.00' }); @@ -60,7 +60,7 @@ const runOrderApplyCouponTest = () => { it('can remove a coupon', async () => { // Make sure we have a coupon on the page to use await page.waitForSelector('.wc-used-coupons'); - await expect(page).toMatchElement('.wc_coupon_list li.code.editable', { text: couponCode }); + await expect(page).toMatchElement('.wc_coupon_list li.code.editable', { text: 'code-fixed cart discount' }); // We need to use this here as `expect(page).toClick()` was unable to find the element // See: https://github.com/puppeteer/puppeteer/issues/1769#issuecomment-637645219 @@ -69,7 +69,7 @@ const runOrderApplyCouponTest = () => { await uiUnblocked(); // Verify the coupon pricing has been removed - await expect(page).not.toMatchElement('.wc_coupon_list li.code.editable', { text: couponCode }); + await expect(page).not.toMatchElement('.wc_coupon_list li.code.editable', { text: 'code-fixed cart discount' }); await expect(page).not.toMatchElement('.wc-order-item-discount', { text: '5.00' }); await expect(page).not.toMatchElement('.line-cost .view .woocommerce-Price-amount', { text: '4.99' });