-
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
Fix flaky block hierarchy navigation test by better inserter selection #48780
Conversation
Size Change: 0 B Total Size: 1.34 MB ℹ️ View Unchanged
|
Thank you for starting this! I noticed that now the test failed though. I think it is related? |
Yes, it is related. I changed two tests. One, "should navigate block hierarchy using only the keyboard", passed, the other, "should navigate using the list view sidebar", is now failing even more 🙂 I'll need to continue working on this. |
If it's too much trouble fixing the existing tests, maybe refactoring them to Playwright would help? We can get rid of all the |
f3783e7
to
d51885e
Compare
Turns out this assumption is completely wrong. In the inserter the blocks are ordered by "frecency", so as soon as the test inserts a "Columns" block, it becomes the first block in the inserter list. I had to update the fix by directly waiting for a CSS selector (the paragraph list item) and then clicking on it.
If the second attempt at a fix will also fail, I'll give up and consider the Playwright migration 🙂 |
After the latest fixes the e2e tests are green, so I think the PR is ready for review and merging. |
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.
This is probably an okay solution until this gets migrated to playwright. Generally, I think the goal is to try to avoid hardcoding classes. @kevin940726 should probably be the deciding voice on this.
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.
Yeah, I'm not a fan of hard-coding classes in e2e tests, but as long as it fixes the issues and unblocks contributors, I'm all for merging this as a temporary solution until we migrate to Playwright 👍 .
We could also find the Paragraph block inserter item by looking for a11y properties: role "option" and label "Paragraph". Is that possible and convenient to do in Puppeteer? Or do we need to migrate to Playwright first and only then use their |
@jsnajdr Playwright makes all of this easier. Should be fine waiting. |
Attempt to fix a flaky e2e test tracked in #47001, where @kevin940726 reports:
Apparently there are issues with inserting a Paragraph block into a Column, because the failed snapshots show that a Heading was inserted instead.
I'm trying to fix this by improving the code that opens the block inserter and selects the Paragraph block from there. The old code types "paragraph" into the search box and then presses Tab twice, once to tab to the "Reset search" button, and second time to the search results. I think the test did that tabbing before the search results appeared.
The new code relies on the fact that the Paragraph block is always the first in the list, so we don't search: we just Tab to the first result.
We already did similar fixes in #47173, during the concurrent mode migration.