-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
[charts] Setup playwright for E2E testing #13696
Closed
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
JCQuintas
added
test
core
Infrastructure work going on behind the scenes
component: charts
This is the name of the generic UI component, not the React module!
labels
Jul 1, 2024
JCQuintas
force-pushed
the
setup-playwright-for-charts
branch
from
July 1, 2024 19:34
67317f4
to
011946f
Compare
Deploy preview: https://deploy-preview-13696--material-ui-x.netlify.app/ |
github-actions
bot
added
the
PR: out-of-date
The pull request has merge conflicts and can't be merged
label
Jul 2, 2024
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
component: charts
This is the name of the generic UI component, not the React module!
core
Infrastructure work going on behind the scenes
PR: out-of-date
The pull request has merge conflicts and can't be merged
test
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Experimental Component Testing
Component testing is currently in experimental mode, we could use something similar to what
e2e
is doing though, if we deem this is too risky.The main drawback of component testing is that you can't pass a synchronous function as a prop to a component, because it will be executed in the test environment, not in the browser. You can define your component's "story" in a different file and import it in the test file.
For that we use a
*.e2e.stories.tsx
file, where we define the stories for the components we want to test.Reasoning vs RTL
Some of our features use SVG apis that are not available in the JSDOM environment. This is why we use playwright to run the tests in a real browser.
An alternative would be to use svgdom or polyfill everything ourselves.
Why not leverage the current
test:e2e:website
ortest:e2e
:e2e:website
seems to test the website itself, and adding tests to the examples could break if we decide to redo or change the examples.:e2e
seems to use mocha as the test runner and has a complex setup, probably was required for an old version of playwright.Version
Using
next
because they coincidentally just added touch simulation support, which I needed for the tests 🙃Running tests
Remember to install the deps and playwright browsers as well.
or
CI/CD