-
Notifications
You must be signed in to change notification settings - Fork 53
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
Test with playwright #139
Test with playwright #139
Conversation
.github/workflows/nodejs.yml
Outdated
run: npx playwright install --with-deps | ||
- name: Serve Storybook and run tests | ||
run: | | ||
yarn storybbok \ |
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.
Are we 100% sure we want to go our own way on writing, running and debugging tests vs using the official test tools setup by storybook? I'm personally not that convinced, but happy to do it this way too if the rest of the team thinks it is required, easier or just enough for our use case.
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 all for using what is easier, so let's use the official tools if you think that is easier!
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 think having the benefits of community support and tooling are worth to give it a try. Disclaimer: I've never used it myself, just seen this in use by a sibling team at a previous job and didn't hear many complaints.
Here's an example I've just found of some of the tooling you get for writing/debugging tests, if you want to give it a try and see how it feels. And here seems to be the source code of how the tests are organized.
One thing I like is that the test code sticks together with the "story", so it is easier to keep together a component's documentation, tests, etc.
WARNING: That website might make you hungry
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.
Playwright tests for iso-editor are going to be more focused on functionality rather than UI/components for now (13901df), but I'm hoping to go the @storybook/test-runner
route for wp-components! 🔥
I think it makes sense to keep e2e test files closer to the implementation files (along with unit tests), rather than group them with the Storybook files. This is because I think we'll be testing different functionality (undo, collab, etc.) using some of the same stories.
# Conflicts: # package.json
# Conflicts: # .github/workflows/nodejs.yml
7a28f00
to
deee2ea
Compare
…-block-editor into test/with-playwright
…-block-editor into test/with-playwright
Can't get it to work! Fails on the Firefox test only. Only fails on cold starts (`yarn e2e` without the storybook server previously running).
…-block-editor into test/with-playwright
Closes #129
Proposed changes
This adds a Playwright e2e setup so we can better test cross-browser issues and interactions that are too complicated for jsdom.
To test
yarn e2e
(should work "cold" and with Storybook already running)✅ CI tests should pass.