-
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 code block test case to playwright #40844
Conversation
👋 Thanks for your first Pull Request and for helping build the future of Gutenberg and WordPress, @pavanpatil1! In case you missed it, we'd love to have you join us in our Slack community, where we hold regularly weekly meetings open to anyone to coordinate with each other. If you want to learn more about WordPress development in general, check out the Core Handbook full of helpful information. |
Thanks for working on this @pavanpatil1! Just a few things to fix in this PR, but on the whole looks good. I'll invite @kevin940726 for any further feedback. Gutenberg uses the If you're using an editor like VSCode you can also install a It also looks like there's a snapshot file used by the old test that needs to be deleted - |
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.
Apart from the minor issues Dan already mentioned, it mostly looks pretty good! I just have a small feedback to suggest inlining the clickBlockAppender
util if possible.
} ); | ||
|
||
test( 'can be created by three backticks and enter', async ({page,pageUtils}) => { | ||
await pageUtils.clickBlockAppender(); |
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.
We usually want to limit the usage of e2e utils if we can inline them directly. If we're just creating a page, I believe we can just click on the appender button directly:
await pageUtils.clickBlockAppender(); | |
await page.click( 'role=button[name="Add default block"i]' ); |
The same code has also been used in copy-cut-paste
tests. This way we don't have to create the clickBlockAppender
util (unless we really need it in other situations).
Hi @kevin940726, I addressed all the shared feedback. However, the CI is failing on Static Analysis (Linting, License, Type checks...) / All (pull_request)`. I followed the steps mentioned here #40844 (comment). Formatted the code still it is failing. |
Thank you for working on this and sorry for the late reply 🙇 . Unfortunately, it seems like this test had already been migrated in #41136 by @JustinyAhin. Normally, we would want to close the latest one but we forgot about that 😞 . We'll try to pay attention to this kind of problem more in the future. Sorry about it! 🙇 We're still very grateful for your work, and hope that you can start another PR soon next time ;) |
@pavanpatil1 I'm happy to do a pair coding session with you to work on a migrating couple of tests migration if that interests you :). |
What?
Migrate code-test.js to its Playwright version.
Why?
See #38570 for its background.
How?
See MIGRATION.md for migration steps.
Testing Instructions
Run
npm run test-e2e:playwright test/e2e/specs/editor/blocks/code.spec.js