Repository navigation
Repair wp/5.2 branch Actions: Wait for the block switcher before converting blocks in e2e tests - #85657
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the
|
|
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. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. Props Bot commandsYou can trigger Props Bot actions by commenting on this PR:
|
9e82335 to
1eb6521
Compare
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 blockfailed 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 onwp/5.4,wp/5.3andwp/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
Popoverside 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
Popovercomponent fix from #23279 is not ported, so the editor itself is unchanged. This branch's switcher has no__containerelement and lists options asblock-types-listitems, 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 predatesElementHandle.evaluate()in some versions, so scrolling usespage.evaluate()where needed.@wordpress/e2e-test-utilsgets 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