Repository navigation
Repair wp/5.4 branch Actions: Improve reliability of the TypeWriter E2E test - #85620
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:
|
andrewserong
left a comment
There was a problem hiding this comment.
LGTM and waiting two frames sounds reasonable 👍
34c0a0d to
911d3ef
Compare
Part of #83419.
What?
Makes the TypeWriter E2E test's
should maintain caret position after scrollcase wait for the Typewriter to catch up with the scroll before reading the caret position, and wait for the Typewriter to scroll after pressing Enter. No change to what the test checks.Why?
This is a preventive fix: the test has not failed on the
wp/5.4orwp/5.3stacks (it passed in every failed e2e run on them that included it).packages/e2e-tests/specs/editor/various/typewriter.test.jssets the scroll container'sscrollTop, reads the caret position straight away and presses Enter. The scroll event only fires on the next animation frame, and the Typewriter recalculates its saved caret rectangle in an animation frame of its own after that (onScrollResize()), so the test can read the position, and press Enter, before the Typewriter has caught up. The same case failed this way onwp/5.7(job), and thewp/5.7–wp/5.5stacks now carry a fix.How?
Ports the waits from 9c242ee (#31472, "Stabilise typewriter e2e test"):
It differs from the upstream version, and from the
wp/5.7–wp/5.5fixes, in one way: those also port d372c85 (#28376), which scrolls withpage.mouse.wheel(). This branch's Puppeteer (2.0.0) has noMouse.wheel()(it was added in Puppeteer 5.4), so the test keeps scrolling by settingscrollTop. A programmatic scroll's event fires one frame later than a wheel scroll's, so the test waits two animation frames instead of one. The existing 1pxBUFFERassertion is kept.This sits on top of the meta box TinyMCE fix, as on
wp/5.5.wp/5.3gets the same change;wp/5.2andwp/5.1do not have this test.Testing Instructions
The end-to-end tests should pass on this PR. The test hasn't failed on this branch yet, so a run mainly shows the change is safe.
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