From a1ec304f443f78ab4605f65637b021ff1789a121 Mon Sep 17 00:00:00 2001 From: Ron Rennick Date: Wed, 14 Apr 2021 16:09:23 -0300 Subject: [PATCH] add waits for idle in add product to order --- tests/e2e/utils/src/components.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/tests/e2e/utils/src/components.js b/tests/e2e/utils/src/components.js index c449622937b..d9297493aa4 100644 --- a/tests/e2e/utils/src/components.js +++ b/tests/e2e/utils/src/components.js @@ -430,11 +430,13 @@ const addProductToOrder = async ( orderId, productName ) => { await expect( page ).toClick( 'button.add-order-item' ); await page.waitForSelector( '.wc-backbone-modal-header' ); await expect( page ).toClick( '.wc-backbone-modal-content .wc-product-search' ); - await expect( page ).toFill( '#wc-backbone-modal-dialog + .select2-container .select2-search__field', productName ); + await expect( page ).toFill( + '#wc-backbone-modal-dialog + .select2-container .select2-search__field', + productName, + { waitUntil: 'networkidle0' } + ); await expect( page ).toClick( 'li[aria-selected="true"]' ); - await page.click( '.wc-backbone-modal-content #btn-ok' ); - - await uiUnblocked(); + await page.click( '.wc-backbone-modal-content #btn-ok', { waitUntil: 'networkidle0' } ); // Verify the product we added shows as a line item now await expect( page ).toMatchElement( '.wc-order-item-name', { text: productName } );