Repository navigation
Repair wp/6.4 branch Actions: Fix flaky Pages e2e test Save click - #84621
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.63 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. |
9260f83 to
d0ff5c1
Compare
andrewserong
left a comment
There was a problem hiding this comment.
This scoping looks good, and is consistent with other tests. LGTM!
On this note, I've started a PR against trunk (#85259) to remove the test over there in favour of the existing running tests in trunk. Don't worry about looking at it (it's not urgent for this current batch of PRs for earlier WP releases), I just figured if we've noticed a test that's been skipped for that long, it's probably time to tidy it up 🙂 |
d0ff5c1 to
c4754e3
Compare
c4754e3 to
8a7aadf
Compare
Part of #82929.
What?
In the
Pages › create a new pagee2e test (test/e2e/specs/site-editor/pages.spec.js), the Save button click after leaving template editing is now scoped to the editor top bar:Why?
The test is flaky on this branch.
getByRole( 'button', { name: 'Save', exact: true } )can match two buttons: the editor header's Save button and the Save button in the Site Editor's Navigation sidebar save hub (edit-site-save-hub__button), which appears when there are unsaved changes. Playwright refuses to click when a locator matches more than one element, so the test fails on every attempt in the run when the save hub has rendered:It failed on #84589 (https://github.com/WordPress/gutenberg/actions/runs/38337028671) and passed when rerun with no change.
How?
Scopes the locator the same way this branch's
saveSiteEditorEntities()helper (packages/e2e-test-utils-playwright/src/editor/site-editor.ts) already clicks this button. It was the only unscoped Save click in this branch's site editor specs.Trunk never fixed this step: it skipped the whole test as flaky in #62799 (June 2024), and the test is still skipped there.
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