From fc7d2376720704043dccd9a7bbf63d8c379ffc4b Mon Sep 17 00:00:00 2001 From: Faisal Ahammad Date: Sat, 24 Oct 2026 03:48:33 +0600 Subject: [PATCH] Fix E2E error notice selector for WordPress trunk Gutenberg trunk renders editor notices with notices-inline-notices__* classes instead of the legacy components-notice markup, so the block validation tests could not find the error notice even though it shows. Match both markups. --- tests/e2e/block-testimonial.spec.ts | 4 +++- tests/e2e/block-v3-features.spec.ts | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/e2e/block-testimonial.spec.ts b/tests/e2e/block-testimonial.spec.ts index 80a917a6..c75e4bf1 100644 --- a/tests/e2e/block-testimonial.spec.ts +++ b/tests/e2e/block-testimonial.spec.ts @@ -278,8 +278,10 @@ test.describe( 'SCF Block > Testimonial', () => { await publishButton.click(); // Wait for the error notice to appear at the top of the editor + // WP trunk renders editor notices with `notices-inline-notices__*` + // classes instead of the legacy `components-notice` markup. const errorNotice = page.locator( - '.components-notice.is-error .components-notice__content' + '.components-notice.is-error .components-notice__content, .notices-inline-notices__notice.is-error' ); 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..afc89d1b 100644 --- a/tests/e2e/block-v3-features.spec.ts +++ b/tests/e2e/block-v3-features.spec.ts @@ -309,8 +309,10 @@ test.describe( 'SCF Block V3 Features', () => { await publishButton.click(); // Wait for the error notice to appear + // WP trunk renders editor notices with `notices-inline-notices__*` + // classes instead of the legacy `components-notice` markup. const errorNotice = page.locator( - '.components-notice.is-error .components-notice__content' + '.components-notice.is-error .components-notice__content, .notices-inline-notices__notice.is-error' ); await expect( errorNotice ).toBeVisible( { timeout: 3000 } ); } );