diff --git a/plugins/woocommerce/changelog/e2e-fix-flaky-variations-test b/plugins/woocommerce/changelog/e2e-fix-flaky-variations-test new file mode 100644 index 00000000000..7f599705d25 --- /dev/null +++ b/plugins/woocommerce/changelog/e2e-fix-flaky-variations-test @@ -0,0 +1,4 @@ +Significance: patch +Type: dev + +Fixes a flaky product variations e2e test diff --git a/plugins/woocommerce/tests/e2e-pw/tests/merchant/products/block-editor/create-variable-product-block-editor.spec.js b/plugins/woocommerce/tests/e2e-pw/tests/merchant/products/block-editor/create-variable-product-block-editor.spec.js index 8417a8264f3..bab4fefb088 100644 --- a/plugins/woocommerce/tests/e2e-pw/tests/merchant/products/block-editor/create-variable-product-block-editor.spec.js +++ b/plugins/woocommerce/tests/e2e-pw/tests/merchant/products/block-editor/create-variable-product-block-editor.spec.js @@ -367,10 +367,14 @@ test.describe( 'Variations tab', { tag: '@gutenberg' }, () => { await page.getByLabel( 'Delete variation' ).click(); - const element = page.locator( 'div.components-snackbar__content' ); - await expect( await element.innerText() ).toMatch( - '1 variation deleted.' - ); + await expect( + page.getByText( '1 variation deleted.' ) + ).toBeVisible(); + + await page.waitForSelector( + 'div.woocommerce-product-variations-pagination__info', + { timeout: 20000 } + ); // test was timing out before page loaded await expect( await page