TestingDocs.com logoTestingDocs.com
Automation learning lab
TestingDocs • Self-paced course

Playwright Automation
Self Study Guide

Start from zero. Learn JavaScript and TypeScript, automate browsers, and build reliable end-to-end tests.

60 chaptersBeginner friendlyHands-on practice
Playwright / Chapter 33 of 60~18 min • Beginner
Chapter 33Playwright

Project structure and configuration

The configuration file controls test discovery, timeout, projects and reporting. tests contains spec files; package.json tracks dependencies and scripts. The generated structure may differ by initializer choices and version.

How it works

Step-by-step walkthrough

  1. Open playwright.config.ts
  2. Set a test directory
  3. Run discovered tests

Example

TypeScript
import { defineConfig, devices } from '@playwright/test';
export default defineConfig({
  testDir: './tests',
  reporter: 'html',
  projects: [{ name: 'chromium', use: { ...devices['Desktop Chrome'] } }]
});
Expected result: Tests run from ./tests in Chromium
💡 Point to remember
Keep machine-specific paths and credentials outside shared config.

✎ Your practice task

Add a Firefox project using Desktop Firefox.

Knowledge check

Which file configures test projects?

🌐 Continue learning