Skip to content
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

Merged
merged 30 commits into from
May 12, 2022
Merged

Test with playwright #139

merged 30 commits into from
May 12, 2022

Conversation

naxoc
Copy link
Member

@naxoc naxoc commented May 12, 2022

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

  1. yarn e2e (should work "cold" and with Storybook already running)

✅ CI tests should pass.

@naxoc naxoc self-assigned this May 12, 2022
run: npx playwright install --with-deps
- name: Serve Storybook and run tests
run: |
yarn storybbok \
Copy link
Contributor

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.

Copy link
Member Author

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!

Copy link
Contributor

@msurdi msurdi May 12, 2022

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

Copy link
Member

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! 🔥

naxoc and others added 11 commits May 12, 2022 12:10
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
@mirka mirka force-pushed the test/with-playwright branch from 7a28f00 to deee2ea Compare May 12, 2022 10:40
naxoc and others added 13 commits May 12, 2022 12:45
@mirka mirka merged commit c1c8542 into trunk May 12, 2022
@mirka mirka deleted the test/with-playwright branch May 12, 2022 14:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Set up E2E tests
3 participants