Modern JS & Tooling
The big question: “Modules, npm, debugging, ES6+, a taste of TypeScript”
Everything so far fits in one file. Real projects don’t: they’re dozens of files working together, plus tools written by other people, installed with a command and run from a terminal. Playwright itself is an npm package that runs on Node.js — so this phase is literally the setup routine of every job project you’ll touch.
Real projects aren’t one file — they’re many files working together, plus code written by thousands of strangers. Modules let files share code with each other; npm is the world’s shared toolbox where that stranger-code lives (Playwright itself is one of those tools).
You’ll also get a first, brief look at Node.js — the way JavaScript runs outside the browser, in a terminal. Phase 9 goes deep on it; for now, just know that npm and Playwright itself are both Node programs.
Add professional debugging (breakpoints instead of console.log everywhere) and a first taste of TypeScript, and you’ll be at home in any real-world test codebase.
One file that can share (export) its code and borrow (import) from others.
The giant public library of JavaScript packages, plus the command that installs them into your project.
A ready-made bundle of someone else’s code you can install and use — like Playwright.
The text window where you type commands — how test suites are started and CI servers work.
Continuous Integration — a robot server that reinstalls and re-runs the whole test suite automatically on every code change. Phase 11 sets one up for real.
git = the project’s version-control memory: it records every change ever made and shares them with the team. The repo is the shared project folder it guards; “committing” = recording into it.
JavaScript plus type labels the machine checks BEFORE running — catching mistakes early. Most Playwright projects use it.
- ✓Split code across files with import/export
- ✓Create a project, install packages, and run npm scripts
- ✓Debug with breakpoints instead of console.log guesswork
✏️ This phase’s interactive lab is still being drawn — it arrives together with the phase’s lessons.
- 8.1Modules: import & export
One file = one sealed module; export opens a door, import borrows by name — the dependency graph.
- 8.2npm & package.json
Two million packages, one ID card: install, semver (^ ~), lockfiles, scripts.
- 8.3Debugging like a pro
Breakpoints pause the world — Scope panel = your bubbles, Call Stack panel = your tower.
- 8.4ES6+ grab bag: ?. and ??
Crash-proof lookups and honest defaults — 2.4’s promised upgrade, delivered.
- 8.5A taste of TypeScript
Type labels checked BEFORE running, then erased — why Playwright projects speak TS.
- 8.6Checkpoint: dependency detective
A real Playwright project’s package.json, decoded line by line — case closed.