Fix flaky filling SKU and verifying CYS footer e2e tests (#49191)
This commit is contained in:
parent
c763bdf695
commit
05c47d8566
|
@ -0,0 +1,4 @@
|
|||
Significance: patch
|
||||
Type: dev
|
||||
|
||||
E2E tests: Fix flaky filling SKU field and CYS footer
|
|
@ -147,7 +147,7 @@ test.describe( 'Assembler -> Footers', { tag: '@gutenberg' }, () => {
|
|||
|
||||
for ( const footerPicker of footerPickers ) {
|
||||
await footerPicker.waitFor();
|
||||
await footerPicker.click();
|
||||
await footerPicker.click( { delay: 300 } );
|
||||
|
||||
const footerPickerClass = await footerPicker
|
||||
.frameLocator( 'iframe' )
|
||||
|
@ -160,6 +160,7 @@ test.describe( 'Assembler -> Footers', { tag: '@gutenberg' }, () => {
|
|||
`footer div.wc-blocks-footer-pattern`
|
||||
);
|
||||
|
||||
await footerPattern.waitFor();
|
||||
await expect(
|
||||
await footerPattern.getAttribute( 'class' )
|
||||
).toContain( expectedFooterClass );
|
||||
|
|
|
@ -25,10 +25,20 @@ const test = baseTest.extend( {
|
|||
},
|
||||
page: async ( { page, product }, use ) => {
|
||||
await test.step( 'go to product editor, inventory tab', async () => {
|
||||
// This wait for response is only to avoid flakiness when filling SKU field
|
||||
const waitResponse = page.waitForResponse(
|
||||
( response ) =>
|
||||
response
|
||||
.url()
|
||||
.includes(
|
||||
'wp-json/wc-admin/options?options=woocommerce_dimension_unit'
|
||||
) && response.status() === 200
|
||||
);
|
||||
await page.goto(
|
||||
`wp-admin/post.php?post=${ product.id }&action=edit`
|
||||
);
|
||||
await page.getByRole( 'tab', { name: 'Inventory' } ).click();
|
||||
await waitResponse;
|
||||
} );
|
||||
|
||||
await use( page );
|
||||
|
|
Loading…
Reference in New Issue