Repository navigation
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.77 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. 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:
|
42bb871 to
1ead158
Compare
1ead158 to
c34dd46
Compare
c34dd46 to
b8df72f
Compare
wp/6.7 branch Actions: Fix wrong TinyMCE editor-tab selector in the meta box E2E testwp/6.7 branch Actions: Improve reliability of TinyMCE-related tests
31fef2b to
5778f8c
Compare
5778f8c to
3fd04de
Compare
3fd04de to
b5422d1
Compare
b5422d1 to
4bf2498
Compare
4bf2498 to
526cbca
Compare
526cbca to
a044e20
Compare
Part of #82783.
What?
Two fixes to
test/e2e/specs/editor/plugins/wp-editor-meta-box.spec.js, theWP Editor Meta Boxesspec:Text, instead ofCode.initializedflag, and adds the same wait after switching back to Visual mode.No change to what the test asserts.
Why?
The wrong selector
The test was consistently failing (not intermittently) on
wp/6.7, timing out on a click ofrole=button[name="Code"i]. That button does not exist in this branch's bundled WordPress: itswp-envconfig pins WordPress Core toWordPress/WordPress#6.7-branch, which still renders the classic-editor tab asText(wp-includes/class-wp-editor.php). Core renamed that string toCodeafter6.7-branchwas cut — it shipped in WordPress 6.8 — and Gutenbergtrunkfollowed suit in #68872/#68886. That rename does not apply here, because this branch'swp-envis deliberately pinned to match its own WordPress version (#82900, lower in this stack). A hardcoded wrong locator fails every time, which is exactly what CI showed.So this branch clicks
Text.The initialization wait
Separately, the test guarded its mode 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 part is a straight port of
631bcb2(#78631) fromtrunk, except for the branch-specific button name.Trunk's current version of this test also clicks a "Meta Boxes" pane-toggle button, added by #71623. That toggle only renders under a narrow-height media query this branch's CI viewport doesn't trigger, so porting that unrelated UI feature to a frozen maintenance branch is out of scope here.
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