-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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 'block directory' e2e tests to Playwright #56593
Conversation
Size Change: +120 B (0%) Total Size: 1.7 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.
Great work, as always. Left just a few non-blockers. Thanks! 🚀
await expect( downloadableBlock ).toBeVisible(); | ||
|
||
// Install the block. | ||
await downloadableBlock.click(); |
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.
Since clicking the element implies visibility, can we skip the visibility check?
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.
Don't have a strong opinion here. It is just a personal translation for an action sequence - search, confirm the item is visible, and click on it 😄
Btw, our guide also suggests explicit assertions - https://developer.wordpress.org/block-editor/contributors/code/testing-overview/e2e/#make-explicit-assertions
cc @kevin940726
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.
If the visibility check is part of what we want to test then I'd say explicit assertion is often better. In cases where it fails then we get a nicer error message on that line rather than an implicit error when trying to click on it. On the other hand, if checking the visibility isn't the focus of the test (maybe some other tests did it), then we can skip the visibility check 👍.
Co-authored-by: Bart Kalisz <bartlomiej.kalisz@gmail.com>
32530b5
to
6e6231e
Compare
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.
Looks clean to me 👍
* Migrate 'block directory' e2e tests to Playwright * Remove old test files * Skip class locators. Co-authored-by: Bart Kalisz <bartlomiej.kalisz@gmail.com> * Simplify the last assertion --------- Co-authored-by: Bart Kalisz <bartlomiej.kalisz@gmail.com>
What?
Part of #38851.
PR migrates the
block-directory-add.test.js
e2e test to Playwright. I've also changed the test name into a more generalblock-directory
Why?
See #38851.
Testing Instructions