Fix block editor variable product test

This commit is contained in:
Jon Lane 2024-04-23 12:44:14 -07:00
parent bc18547e81
commit cd004530a7
2 changed files with 13 additions and 15 deletions

View File

@ -0,0 +1,4 @@
Significance: patch
Type: fix
Fixes for some flaky e2e

View File

@ -196,10 +196,9 @@ test.describe( 'Variations tab', () => {
await clickOnTab( 'Variations', page );
await page
.locator(
'.woocommerce-variations-table-error-or-empty-state__actions'
)
.getByRole( 'button', { name: 'Generate from options' } )
.getByRole( 'button', {
name: 'Generate from options',
} )
.click();
await clickOnTab( 'Variations', page );
@ -215,21 +214,17 @@ test.describe( 'Variations tab', () => {
.getByRole( 'button', { name: 'Pricing' } )
.click();
const regularPrice = page.locator( 'input[name="regular_price"]' );
await regularPrice.waitFor( { state: 'visible' } );
await regularPrice.first().click();
await regularPrice.first().fill( '100' );
await page
.getByLabel( 'Regular price', { exact: true } )
.fill( '100' );
await page
.locator( '.woocommerce-product-tabs' )
.getByRole( 'button', { name: 'Inventory' } )
.click();
const sku = page.locator( 'input[name="woocommerce-product-sku"]' );
await sku.waitFor( { state: 'visible' } );
await sku.first().click();
await sku
.first()
await page
.locator( '#inspector-input-control-2' )
.fill( `product-sku-${ new Date().getTime().toString() }` );
await page
@ -347,9 +342,8 @@ test.describe( 'Variations tab', () => {
);
await page
.locator( '.woocommerce-product-variations__table-body > div' )
.getByRole( 'link', { name: 'Edit', exact: true } )
.first()
.getByText( 'Edit' )
.click();
const notices = page.getByText(