Skip to content

Repair wp/5.2 branch Actions: Wait for the block switcher before converting blocks in e2e tests - #85657

Merged
desrosj merged 1 commit into
fix-actions-5.2/wait-for-disabled-undo-buttonfrom
fix-actions-5.2/wait-for-block-switcher-in-e2e
Oct 29, 2026
Merged

desrosj merged 1 commit into
fix-actions-5.2/wait-for-disabled-undo-buttonfrom
fix-actions-5.2/wait-for-block-switcher-in-e2e

Conversation

@desrosj

@desrosj desrosj commented Oct 26, 2026 •

Copy link
Copy Markdown
Member

Part of #83421.

What?

Makes the e2e helper that converts a block (packages/e2e-test-utils/src/transform-block-to.js) wait before each click and after the conversion: the switcher toggle scrolled into view and visible, the switcher visible once open, the requested option visible inside the switcher popover, and finally the transformed block. Backports #15485, #18771, #23232, #23279 and #23311.

Why?

On this branch Code block › should convert to a preformatted block failed on #85656: the snapshot still shows the Code block, because the content was read before the conversion was applied. The same helper problem made conversions fail on wp/5.4, wp/5.3 and wp/5.1, fixed there in #85613, #85637 and #85675.

The helper clicked the switcher toggle and then the option immediately. The switcher popover is positioned in more than one pass (trunk's #23279 fixed the Popover side of this), so the option can still be moving when the click lands, and the click hits nothing. Trunk fixed the same flakiness in this helper over #18771, #23232, #23279 and #23311.

How?

Only the e2e helper changes; the Popover component fix from #23279 is not ported, so the editor itself is unchanged. This branch's switcher has no __container element and lists options as block-types-list items, so the helper waits on the popover and the item instead. It also adds #15485's wait for the transformed block. Puppeteer on this branch predates ElementHandle.evaluate() in some versions, so scrolling uses page.evaluate() where needed. @wordpress/e2e-test-utils gets a changelog entry.

Testing Instructions

The end-to-end jobs run on this pull request. ESLint reports nothing for the changed file.

Use of AI Tools

This PR was created by Claude Code under my supervision. All code should be treated as AI-produced and not yet reviewed by a human until this PR is marked Ready for Review.

🤖 Generated with Claude Code

@desrosj desrosj added the [Type] Build Tooling Issues or PRs related to build tooling label Oct 26, 2026
@desrosj desrosj self-assigned this Oct 26, 2026
@coderabbitai

coderabbitai Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: f68bd18c-63e1-4c98-b400-f118eaa63257

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Oct 27, 2026 •

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.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: desrosj <desrosj@git.wordpress.org>
Co-authored-by: tellthemachines <isabel_brison@git.wordpress.org>

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


Props Bot commands

You can trigger Props Bot actions by commenting on this PR:

  • @propsbot add <username> to give props to a GitHub user. Requires write access.
  • @propsbot remove <username> to leave a user out of the props. Requires write access.
  • @propsbot refresh to refresh this list. Adding the props-bot label works too.

@tellthemachines tellthemachines left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@desrosj
desrosj force-pushed the fix-actions-5.2/wait-for-block-switcher-in-e2e branch from 9e82335 to 1eb6521 Compare October 29, 2026 12:48
@desrosj
desrosj merged commit 82ce65a into wp/5.2 Oct 29, 2026
18 of 25 checks passed
@desrosj
desrosj deleted the fix-actions-5.2/wait-for-block-switcher-in-e2e branch October 29, 2026 17:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Type] Build Tooling Issues or PRs related to build tooling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants