Repository navigation
Flaky Tests: Wait for the link URL field to take focus before typing - #85996
Merged
Merged
Conversation
The URL field takes focus in a timeout after the link popover mounts, so keys pressed as soon as the popover is visible could reach the paragraph or the toolbar instead. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
🤖 PR meta 🤖🎉 PropsIf 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:
Updated as activity occurs, without notifying anyone named here. Add the 📦 Bundle sizeSize Change: 0 B Total Size: 8.56 MB
🏁 Flaky testsSome tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information. As a user I want to be able to add multiple close buttons so that users can close the overlay from different positions in
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What?
Three Links tests wait for the link popover's URL field to have focus before pressing keys, instead of only for the popover to be visible.
Why?
"Links › can be created by selecting text and using keyboard shortcuts" (Chromium) needed a retry in 3 of the last 7 trunk CI runs (2026-10-29). CI got content like
This is horThis is https://instead ofThis is Gutenberg: the start of the URL went into the paragraph and replaced the selected word.useFocusOnMount()moves focus to the first input in asetTimeout.Locally it fails 16 of 20 times on trunk. (It fails just as often on the commit before "Rich Text: Register each field once instead of adding its own listeners" (#85887), after which CI started reporting it, so that change isn't the cause.)
The two "allows arrow keys to be pressed during link creation…" tests press keys right after the popover appears in the same way, and Escape can then miss the popover: they fail 6 of 20 times locally, though CI doesn't flag them.
How?
After checking the popover is visible, check that its "Search or type URL" field is focused, as other tests in this spec already do.
Testing Instructions
links.spec.jspasses (28).There is no Playground link or screenshot: only e2e tests change.
Use of AI Tools
Investigated and written with Claude Code.
🤖 Generated with Claude Code