Chapter 02: Node.js, npm and VS Code
Automation learning lab
Playwright Automation
Self Study Guide
Start from zero. Learn JavaScript and TypeScript, automate browsers, and build reliable end-to-end tests.
Node.js, npm and VS Code
Node.js executes JavaScript outside a browser. npm manages packages and project metadata. VS Code is an editor with an integrated terminal. Install a Node.js release supported by the current Playwright documentation, then open a dedicated project folder.
How it works
Step-by-step walkthrough
- Install Node.js
- Open a terminal in VS Code
- Check versions and initialize a project
Example
node --version
npm --version
mkdir testingdocs-lab
cd testingdocs-lab
npm init -yDo not install random packages with administrator privileges.
✎ Your practice task
Find package.json in your project folder.
Knowledge check
Which command initializes package.json?
🌐 Continue learning
60-chapter learning path
Start at chapter 1, or choose any topic. Your progress is tracked separately for each chapter.
JavaScript fundamentals
TypeScript fundamentals
Playwright • setup & locators
Playwright • interactions & assertions
Playwright • framework & debugging
Playwright • real-world automation
Interactive practice lab
Try the controls below and observe the corresponding Playwright locator instructions. This browser demo does not execute Node.js or Playwright Test; copy the code to your local Playwright project to automate it.
Task manager demo
Suggested automation
Actions on the demo update these examples. In your local test use a page that contains the same controls.
Download a standalone lab page, then serve it locally (for example with Python's http.server). Navigate to it in a Playwright test.