-
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
Migrate 'dropdown menu' e2e tests to Playwright #57663
Conversation
Size Change: 0 B Total Size: 1.69 MB ℹ️ View Unchanged
|
// Expect the first menu item to be focused. | ||
await expect( menuItems.first() ).toBeFocused(); |
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.
From what I understand, the original test opens the Options menu every time it is tested, but this PR runs all tests after the Options menu opens for the first time. If so, I think this assertion might be unnecessary. This is because the last assertion of the previous test (Arrow back up to the first item.
) ensures that the focus is on the first element.
Or is it better not to use test.step
to maintain the original test specification? 🤔
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.
Each step expects the focus to start from the first menu item; this assertion just double-checks that.
Or is it better not to use test.step to maintain the original test specification?
Do you mean to create a new post for each test? That's usually the most expensive part of the tests, and we don't make any content assertions; I think re-using the same post should be okay.
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.
Do you mean to create a new post for each test?
It's okay to reuse the same post, but I thought it might be a good idea to reopen the Options menu for each tests.
What do you think?
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.
I don't have a strong opinion, but the current method should be okay. Even if you run each step separately, they will pass.
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.
I see, I don't have a strong opinion either, so let's go with this 👍
Thanks for the review, @t-hamano. It's much appreciated, as always 🙇 |
What?
Part of #38851.
PR migrates
dropdown-menu.test.js
e2e tests to Playwright.Why?
See #38851.
How?
The e2e test now uses
test.step
for grouping assertions. A minor improvement for test runtime.Testing Instructions