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

docs: guide for Playwright #9662

Merged
merged 1 commit into from
Jan 3, 2025
Merged

docs: guide for Playwright #9662

merged 1 commit into from
Jan 3, 2025

Conversation

anthonyshew
Copy link
Contributor

@anthonyshew anthonyshew commented Jan 1, 2025

Description

Guide on how to use Playwright in Turborepo.

Testing Instructions

👀

@anthonyshew anthonyshew requested a review from a team as a code owner January 1, 2025 08:03
@turbo-orchestrator turbo-orchestrator bot added the area: docs Improvements or additions to documentation label Jan 1, 2025
Copy link

vercel bot commented Jan 1, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
examples-basic-web ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 1, 2025 8:04am
examples-designsystem-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 1, 2025 8:04am
examples-gatsby-web ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 1, 2025 8:04am
examples-kitchensink-blog ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 1, 2025 8:04am
examples-native-web ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 1, 2025 8:04am
examples-nonmonorepo ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 1, 2025 8:04am
examples-svelte-web ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 1, 2025 8:04am
examples-tailwind-web ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 1, 2025 8:04am
examples-vite-web ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 1, 2025 8:04am


## Sharing Playwright utilities

You can also create a common package for shared utilities that you need in your end-to-end test suites. We recommend using `peerDependencies` in this shared package so that you can get access to Playwright used in consumers without having to install Playwright into the shared package itself.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❤️ spreading the gospel of peer dependencies


</Tabs>

Later on, when you want to run your end-to-end tests, use [the `--only` flag](/repo/docs/reference/run#--only) to run end-to-end tests without running the application's build first. As an example, your command may look like `turbo run e2e --filter=@repo/playwright-myapp --only`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could encode this behavior in the graph with a "src": {"dependsOn": ["^src"]} definition and updating "e2e": { "dependsOn": ["^src"] }. This encodes in the task graph that e2e doesn't actually require the app to build vs in runtime args. (We do this for some Rust tasks)

The downside is it introduces "transit nodes" 🤷

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tough one. I don't see any clear winner on the tradeoffs...Let's ship it and see if feedback tells us to re-approach that way.

@anthonyshew anthonyshew merged commit 7ca6219 into main Jan 3, 2025
36 checks passed
@anthonyshew anthonyshew deleted the shew-05f97 branch January 3, 2025 15:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: docs Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Docs: Turborepo 2.0 and playwright docker container
2 participants