TOPIC 02/6018 MINNOT STARTED

Install Playwright and run your first test

Set up a new Playwright project with one command, write a first test for Daily List, run it, and open the report. Fix the two errors new users meet most.

L1–L4 are part of the Pro pass

L0 Explain simply

Analogy: unpacking a new kitchen gadget and making the first slice of toast. You take the parts out, plug the gadget in, and press the lever once. Toast means the whole chain works. Fancy settings can wait.

Daily List is a to-do list app. Tom, the tester, wants Playwright on his laptop. He does not start with a big plan. He installs it, runs one tiny test, and watches it pass.

What it is: Playwright is a library that drives a real browser. This slice is the install: the library, the browsers it drives, and the first test file. A downloads the library. Here that tool is npm, which comes with Node.js. Selenium and Cypress need their own install steps and their own browser setup. The folder you get is not the same.

Why it matters: Until the install works on Tom's laptop, every later lesson is stuck. One green test proves the library, the browsers, and the can talk to each other.

A toaster is finished after one slice. A test project keeps growing, and the browsers need a fresh download after a library update.

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

PLAIN WORDS · 4 in this section
unpacking
opening out so the parts can be seen
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 Setting up a tool in small steps and proving the whole chain works with one tiny test before building more.

  1. Run the setup command
  2. Install the browsers
  3. Run one tiny test
  4. Open the report
One slice first

HOW THE PICTURE MAPS

How each part of the picture matches the software
In the pictureIn the software
Unpacking the boxRunning the setup command
Putting the plug inInstalling the browsers
The first slice of breadThe first small test
Toast popping upA passing run and a report

WHERE THIS PICTURE STOPS

  • A toaster is finished after one slice. A test project keeps growing.
  • A gadget does not need updates. Playwright and its browsers do.
  • A gadget has one plug. Setup has several pieces that can each go wrong.

HOOK

One slice first.

REMEMBER IT THIS WAY

A chunk: a long list grouped so it is easier to hold.

Three commands, one tiny test: set up, run, report. Build more only after that first pass.

What each part of the trick stands for
In the trickWhat it stands for
Set upsetting up takes one command
Runthe first run takes another
Reporta third command opens a report of what happened

TELL A FRIEND

Unpack the gadget, plug it in and toast one slice to prove it works.

OFTEN MIXED UP WITH The project layout and the config file. This lesson sets up and runs a first test. The structure lesson goes through each file and setting that the setup created.

Sources & standards — 4 sources
  1. 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.

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

  3. Market practice

    Browsers (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 the browsers Playwright drives and how they are installed. 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.

  4. Market practice

    Running and debugging tests (Playwright documentation) ↗ — Microsoft (Playwright) · Tests run headless by default; --headed shows the browser; a file name or title can be given to run a subset; show-report opens the report (search excerpt, page not opened)

    Shows how to run all tests, one file, one project and headed mode. Vendor documentation, 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; read at the time of writing. 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.

PRACTISE AND KEEP

Sources for this topic — 4 sources
  1. 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.

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

  3. Market practice

    Browsers (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 the browsers Playwright drives and how they are installed. 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.

  4. Market practice

    Running and debugging tests (Playwright documentation) ↗ — Microsoft (Playwright) · Tests run headless by default; --headed shows the browser; a file name or title can be given to run a subset; show-report opens the report (search excerpt, page not opened)

    Shows how to run all tests, one file, one project and headed mode. Vendor documentation, 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; read at the time of writing. 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.

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.