Make sure to have the following installed:
For part 2 of the workshop with Vercel, it's best to fork this repository
pnpm installpnpm dev- Expand the
turbo.jsonwith a test script. - Ensure that caching is enabled.
- Specify that changes in a
.tsxor.tsfile should result in a cache miss. - Run the pipeline using
pnpm test. - Run the pipeline again; it should be much faster, indicating a
FULL TURBOmode. - Make a modification in a
.tsxor.tsfile. - 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-shoptest-automation
- The
test-automationapplication 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-automationapplication. - Run the test by running
pnpm devandpnpm e2ein separate terminal screens.
-
Run only the E2E tests for the
pizza-shopapplication:https://turbo.build/repo/docs/core-concepts/monorepos/filtering
- Extract the
buttonelement fromapps/test-automation/src/app/contact/page.tsxinto a sharedatomsUI element.
- Write a
Vitest/react-testing-librarycomponent 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
NextJSapplication, deploy it - Import / deploy both the
pizza-shopas thetest-automationapplication - Make a code change, and push it to the
mainbranch, 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-automationapp - Use the following action
- Create a pipeline for the
pizza-shopapp