-
Notifications
You must be signed in to change notification settings - Fork 5
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
How to create and run automated tests for WordPress blocks #269
Comments
+1 great content idea |
Still no writer? So sad, I’ve just check everywhere and still no good guide on that subject. Maybe my comment will boost the activity 😅 |
@land0r it's a great topic, I was able to find a resource for testing plugins. Updated Dec. 2024 https://make.wordpress.org/cli/handbook/misc/plugin-unit-tests/ It's a great practice to develop a block as a plugin, the That said, this only tests against coding standards and helps with submission to the WP.org plugin repository. It won't help with
You can use software for screenshotting various browsers and OS's, there's also services out there to have actual humans test your plugin for usability. Playground also has docs for testing plugins and a Make post with good info on testing WP releases with Playground. Created for Core but a lot of the tools should overlap for plugins. https://make.wordpress.org/test/2024/03/12/test-with-playground/ |
@flexseth great, thank you! Unfortunately, that's about PHPUnit tests, but I'd love to see a cool guide about e2e tests on Jest or playwright |
Also +1 for really great content that even I have struggled with. I'd love to see a guide on getting setup with writing playwright tests and the best way to go about writing tests. |
Discussed in #24
Originally posted by juanmaguitar November 28, 2022
An article about how to create and run automated tests for our custom blocks in WordPress could be useful for both the product itself and the extenders using blocks.
In fact, I see this content as a series of two posts:
Edit
andsave
)The first post could be called "Unit Testing for Blocks" and could cover the following ideas:
These posts could even include a brief explanation of what BDD is, what CI is, and how these tests allow the Gutenberg project to grow in a more solid way.
Inspired by this answer in the support forums
The text was updated successfully, but these errors were encountered: