Fix flaky homepage-settings e2e test#78063
Conversation
|
Size Change: 0 B Total Size: 7.95 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 Unlinked AccountsThe following contributors have not linked their GitHub and WordPress.org accounts: @m13v. Contributors, please read how to link your accounts to ensure your work is properly credited in WordPress releases. 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. |
|
Flaky tests detected in 6fa722e. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/25505246569
|
|
@jsnajdr, doing the lord’s work 😁🙌 |
Fixes #77385 where the test sometimes sees a duplicate "Sample page" row and fails. That's because "Sample page" is one of two default pages your WordPress install will create:
and the test setup will create another one. I fixed this by giving the test pages more meaningful names: "Homepage" and "Posts page". This way it doesn't conflict with the default pages.
The test was failing when no previous test ran
deleteAllPagesfor it, in the same shard.The fix in #77893 calls
deleteAllPagesbefore the test. That's OK, but the usual convention is that the test assumes at the start that the environment is clean, and takes the responsibility to clean up after.I'm also fixing another important thing: as written, the test wasn't testing the tested behavior at all! It is supposed to check that after setting a page as a homepage, the menu items "Set as homepage" and "Set as posts page" are no longer present. But at the time of the check, the menu is not even displayed! I fixed the workflow to run through the UI correctly. Wait until a confirmation modal is closed, open and close the menu properly. You can check in the
test:e2e:debugmode what it does now. This part of the fix wasn't done by the AI agent at all.