From 36035f56452d2bc39af8853145c3e216f48aad0e Mon Sep 17 00:00:00 2001 From: Carlos Bravo Date: Wed, 21 Oct 2026 21:26:40 +0200 Subject: [PATCH 1/2] Match editor error notices by text in block validation E2E tests WordPress trunk renders editor notices with new markup that no longer includes .components-notice__content, so locate the notice by its message. Co-Authored-By: Claude Opus 5.5 --- tests/e2e/block-testimonial.spec.ts | 4 ++-- tests/e2e/block-v3-features.spec.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/e2e/block-testimonial.spec.ts b/tests/e2e/block-testimonial.spec.ts index 80a917a6..208f5e36 100644 --- a/tests/e2e/block-testimonial.spec.ts +++ b/tests/e2e/block-testimonial.spec.ts @@ -278,8 +278,8 @@ test.describe( 'SCF Block > Testimonial', () => { await publishButton.click(); // Wait for the error notice to appear at the top of the editor - const errorNotice = page.locator( - '.components-notice.is-error .components-notice__content' + const errorNotice = page.getByText( + 'An ACF Block on this page requires attention before you can save.' ); await expect( errorNotice ).toBeVisible( { timeout: 1000 } ); } ); diff --git a/tests/e2e/block-v3-features.spec.ts b/tests/e2e/block-v3-features.spec.ts index c5c6c935..b971cc1a 100644 --- a/tests/e2e/block-v3-features.spec.ts +++ b/tests/e2e/block-v3-features.spec.ts @@ -309,8 +309,8 @@ test.describe( 'SCF Block V3 Features', () => { await publishButton.click(); // Wait for the error notice to appear - const errorNotice = page.locator( - '.components-notice.is-error .components-notice__content' + const errorNotice = page.getByText( + 'An ACF Block on this page requires attention before you can save.' ); await expect( errorNotice ).toBeVisible( { timeout: 3000 } ); } ); From e1036078bcbc77fbb42d418e9d113b871eb436cf Mon Sep 17 00:00:00 2001 From: Carlos Bravo Date: Wed, 21 Oct 2026 21:44:15 +0200 Subject: [PATCH 2/2] Scope editor notice lookup to the editor content region Co-Authored-By: Claude Opus 5.5 --- tests/e2e/block-testimonial.spec.ts | 8 +++++--- tests/e2e/block-v3-features.spec.ts | 8 +++++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/tests/e2e/block-testimonial.spec.ts b/tests/e2e/block-testimonial.spec.ts index 208f5e36..58bc9e7e 100644 --- a/tests/e2e/block-testimonial.spec.ts +++ b/tests/e2e/block-testimonial.spec.ts @@ -278,9 +278,11 @@ test.describe( 'SCF Block > Testimonial', () => { await publishButton.click(); // Wait for the error notice to appear at the top of the editor - const errorNotice = page.getByText( - 'An ACF Block on this page requires attention before you can save.' - ); + const errorNotice = page + .getByLabel( 'Editor content' ) + .getByText( + 'An ACF Block on this page requires attention before you can save.' + ); await expect( errorNotice ).toBeVisible( { timeout: 1000 } ); } ); } ); diff --git a/tests/e2e/block-v3-features.spec.ts b/tests/e2e/block-v3-features.spec.ts index b971cc1a..732a1648 100644 --- a/tests/e2e/block-v3-features.spec.ts +++ b/tests/e2e/block-v3-features.spec.ts @@ -309,9 +309,11 @@ test.describe( 'SCF Block V3 Features', () => { await publishButton.click(); // Wait for the error notice to appear - const errorNotice = page.getByText( - 'An ACF Block on this page requires attention before you can save.' - ); + const errorNotice = page + .getByLabel( 'Editor content' ) + .getByText( + 'An ACF Block on this page requires attention before you can save.' + ); await expect( errorNotice ).toBeVisible( { timeout: 3000 } ); } );