Chapter 59: Parallel execution and CI
Automation learning lab
Playwright Automation
Self Study Guide
Start from zero. Learn JavaScript and TypeScript, automate browsers, and build reliable end-to-end tests.
Parallel execution and CI
Workers execute tests in separate processes. CI runs a repeatable install and test sequence on a build agent. npm ci requires a committed lockfile, and browser installation must match the Playwright package. Publish reports as restricted artifacts. Start with stable tests before increasing concurrency.
How it works
Step-by-step walkthrough
- Commit package and lockfile
- Install dependencies on CI
- Run with a controlled worker count
Example
This is a focused snippet. Use it in the file or test context described in the walkthrough.
npm ci
npx playwright install --with-deps
npx playwright test --workers=2
# In CI, upload playwright-report/ as an artifact.Ensure tests do not depend on order or shared mutable accounts.
✎ Your practice task
Run with one worker and compare outcomes with two workers.
Knowledge check
Which command installs dependencies from the lockfile?
🌐 Continue learning
60-chapter learning path
Start at chapter 1, or choose any topic. Your progress is tracked separately for each chapter.
JavaScript fundamentals
TypeScript fundamentals
Playwright • setup & locators
Playwright • interactions & assertions
Playwright • framework & debugging
Playwright • real-world automation
Interactive practice lab
Try the controls below and observe the corresponding Playwright locator instructions. This browser demo does not execute Node.js or Playwright Test; copy the code to your local Playwright project to automate it.
Task manager demo
Suggested automation
Actions on the demo update these examples. In your local test use a page that contains the same controls.
Download a standalone lab page, then serve it locally (for example with Python's http.server). Navigate to it in a Playwright test.