Repository navigation
Repair wp/6.5 branch Actions: Improve reliability of TinyMCE-related tests - #83466
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.72 MB ℹ️ View Unchanged
|
6b9fd75 to
a9117b4
Compare
|
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:
|
a9117b4 to
dea2b51
Compare
dea2b51 to
71481ea
Compare
71481ea to
db4c010
Compare
fff3b94 to
d878e7b
Compare
d878e7b to
ebf0f85
Compare
ebf0f85 to
a70a1b6
Compare
a70a1b6 to
40aeff0
Compare
40aeff0 to
8d13aa4
Compare
Part of #82928.
What?
Replaces the meta box E2E test's iframe-presence wait with a wait on TinyMCE's own
initializedflag, and adds the same wait after switching back to Visual mode. No change to what the test asserts.Why?
test/e2e/specs/editor/plugins/wp-editor-meta-box.spec.jsswitches the meta box's TinyMCE instance out of Visual mode and types into the textarea. It guarded that switch with:That waits for the editor iframe element to be attached, which happens early in TinyMCE's startup — not at the end of it. The comment above it already claimed the intent was to wait "for it to initialize"; this makes the code actually do that.
When the mode switch lands inside that window, two things can go wrong: TinyMCE flips the editor back to Visual once initialization completes, discarding the typed text, and
getSelection()can return null while TinyMCE restores the cursor position. Both surface as intermittent failures inend2end-test.yml.Waiting on
window.tinyMCE.get( 'test_tinymce_id' ).initializedcloses the window, because that flag is set only after startup finishes. The bundled TinyMCE is 4.9.11 on every WordPress version these branches pin, and it defineswindow.tinyMCE, returns the instance fromEditorManager.get( id ), and sets.initializedon it.This is a straight port of
631bcb2(#78631) fromtrunk. The mode-switch button name is branch-specific — WordPress renamed that tab fromTexttoCodein WordPress 6.8, and this branch pins its test WordPress accordingly — so the selector is deliberately left alone.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