Repository navigation
Repair wp/5.9 branch Actions: Retry detached menu item clicks in the Widgets Customizer e2e tests - #84426
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 ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
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. Comment |
|
Size Change: 0 B Total Size: 1.11 MB ℹ️ View Unchanged
|
16b72ff to
50f9b48
Compare
|
Size Change: 0 B Total Size: 1.11 MB ℹ️ View Unchanged
|
|
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 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. |
50f9b48 to
d4626af
Compare
andrewserong
left a comment
There was a problem hiding this comment.
This looks like a pragmatic fix for the intermittent failures, and trying 3 times (guarded by detached) sounds good to me. The function looks clean and logical, and the call sites are all consistent.
LGTM!
d4626af to
7d87ff9
Compare
…en the menu item is detached.
7d87ff9 to
95582a5
Compare
Part of #82934.
What?
Adds a
clickMenuItem()helper to the Widgets Customizer e2e tests (packages/e2e-tests/specs/widgets/customizing-widgets.test.js) and uses it for the three "Show more settings" clicks in the block toolbar's Options menu. The helper finds the menu item and clicks it. If the click fails because the element was detached, it reopens the Options menu if the menu closed, finds the item again and retries, up to three attempts in total. Any other error is thrown as before.Why?
Widgets Customizer › should open the inspector panelfails intermittently on this branch withNode is detached from documentatshowMoreSettingsButton.click()("Admin - 4"). The test finds the menu item withfind(), then clicks the returned element handle, and the Options menu can re-render in between, so the click targets a node that is no longer in the document. Across 36Admin - 4jobs on this stack between 2026-10-06 and 2026-10-08, it failed on every attempt in 13 and passed only on a retry in 8.Trunk has no Puppeteer fix to backport. These tests were moved to Playwright in #39540 (9f5b842), whose locators look the element up again when clicking.
wp/5.9has no Playwright e2e setup, so this does the same thing within the Puppeteer test.How?
clickMenuItem( name )callsfind( { role: 'menuitem', name } )and.click()in a loop, and only retries when the error message contains "detached". Before a retry, if no[role="menu"]is open, it shows the block toolbar and clicks "Options" again, because the re-render that detaches the item can also close the menu. The test steps and assertions are unchanged.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