Merge pull request #29737 from woocommerce/e2e/e2e-fix-flaky-checkout-test
Fixed checkout coupons flaky scenario in e2e suite
This commit is contained in:
commit
f46c2fbf0b
|
@ -236,6 +236,10 @@ export const searchForOrder = async (value, orderId, customerName) => {
|
|||
*/
|
||||
export const applyCoupon = async ( couponCode ) => {
|
||||
try {
|
||||
await Promise.all([
|
||||
page.reload(),
|
||||
page.waitForNavigation( { waitUntil: 'networkidle0' } ),
|
||||
]);
|
||||
await expect(page).toClick('a', {text: 'Click here to enter your code'});
|
||||
await uiUnblocked();
|
||||
await clearAndFillInput('#coupon_code', couponCode);
|
||||
|
@ -255,6 +259,10 @@ export const applyCoupon = async ( couponCode ) => {
|
|||
* @returns {Promise<void>}
|
||||
*/
|
||||
export const removeCoupon = async ( couponCode ) => {
|
||||
await Promise.all([
|
||||
page.reload(),
|
||||
page.waitForNavigation( { waitUntil: 'networkidle0' } ),
|
||||
]);
|
||||
await expect(page).toClick('[data-coupon="'+couponCode.toLowerCase()+'"]', {text: '[Remove]'});
|
||||
await uiUnblocked();
|
||||
await expect(page).toMatchElement('.woocommerce-message', {text: 'Coupon has been removed.'});
|
||||
|
|
Loading…
Reference in New Issue