Projects, setup projects and test dependencies
A Playwright project is a named set of settings. Learn to run the same tests in several browsers and to run a setup project first with dependencies.
L1–L4 are part of the Pro pass
L0 Explain simply
Analogy: opening a shop in a fixed order each morning. First the lights, then the till, then the door. If the lights fail, you do not open. After the lights work, two counters can serve people at the same time.
Daily List is a to-do list app. Mei, the test lead, wants the same tests in Chromium and Firefox. She also wants the login done once, before either browser starts.
What it is: Playwright is a library that drives a real browser. This slice is a : one named group of settings in playwright.config.ts. A holds only preparation, such as the login that writes the storage file. A project dependency says which project must finish first. The nearest neighbour is a global setup script that runs outside the test runner. Playwright's own docs prefer a setup project, because it shows up in the report.
Why it matters: Daily List must work in more than one browser, and the login should not be copied into every file. Projects run the same checks under chromium and firefox after one setup. The order is written down, so nobody has to remember it.
A shop has one morning. Playwright can run the browser projects side by side after setup passes. If setup fails, the later projects do not run, which is what you want when the login itself is broken.
(SYNTHETIC / TRAINING ONLY: Daily List and every person named here are made up.)
PLAIN WORDS · 2 in this section
- chromium
- the open-source browser engine behind Google Chrome
- playwright
- a free Microsoft tool that drives a browser for tests
PICTURE IT
The picture is the one the lesson above opens with. The table below shows how each part of it matches the software.
THE REAL JOB Running set-up before the tests, in a written order, and choosing which projects to run.
- Set-up project
- Dependency rule
- Browser projects
- Teardown
HOW THE PICTURE MAPS
| In the picture | In the software |
|---|---|
| The shop owner's morning order | The dependencies rule |
| Switching on the lights | The setup project |
| Opening to customers | The browser projects |
| Closing the till at night | The teardown project |
WHERE THIS PICTURE STOPS
- A shop opens once a day, but a suite can be run again at any time.
- A real owner can still open when the lights fail. Playwright will not.
- A shop has one door, but a suite can have many browser projects side by side.
HOOK
Lights, till, open.
REMEMBER IT THIS WAY
A rule of thumb: if you see this, think that.
If a step must run before the browser tests, put it in a and name it in dependencies.
| In the trick | What it stands for |
|---|---|
| Setup project | switching on the lights |
| Dependencies | the written order, so nothing opens if the lights fail |
A project that does not name setup in dependencies does not wait for it.
TELL A FRIEND
A shop opens in a fixed order: lights, then till, then customers. Projects write that order down.
OFTEN MIXED UP WITH Logging in once: authentication and storage state. The log-in lesson writes the setup test. This lesson says how to run it first.
Sources & standards — 4 sources
- Market practice
Projects (Playwright documentation) ↗ — Microsoft (Playwright) · Projects are logical groups of tests that share a configuration and can run in several browsers; dependencies list projects that run first; a failed dependency stops dependent projects; teardown names a project that runs after; --no-deps skips dependencies (search excerpt, page not opened)
Found through a web search; the page was not opened (search excerpt, page not opened). Version: Web page, no edition number. Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail.
- Market practice
Global setup and teardown (Playwright documentation) ↗ — Microsoft (Playwright) · Reviewed 6 November 2026: Complete extracted primary article; examples inspected, not executed. See v45 source analysis for version scope and documented source ambiguities; no upstream run claimed.
Primary source opened and operative text inspected on 6 November 2026. Scope: Complete extracted primary article; examples inspected, not executed. Current live Playwright documentation reflects 1.65 where stated; explicit older examples retain their version. Source inspection is not an execution or compatibility-test claim. See the completed v45 Playwright analysis for source discrepancies and exact reading boundaries.
- Market practice
Command line (Playwright documentation) ↗ — Microsoft (Playwright) · Reviewed 6 November 2026: Complete extracted primary article; examples inspected, not executed. See v45 source analysis for version scope and documented source ambiguities; no upstream run claimed.
Primary source opened and operative text inspected on 6 November 2026. Scope: Complete extracted primary article; examples inspected, not executed. Current live Playwright documentation reflects 1.65 where stated; explicit older examples retain their version. Source inspection is not an execution or compatibility-test claim. See the completed v45 Playwright analysis for source discrepancies and exact reading boundaries.
- Market practice
Projects (Playwright documentation) ↗ — Microsoft (Playwright) · Reviewed 6 November 2026: Complete extracted primary article; examples inspected, not executed. See v45 source analysis for version scope and documented source ambiguities; no upstream run claimed.
Primary source opened and operative text inspected on 6 November 2026. Scope: Complete extracted primary article; examples inspected, not executed. Current live Playwright documentation reflects 1.65 where stated; explicit older examples retain their version. Source inspection is not an execution or compatibility-test claim. See the completed v45 Playwright analysis for source discrepancies and exact reading boundaries.
PRACTISE AND KEEP
Sources for this topic — 4 sources
- Market practice
Projects (Playwright documentation) ↗ — Microsoft (Playwright) · Projects are logical groups of tests that share a configuration and can run in several browsers; dependencies list projects that run first; a failed dependency stops dependent projects; teardown names a project that runs after; --no-deps skips dependencies (search excerpt, page not opened)
Found through a web search; the page was not opened (search excerpt, page not opened). Version: Web page, no edition number. Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail.
- Market practice
Global setup and teardown (Playwright documentation) ↗ — Microsoft (Playwright) · Reviewed 6 November 2026: Complete extracted primary article; examples inspected, not executed. See v45 source analysis for version scope and documented source ambiguities; no upstream run claimed.
Primary source opened and operative text inspected on 6 November 2026. Scope: Complete extracted primary article; examples inspected, not executed. Current live Playwright documentation reflects 1.65 where stated; explicit older examples retain their version. Source inspection is not an execution or compatibility-test claim. See the completed v45 Playwright analysis for source discrepancies and exact reading boundaries.
- Market practice
Command line (Playwright documentation) ↗ — Microsoft (Playwright) · Reviewed 6 November 2026: Complete extracted primary article; examples inspected, not executed. See v45 source analysis for version scope and documented source ambiguities; no upstream run claimed.
Primary source opened and operative text inspected on 6 November 2026. Scope: Complete extracted primary article; examples inspected, not executed. Current live Playwright documentation reflects 1.65 where stated; explicit older examples retain their version. Source inspection is not an execution or compatibility-test claim. See the completed v45 Playwright analysis for source discrepancies and exact reading boundaries.
- Market practice
Projects (Playwright documentation) ↗ — Microsoft (Playwright) · Reviewed 6 November 2026: Complete extracted primary article; examples inspected, not executed. See v45 source analysis for version scope and documented source ambiguities; no upstream run claimed.
Primary source opened and operative text inspected on 6 November 2026. Scope: Complete extracted primary article; examples inspected, not executed. Current live Playwright documentation reflects 1.65 where stated; explicit older examples retain their version. Source inspection is not an execution or compatibility-test claim. See the completed v45 Playwright analysis for source discrepancies and exact reading boundaries.
Deepest material on this page: L4 — Standards & sources. Where a topic stops short of implementation depth, that is a deliberate coverage decision, not an oversight — see coverage.