From 9c8249fa46e4b58b2805cc686df771b374739b5a Mon Sep 17 00:00:00 2001 From: Jon Lane Date: Thu, 23 Mar 2023 11:42:46 -0700 Subject: [PATCH] Fix timeout --- .../merchant/create-variable-product.spec.js | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/plugins/woocommerce/tests/e2e-pw/tests/merchant/create-variable-product.spec.js b/plugins/woocommerce/tests/e2e-pw/tests/merchant/create-variable-product.spec.js index 04acd92b750..1eebd2fec28 100644 --- a/plugins/woocommerce/tests/e2e-pw/tests/merchant/create-variable-product.spec.js +++ b/plugins/woocommerce/tests/e2e-pw/tests/merchant/create-variable-product.spec.js @@ -159,16 +159,8 @@ test.describe( 'Add New Variable Product Page', () => { // delete all variations await page.click( 'a[href="#variable_product_options"]' ); - await Promise.all( [ - page.waitForResponse( - ( resp ) => - resp.url().includes( 'admin-ajax.php' ) && - resp.status() === 200 - ), - page.selectOption( '#field_to_edit', 'delete_all', { - force: true, - } ), - ] ); + await page.waitForLoadState( 'networkidle' ); + await page.selectOption( '#field_to_edit', 'delete_all' ); await page.click( 'a.do_variation_action' ); await page.waitForSelector( '.woocommerce_variation', { state: 'detached', @@ -278,7 +270,7 @@ test.describe( 'Add New Variable Product Page', () => { defaultAttributes[ i ] ); } - await page.click( 'button.save-variation-changes', { force: true } ); + await page.click( 'button.save-variation-changes' ); await page.waitForSelector( 'input#variable_low_stock_amount0', { state: 'hidden', } ); @@ -297,8 +289,6 @@ test.describe( 'Add New Variable Product Page', () => { page.on( 'dialog', ( dialog ) => dialog.accept() ); await page.hover( '.woocommerce_variation' ); await page.click( '.remove_variation.delete' ); - await expect( page.locator( '.woocommerce_variation' ) ).toHaveCount( - 0 - ); + await expect( page.locator( '.woocommerce_variation' ) ).toHaveCount( 0 ); } ); } );