-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Try fixing flaky 'inserting blocks' e2e tests #58848
Conversation
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. |
Size Change: 0 B Total Size: 1.71 MB ℹ️ View Unchanged
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR!
Moving from the focused post title field to the editor canvas using the
Enter
key failed, so I replaced it with the default block appender click action.
Is the instability caused by the Enter key being pressed before the post title is focused? If so, does it make sense to check focus before pressing Enter?
gutenberg/test/e2e/specs/editor/plugins/nonce.spec.js
Lines 17 to 22 in 93d417b
await admin.createNewPost(); | |
await expect( | |
editor.canvas.getByRole( 'textbox', { name: 'Add title' } ) | |
).toBeFocused(); | |
await page.keyboard.press( 'Enter' ); | |
await page.keyboard.type( 'test' ); |
Or, if we switch to the approach of clicking the default block inserter instead of pressing Enter, the implicit test for "When pressing Enter on a post title, creates an empty paragraph block and moves focus" might lost.
As far as I can see, this is not explicitly tested, so what do you think about adding this test?
Correct. These tests aren't about the post-title field, so it doesn't matter how we insert blocks.
If it's not already covered by post-title specs, then yes, we should add it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM !
As far as I can see, this is not explicitly tested, so what do you think about adding this test?
If it's not already covered by post-title specs, then yes, we should add it.
Regarding this, I would like to submit a PR to add it separately 👍
Thank you, Aki! |
What?
Fixes #41477.
Fixes #40301.
Fixes #35280.
Fixes #45332.
PR tries to fix a few flaky tests in the
inserting blocks
suite.How?
Enter
key failed, so I replaced it with the default block appender click action.Browse all
#45332 - for a brief moment, two inserters can be on the page, and the locator strick check will fail. I've added context to the locators. Similar to Block inserter search e2e test: scope list item lookup to the inserter panel #47066.Testing Instructions
Screenshots