-
Notifications
You must be signed in to change notification settings - Fork 991
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 playwright smoke tests for storybook #5329
Conversation
✅ Deploy Preview for redwoodjs-docs canceled.
|
Awesome start! Couple of questions:
|
Yeah good point - I think certainly something we can add a test for, but I don't think we have a clear picture on how to even deploy the storybook after a build at the moment. Very happy to start looking at this option, and once we have documentation and an understanding of how we think it should work, we can add a smoke test
I'll remove it! |
experiment with loaders the loaders are async and execute before the story is rendered https://storybook.js.org/docs/react/writing-stories/loaders https://mswjs.io/ Co-authored-by: Yann Braga <yannbf@gmail.com>
…ok-smoke-test * 'main' of github.com:redwoodjs/redwood: Use GraphQL Codegen to generate more accurate resolver types (redwoodjs#5216) chore(deps): update dependency @clerk/clerk-sdk-node to v3.3.8 (redwoodjs#5345) fix(deps): update dependency jest-watch-typeahead to v1.1.0 (redwoodjs#5339)
Ok @virtuoushub - so I've been trying super hard to get these smoke tests to pass on Linux and Windows - and it looks like our currently implementation of mockCurrentUser without the loader, can be flakey under CI/Codespaces. Under normal human use I think ti doesn't matter, because by the time we refresh the page the mocks become available, but when playwright is running the test, maybe its too fast for the mocks to load? I suspect this has something to do with: I tried merging in your code in #4919 and the tests seem to pass - which says to me that the loader implementation is more solid!
|
Awesome! And yes, that PR is directly meant to address the some of the issues you noticed in CI/CD. Glad you are able to take advantage. |
… and it has not loaded
…ok-smoke-test * 'main' of github.com:redwoodjs/redwood: Remove extra checkout in RC workflow (redwoodjs#5414) chore(deps): update dependency @azure/msal-browser to v2.24.0 (redwoodjs#5412) fix(deps): update react monorepo (redwoodjs#5406) cli upgrade: Always search from the start for semvers (redwoodjs#5368) codegen graphql schema (redwoodjs#5213) fix(deps): update dependency core-js to v3.22.4 (redwoodjs#5409) fix(deps): update typescript-eslint monorepo to v5.22.0 (redwoodjs#5410) Add graphql-scalars to graphql-server (redwoodjs#5408) Update yarn.lock v1.2.1 fix(deps): update dependency cross-undici-fetch to v0.3.6 (redwoodjs#5402) fix(deps): update dependency cross-undici-fetch to v0.3.5 (redwoodjs#5398) fix(deps): update dependency cross-undici-fetch to v0.3.3 (redwoodjs#5378) chore(story📗): extract MSW logic into a loader (redwoodjs#4919)
…into feat/storybook-smoke-test * 'feat/storybook-smoke-test' of github.com:dac09/redwood:
This reverts commit 343c156.
FINALLY. Tests passing on all platforms. Ready for final review. |
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.
🙇🏻♂️
Closes #5276
What does the PR do?
Adds playwright smoke tests, after launching storybook on the test project.
There are 3 tests:
mockCurrentUser
does what it says on the tinAnd implicitly - that the storybook command, and server are working as expected
Video walk through
(sorry for the bad audio)