TOPIC 18/6022 MINNOT STARTED

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.

  1. Set-up project
  2. Dependency rule
  3. Browser projects
  4. Teardown
Lights, till, open

HOW THE PICTURE MAPS

How each part of the picture matches the software
In the pictureIn the software
The shop owner's morning orderThe dependencies rule
Switching on the lightsThe setup project
Opening to customersThe browser projects
Closing the till at nightThe 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.

What each part of the trick stands for
In the trickWhat it stands for
Setup projectswitching on the lights
Dependenciesthe 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
  1. 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)

    Describes projects as logical groups of tests that share a configuration, run in several browsers, with a dependencies list so setup projects run first, a teardown property and the --no-deps option. Vendor documentation for one tool. Practitioner guidance, not a standard. · Checked 2026-10-18

    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.

  2. 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.

    Presents project dependencies as the recommended way to do set-up and clean-up, with setup and teardown code written as regular tests, and global setup files as the alternative. Vendor documentation for one tool. Practitioner guidance, not a standard. · Checked 2026-11-06

    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.

  3. 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.

    Lists the npx playwright test options, including --grep, --grep-invert, --project and --no-deps. Vendor documentation for one tool. Practitioner guidance, not a standard. · Checked 2026-11-06

    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.

  4. 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.

    Shows projects in the config file, each with a name and a use block, and spreading a device preset such as devices iPhone 13 into a project; overrides such as viewport go after the spread. Vendor documentation for one tool. Practitioner or vendor guidance, not a standard. · Checked 2026-11-06

    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
  1. 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)

    Describes projects as logical groups of tests that share a configuration, run in several browsers, with a dependencies list so setup projects run first, a teardown property and the --no-deps option. Vendor documentation for one tool. Practitioner guidance, not a standard. · Checked 2026-10-18

    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.

  2. 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.

    Presents project dependencies as the recommended way to do set-up and clean-up, with setup and teardown code written as regular tests, and global setup files as the alternative. Vendor documentation for one tool. Practitioner guidance, not a standard. · Checked 2026-11-06

    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.

  3. 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.

    Lists the npx playwright test options, including --grep, --grep-invert, --project and --no-deps. Vendor documentation for one tool. Practitioner guidance, not a standard. · Checked 2026-11-06

    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.

  4. 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.

    Shows projects in the config file, each with a name and a use block, and spreading a device preset such as devices iPhone 13 into a project; overrides such as viewport go after the spread. Vendor documentation for one tool. Practitioner or vendor guidance, not a standard. · Checked 2026-11-06

    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.