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.
- Run the setup command
- Install the browsers
- Run one tiny test
- Open the report
HOW THE PICTURE MAPS
| In the picture | In the software |
|---|---|
| Unpacking the box | Running the setup command |
| Putting the plug in | Installing the browsers |
| The first slice of bread | The first small test |
| Toast popping up | A 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.
| In the trick | What it stands for |
|---|---|
| Set up | setting up takes one command |
| Run | the first run takes another |
| Report | a 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
- 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.
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.
- 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.
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
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.
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
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)
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
- 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.
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.
- 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.
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
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.
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
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)
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.