-
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
Add end to end tests for the storybook playground block editor #26184
Comments
Actually, we discussed it several times that a subset of tests could work with Storybook instance only. In particular, the block editor seems to be a perfect fit as it by definition should work more or less the same on WordPress instance, in the mobile app, in the 3rd party app like Storybook. I'm 100% on board with the idea. It should be way much easier to set everything up than for WordPress instance as you don't need Docker 😃 |
On other projects I've worked on similar has been achieved by setting up test suites, which have some basic configuration, something like: {
name: 'storybook-tests',
tests: [
'editor/various/adding-blocks.test.js',
// ...,
],
config: {
EDITOR_URL: 'https://localhost:12345/?path=/story/playground-block-editor--default'
}
} Some challenges:
|
I personally don't like the idea of sharing test suites between different platforms. If the test can be run with Storybook only, then there is no need to repeat it using the full WordPress instance. |
I just wanted to reshare some previous work in the same area to give a better overview of what was already explored. @ellatrix did some very promising explorations to write e2e like tests that use Storybook to run tests related to RichText functionality:
There were also explorations to use visual testing:
We have been playing with snapshot testing for components as well, You can check #18031 where Storyshots integration with Storybook was enabled. It was removed a few months later. |
Is your feature request related to a problem? Please describe.
A couple of times recently bugs have been introduced in the block editor package that could've been prevented by a small suite of end to end tests:
Both issues were related to some configuration that shouldn't need to be specified but was present in the post editor, an easy mistake to make, but also easy for automated testing to catch.
We've often relied on user reports to solve these bugs, but they could be caught before introduction using end to end tests
The tests would include some basic interactions, adding/removing blocks, changing settings etc...
Potentially some of these tests could even run across multiple editors (post editor, standalone editor, FSE editor, widget, navigation) where the feature is consistent across those editors.
Describe the solution you'd like
Add e2e tests for the storybook example of the Block Editor:
https://wordpress.github.io/gutenberg/?path=/story/playground-block-editor--default
Describe alternatives you've considered
Alternatively, add a basic example within the plugin itself, similar to the demo page which has e2e tests.
The text was updated successfully, but these errors were encountered: