Make sure to have the following installed:
For part 2 of the workshop with Vercel, it's best to fork this repository
pnpm install
pnpm dev
- Expand the
turbo.json
with a test script. - Ensure that caching is enabled.
- Specify that changes in a
.tsx
or.ts
file should result in a cache miss. - Run the pipeline using
pnpm test
. - Run the pipeline again; it should be much faster, indicating a
FULL TURBO
mode. - Make a modification in a
.tsx
or.ts
file. - Run the pipeline again; this should result in a cache miss, causing the test to run again.
https://turbo.build/repo/docs/core-concepts/monorepos/running-tasks
- The monorepo contains 2 applications:
pizza-shop
test-automation
- The
test-automation
application contains a contact page that is not present in the other application. - Write an E2E Playwright test to navigate to the contact page and click on the button.
- Execute this test only for the
test-automation
application. - Run the test by running
pnpm dev
andpnpm e2e
in separate terminal screens.
-
Run only the E2E tests for the
pizza-shop
application:https://turbo.build/repo/docs/core-concepts/monorepos/filtering
- Extract the
button
element fromapps/test-automation/src/app/contact/page.tsx
into a sharedatoms
UI element.
- Write a
Vitest
/react-testing-library
component test for the other UI elements.
- Make sure you have the base repository forked, or pushed to your personal GitHub.
- Create a Vercel account and log in to the dashboard via GitHub.
- Add a new project from the top right.
- If you logged in via GitHub and you have the repository on that account you can simply import
monorepo-testing-workshop
- Vercel will recognize its a
NextJS
application, deploy it - Import / deploy both the
pizza-shop
as thetest-automation
application - Make a code change, and push it to the
main
branch, notice how both applications on Vercel getting a new deployment automatically.
- Uncomment the GitHub pipeline in
.github/workflows/playwright-ta.yml
- Complete the pipeline by waiting for the deployment of the
test-automation
app - Use the following action
- Create a pipeline for the
pizza-shop
app