TOPIC 03/6016 MINNOT STARTED

The project layout and the config file

Learn what each folder and file in a Playwright project is for, and what goes in the config file: where tests live, the base address, and the browsers to run.

L1–L4 are part of the Pro pass

L0 Explain simply

Analogy: the labelled drawers of a tidy toolbox. Screws live in one drawer and drills in another. You read the label and open the right drawer. You do not dump the box on the floor.

Daily List is a to-do list app. Tom's has a few folders and one settings file. Mei, the test lead, walks him through them. Tests go in one folder. Settings go in one file. Results go in another folder.

What it is: Playwright is a library that drives a real browser. This slice is the and the , usually named playwright.config.ts. Test configuration is the shared choices in that file: where tests live, the base URL, and which browsers run. Use options are the browser settings inside use. A setting in the wrong level is the mix-up. Selenium and Cypress also have config files, and the key names are not the same.

Why it matters: Without a , every test repeats the full address. When the address changes, Tom must edit every file. One line in the config fixes all of them, so two people cannot quietly point tests at two sites.

Toolbox drawers do not change how a drill behaves. This file does change how every test runs.

(SYNTHETIC / TRAINING ONLY: Daily List, its test site, and every person named here are made up.)

PLAIN WORDS · 3 in this section
playwright
a free Microsoft tool that drives a browser for tests
selenium
A free tool that drives a web browser for checks.
cypress
A free tool that drives a web browser for checks.

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 Knowing where each setting lives, so one change in one place moves every test.

  1. Tests in the tests folder
  2. Runner settings at the top
  3. Browser settings in use
  4. Results in report folders
Right setting, right drawer

HOW THE PICTURE MAPS

How each part of the picture matches the software
In the pictureIn the software
The toolboxThe test project
A labelled drawerA folder or a block in the config
The label on the drawerThe setting's name
Opening one drawer for the right toolChanging one setting for every test

WHERE THIS PICTURE STOPS

  • Drawers do not change how a tool works. A config setting changes how every test runs.
  • A toolbox has no wrong drawer for a label. A setting in the wrong block is silently ignored.
  • A drawer can be opened by anyone. A config change needs a review.

HOOK

Right setting, right drawer.

REMEMBER IT THIS WAY

A rule of thumb: if you see this, think that.

If a setting must hold for every test, change it once in the and every test follows.

What each part of the trick stands for
In the trickWhat it stands for
Config fileholds the settings that every test shares
One changeevery test follows the setting

A setting that only one test needs may not belong in the shared file.

TELL A FRIEND

A tidy toolbox where each drawer has a label, so you never dig for a tool.

OFTEN MIXED UP WITH Install Playwright and run your first test. The setup lesson creates the project and runs a first test. This lesson explains the files it made and the config settings.

Sources & standards — 5 sources
  1. Market practice

    Configuration (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.

    Describes playwright.config.ts, testDir, the use block, the webServer setting and forbidOnly, which makes a run fail when a test or group is marked only and suits CI. Vendor documentation, 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.

  2. Market practice

    Configuration (use) (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.

    Says which options belong in use and how baseURL makes relative paths work. Vendor documentation, 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

    Installation (Playwright documentation) ↗ — Microsoft (Playwright) · Installation / intro: actual setup prompts, generated config/tests, selected browser projects, reports and version-matched browser installation reviewed 6 November 2026. Current source supports Node 22/24/26 lines; no claim that every platform/scaffold option was executed.

    Describes the init command, the prompts, the generated files and how to install and update browsers. Vendor documentation, not a standard. · Checked 2026-11-06

    Actual complete Installation/intro article inspected during Phase 1 on 6 November 2026, including setup prompts, generated files, selected projects, reports and browser update/install contract. Source inspection is not a claim that every scaffold command, supported operating system or version was executed. Documentation licence CC BY 4.0 was separately reviewed; version and local-execution limits are in the v45 audit.

  4. Market practice

    Best practices (Playwright documentation) ↗ — Microsoft (Playwright) · Test user-visible behaviour, keep tests isolated, prefer role and text locators over fragile selectors, and use web-first assertions (search excerpt, page not opened)

    Recommends user-facing locators such as role-based ones over Cascading Style Sheets (CSS) or XPath, web-first assertions that retry, and avoiding fixed waits. Vendor documentation. Practitioner or vendor guidance, not a standard unless stated. · 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. A second search on 2026-10-20 returned this page for its title and matched the described content; the page was still not opened (search excerpt, page not opened).

  5. Market practice

    Retries ↗ — Playwright (Microsoft) · 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.

    A test that fails and then passes on retry is categorized flaky; the run can be set to fail on flaky tests. · 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 — 5 sources
  1. Market practice

    Configuration (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.

    Describes playwright.config.ts, testDir, the use block, the webServer setting and forbidOnly, which makes a run fail when a test or group is marked only and suits CI. Vendor documentation, 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.

  2. Market practice

    Configuration (use) (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.

    Says which options belong in use and how baseURL makes relative paths work. Vendor documentation, 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

    Installation (Playwright documentation) ↗ — Microsoft (Playwright) · Installation / intro: actual setup prompts, generated config/tests, selected browser projects, reports and version-matched browser installation reviewed 6 November 2026. Current source supports Node 22/24/26 lines; no claim that every platform/scaffold option was executed.

    Describes the init command, the prompts, the generated files and how to install and update browsers. Vendor documentation, not a standard. · Checked 2026-11-06

    Actual complete Installation/intro article inspected during Phase 1 on 6 November 2026, including setup prompts, generated files, selected projects, reports and browser update/install contract. Source inspection is not a claim that every scaffold command, supported operating system or version was executed. Documentation licence CC BY 4.0 was separately reviewed; version and local-execution limits are in the v45 audit.

  4. Market practice

    Best practices (Playwright documentation) ↗ — Microsoft (Playwright) · Test user-visible behaviour, keep tests isolated, prefer role and text locators over fragile selectors, and use web-first assertions (search excerpt, page not opened)

    Recommends user-facing locators such as role-based ones over Cascading Style Sheets (CSS) or XPath, web-first assertions that retry, and avoiding fixed waits. Vendor documentation. Practitioner or vendor guidance, not a standard unless stated. · 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. A second search on 2026-10-20 returned this page for its title and matched the described content; the page was still not opened (search excerpt, page not opened).

  5. Market practice

    Retries ↗ — Playwright (Microsoft) · 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.

    A test that fails and then passes on retry is categorized flaky; the run can be set to fail on flaky tests. · 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.