add waits for idle in add product to order

This commit is contained in:
Ron Rennick 2021-04-14 16:09:23 -03:00
parent 8c86f85af7
commit a1ec304f44
1 changed files with 6 additions and 4 deletions

View File

@ -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 } );