Fix flaky e2e test merchant filling regular price in inventory tab (#49226)

This commit is contained in:
Veljko V 2024-07-08 12:10:40 +02:00 committed by GitHub
parent b83eed8869
commit 1a94d68d2b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 16 additions and 0 deletions

View File

@ -0,0 +1,4 @@
Significance: patch
Type: dev
E2E tests: Fix flaky filling regular price in the inventory tab

View File

@ -269,6 +269,16 @@ test.describe( 'Variations tab', { tag: '@gutenberg' }, () => {
await getVariationsResponsePromise;
// Wait for response only to avoid flaky filling regular price below in Inventory tab
const waitResponse = page.waitForResponse(
( response ) =>
response
.url()
.includes(
'wp-json/wc-admin/options?options=woocommerce_dimension_unit'
) && response.status() === 200
);
await page
.locator( '.woocommerce-product-variations__table-body > div' )
.first()
@ -286,6 +296,8 @@ test.describe( 'Variations tab', { tag: '@gutenberg' }, () => {
.getByLabel( 'Regular price', { exact: true } )
.waitFor( { state: 'visible' } );
await waitResponse;
await page
.getByLabel( 'Regular price', { exact: true } )
.pressSequentially( '100' );