Fix timeout

This commit is contained in:
Jon Lane 2023-03-23 11:42:46 -07:00
parent 660b277d4b
commit 9c8249fa46
1 changed files with 4 additions and 14 deletions

View File

@ -159,16 +159,8 @@ test.describe( 'Add New Variable Product Page', () => {
// delete all variations // delete all variations
await page.click( 'a[href="#variable_product_options"]' ); await page.click( 'a[href="#variable_product_options"]' );
await Promise.all( [ await page.waitForLoadState( 'networkidle' );
page.waitForResponse( await page.selectOption( '#field_to_edit', 'delete_all' );
( resp ) =>
resp.url().includes( 'admin-ajax.php' ) &&
resp.status() === 200
),
page.selectOption( '#field_to_edit', 'delete_all', {
force: true,
} ),
] );
await page.click( 'a.do_variation_action' ); await page.click( 'a.do_variation_action' );
await page.waitForSelector( '.woocommerce_variation', { await page.waitForSelector( '.woocommerce_variation', {
state: 'detached', state: 'detached',
@ -278,7 +270,7 @@ test.describe( 'Add New Variable Product Page', () => {
defaultAttributes[ i ] 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', { await page.waitForSelector( 'input#variable_low_stock_amount0', {
state: 'hidden', state: 'hidden',
} ); } );
@ -297,8 +289,6 @@ test.describe( 'Add New Variable Product Page', () => {
page.on( 'dialog', ( dialog ) => dialog.accept() ); page.on( 'dialog', ( dialog ) => dialog.accept() );
await page.hover( '.woocommerce_variation' ); await page.hover( '.woocommerce_variation' );
await page.click( '.remove_variation.delete' ); await page.click( '.remove_variation.delete' );
await expect( page.locator( '.woocommerce_variation' ) ).toHaveCount( await expect( page.locator( '.woocommerce_variation' ) ).toHaveCount( 0 );
0
);
} ); } );
} ); } );