PW Playwright · TSFree course: Playwright with TypeScript
Full course

Chapter 3 · Lesson 1

Files and folders

Difficulty: Easy
Slides
Use the arrow keys, N for notes, F for full screenOpen in a separate window ↗
Video lesson

Key points

After the wizard, the project folder looks like this:

File or folderRole
tests/Your tests. Any file ending in .spec.ts is a test file
playwright.config.tsRun settings: browsers, reports, retries
package.jsonProject details and the packages it uses
package-lock.jsonExact package versions. Not edited by hand
node_modules/The downloaded packages. Heavy, and not touched
.gitignoreWhat not to store in version control

After the first run, two folders are added: playwright-report/ (the HTML report) and test-results/ (screenshots, video and trace of failed tests).

How to read a test

The example test is a few lines. test defines a test, page is the browser tab, await waits for each step to finish, and expect checks a result.

Practice

Try it yourself