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.
This commit is contained in:
parent
121099afe7
commit
2204867a20
|
@ -50,7 +50,7 @@ const runOrderApplyCouponTest = () => {
|
||||||
// Verify the coupon list is showing
|
// Verify the coupon list is showing
|
||||||
await page.waitForSelector('.wc-used-coupons');
|
await page.waitForSelector('.wc-used-coupons');
|
||||||
await expect(page).toMatchElement('.wc_coupon_list', { text: 'Coupon(s)' });
|
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
|
// Check that the coupon has been applied
|
||||||
await expect(page).toMatchElement('.wc-order-item-discount', { text: '5.00' });
|
await expect(page).toMatchElement('.wc-order-item-discount', { text: '5.00' });
|
||||||
|
@ -60,7 +60,7 @@ const runOrderApplyCouponTest = () => {
|
||||||
it('can remove a coupon', async () => {
|
it('can remove a coupon', async () => {
|
||||||
// Make sure we have a coupon on the page to use
|
// Make sure we have a coupon on the page to use
|
||||||
await page.waitForSelector('.wc-used-coupons');
|
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
|
// 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
|
// See: https://github.com/puppeteer/puppeteer/issues/1769#issuecomment-637645219
|
||||||
|
@ -69,7 +69,7 @@ const runOrderApplyCouponTest = () => {
|
||||||
await uiUnblocked();
|
await uiUnblocked();
|
||||||
|
|
||||||
// Verify the coupon pricing has been removed
|
// 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('.wc-order-item-discount', { text: '5.00' });
|
||||||
await expect(page).not.toMatchElement('.line-cost .view .woocommerce-Price-amount', { text: '4.99' });
|
await expect(page).not.toMatchElement('.line-cost .view .woocommerce-Price-amount', { text: '4.99' });
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue