-
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 Allowed Block Test to Playwright #53171
Migrate Allowed Block Test to Playwright #53171
Conversation
Hi @Mamaduka, I hope you are doing great! Could you please review this PR? And let me know if there are any suggestions. Thanks! |
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'll try to do a more in-depth review later this week, but at a glance, I think there's room to improve locators and assertions.
- Use web first assertion and get rid of
not.toBeNull()
andtoBeUndefined()
- https://playwright.dev/docs/best-practices#use-web-first-assertions. - Prefer accessible and user-facing attributes to XPath and CSS classes - https://playwright.dev/docs/best-practices#prefer-user-facing-attributes-to-xpath-or-css-selectors.
Some of those are already covered in the block editor handbook - https://developer.wordpress.org/block-editor/contributors/code/testing-overview/e2e/.
Sure @Mamaduka! Thanks for sharing I will work and push the changes. |
Hi @Mamaduka, All feedbacks are been addressed! |
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.
Thank you, @pooja-muchandikar!
I left few more notes, but in general migration looks good 👍
What?
Part of #38851.
Migrate allowed-blocks.test.js to its Playwright version.
Why?
Part of #38851.
How?
See MIGRATION.md for migration steps.
Testing Instructions
Run
npm run test-e2e:playwright test/e2e/specs/editor/plugins/allowed-blocks.spec.js