Commit b2ed4556ce3 for woocommerce
commit b2ed4556ce34a5c470922257f396fb496db07ef3
Author: Ján Mikláš <neosinner@gmail.com>
Date: Mon Sep 28 11:48:33 2026 +0300
Fix E2E selectors for extension editors and notices (#69113)
* Fix E2E selectors for extension editors and notices
* Add changelog entry for E2E selector fixes
diff --git a/plugins/woocommerce/changelog/wooplug-7827-e2e-extension-selectors b/plugins/woocommerce/changelog/wooplug-7827-e2e-extension-selectors
new file mode 100644
index 00000000000..c9b80ed6644
--- /dev/null
+++ b/plugins/woocommerce/changelog/wooplug-7827-e2e-extension-selectors
@@ -0,0 +1,5 @@
+Significance: patch
+Type: dev
+Comment: Harden product editor and review reply E2E tests for extensions; no production change.
+
+
diff --git a/plugins/woocommerce/tests/e2e/tests/product/product-create-simple.spec.ts b/plugins/woocommerce/tests/e2e/tests/product/product-create-simple.spec.ts
index ee0e0e7199f..28488576bad 100644
--- a/plugins/woocommerce/tests/e2e/tests/product/product-create-simple.spec.ts
+++ b/plugins/woocommerce/tests/e2e/tests/product/product-create-simple.spec.ts
@@ -93,13 +93,11 @@ for ( const productType of Object.keys( productData ) ) {
// Product description
await page.locator( '#content-html' ).click(); // text mode to avoid the iframe
await page
- .locator( '.wp-editor-area' )
- .first()
+ .locator( '#content' )
.fill( productData[ productType ].description );
await page.locator( '#excerpt-html' ).click(); // text mode to avoid the iframe
await page
- .locator( '.wp-editor-area' )
- .nth( 1 )
+ .locator( '#excerpt' )
.fill( productData[ productType ].shortDescription );
} );
diff --git a/plugins/woocommerce/tests/e2e/tests/product/product-reviews.spec.ts b/plugins/woocommerce/tests/e2e/tests/product/product-reviews.spec.ts
index 3a07fe70238..f2f9f45c4d7 100644
--- a/plugins/woocommerce/tests/e2e/tests/product/product-reviews.spec.ts
+++ b/plugins/woocommerce/tests/e2e/tests/product/product-reviews.spec.ts
@@ -223,13 +223,21 @@ test.describe( 'Product Reviews', () => {
'wp-admin/edit.php?post_type=product&page=product-reviews'
);
- // Handle notice if present
- await page.addLocatorHandler(
- page.getByRole( 'link', { name: 'Dismiss' } ),
- async () => {
- await page.getByRole( 'link', { name: 'Dismiss' } ).click();
+ const dismissLinks = page.getByRole( 'link', {
+ name: 'Dismiss',
+ exact: true,
+ } );
+ await page.addLocatorHandler( dismissLinks.first(), async () => {
+ // Extensions can each add a notice, so dismiss all of them.
+ let remainingNotices = await dismissLinks.count();
+ while ( remainingNotices > 0 ) {
+ await dismissLinks.first().click();
+ await expect
+ .poll( () => dismissLinks.count() )
+ .toBeLessThan( remainingNotices );
+ remainingNotices = await dismissLinks.count();
}
- );
+ } );
const reviewRow = page.locator( `#comment-${ review.id }` );
await reviewRow.hover();