Skip to content

Fix E2E error notice selector for WordPress trunk - #572

Open
faisalahammad wants to merge 1 commit into
WordPress:trunkfrom
faisalahammad:fix/e2e-error-notice-selector-wp-trunk
Open

faisalahammad wants to merge 1 commit into
WordPress:trunkfrom
faisalahammad:fix/e2e-error-notice-selector-wp-trunk

Conversation

@faisalahammad

Copy link
Copy Markdown

Two E2E tests fail on the E2E - WP trunk job on every open PR (e.g. #565, #539, #571):

  • tests/e2e/block-testimonial.spec.ts › should validate required quote field in testimonial block
  • tests/e2e/block-v3-features.spec.ts › should validate required fields on publish

Both time out waiting for .components-notice.is-error .components-notice__content after clicking Publish with an empty required field.

This is not a plugin bug. The CI failure screenshot and trace show the validation still works on trunk: the publish is blocked and the editor shows "An ACF Block on this page requires attention before you can save." Gutenberg trunk now renders editor notices with new markup (div.notices-inline-notices__notice.is-error with the text in a child span) instead of div.components-notice.is-error > div.components-notice__content, so the old selector no longer matches.

This PR makes the locator in both tests match either markup:

.components-notice.is-error .components-notice__content, .notices-inline-notices__notice.is-error

Testing

Locally with npm run test:e2e -- tests/e2e/block-testimonial.spec.ts tests/e2e/block-v3-features.spec.ts:

  • WordPress trunk (WP_ENV_CORE=WordPress/WordPress, 7.2-beta1-64690): both tests fail with the old selector and all 6 tests in the two specs pass with this change.
  • WordPress latest (7.1.3): all 6 tests pass.

See #571

Use of AI Tools

Claude Code was used to find the cause and write the fix. I reviewed and tested the changes before submitting.

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.
@github-actions

Copy link
Copy Markdown

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

Core Committers: Use this line as a base for the props when committing in SVN:

Props faisalahammad.

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant