Commit ade8babf95f for woocommerce
commit ade8babf95f7456149a938038378887e982657f9
Author: Karol Manijak <20098064+kmanijak@users.noreply.github.com>
Date: Fri May 29 14:33:58 2026 +0200
Fix flaky Product Collection location E2E test (#65393)
* Fix Product Collection location E2E flake
* Add changelog for Product Collection E2E flake
* Remove Product Collection request matcher changes
* Close global inserter after inserting blocks
* Restore Product Collection-specific inserter close
* Close inserter before registered collection chooser
* Use post helper in collection chooser test
diff --git a/plugins/woocommerce/changelog/fix-product-collection-location-flake b/plugins/woocommerce/changelog/fix-product-collection-location-flake
new file mode 100644
index 00000000000..81001c21b29
--- /dev/null
+++ b/plugins/woocommerce/changelog/fix-product-collection-location-flake
@@ -0,0 +1,5 @@
+Significance: patch
+Type: dev
+Comment: Test-only change; no user-facing impact.
+
+Product Collection E2E: close the global inserter before choosing a collection so hover previews do not block the placeholder controls.
diff --git a/plugins/woocommerce/client/blocks/tests/e2e/tests/product-collection/product-collection.page.ts b/plugins/woocommerce/client/blocks/tests/e2e/tests/product-collection/product-collection.page.ts
index c65ea283a3d..d661ba9ddd2 100644
--- a/plugins/woocommerce/client/blocks/tests/e2e/tests/product-collection/product-collection.page.ts
+++ b/plugins/woocommerce/client/blocks/tests/e2e/tests/product-collection/product-collection.page.ts
@@ -148,6 +148,8 @@ class ProductCollectionPage {
}
async chooseCollectionInPost( collection?: Collections ) {
+ await this.editor.closeGlobalBlockInserter();
+
const buttonName = collection
? collectionToButtonNameMap[ collection ]
: collectionToButtonNameMap.productCatalog;
@@ -184,6 +186,8 @@ class ProductCollectionPage {
}
async chooseCollectionInTemplate( collection?: Collections ) {
+ await this.editor.closeGlobalBlockInserter();
+
const buttonName = collection
? collectionToButtonNameMap[ collection ]
: collectionToButtonNameMap.productCatalog;
diff --git a/plugins/woocommerce/client/blocks/tests/e2e/tests/product-collection/register-product-collection.block_theme.spec.ts b/plugins/woocommerce/client/blocks/tests/e2e/tests/product-collection/register-product-collection.block_theme.spec.ts
index d0acd7bea83..ac8e8ef76d8 100644
--- a/plugins/woocommerce/client/blocks/tests/e2e/tests/product-collection/register-product-collection.block_theme.spec.ts
+++ b/plugins/woocommerce/client/blocks/tests/e2e/tests/product-collection/register-product-collection.block_theme.spec.ts
@@ -100,32 +100,22 @@ test.describe( 'Product Collection: Register Product Collection', () => {
pageObject,
editor,
admin,
- page,
} ) => {
await admin.createNewPost();
- await editor.insertBlockUsingGlobalInserter( pageObject.BLOCK_NAME );
- await editor.canvas
- .getByRole( 'button', {
- name: 'Choose collection',
- } )
- .click();
-
- // This viewport size is required to ensure that the selectors are visible.
- // For smaller viewports, a different DOM structure is rendered, which may cause the selectors to be hidden or not interactable.
- await page.setViewportSize( {
- width: 1920,
- height: 1080,
- } );
- for ( const myCollection of Object.values(
+ for ( const [ collectionId, myCollection ] of Object.entries(
MY_REGISTERED_COLLECTIONS
) ) {
+ await editor.setContent( '' );
+ await editor.insertBlockUsingGlobalInserter(
+ pageObject.BLOCK_NAME
+ );
+ await pageObject.chooseCollectionInPost(
+ collectionId as Collections
+ );
+
await expect(
- editor.canvas
- .locator(
- `.wc-blocks-product-collection__collection-button-title`
- )
- .getByText( myCollection.name, { exact: true } )
+ editor.canvas.getByLabel( myCollection.label )
).toBeVisible();
}
} );