Playwright + JS · Lesson 13 of 35
Module 13: Automation Project Structure
Try it yourself
Implement isStandardAutomationFolder:
The editor has a worked example. Read it, tweak it, then press Mark as complete.
playwright-project/
├── playwright.config.js # Runner configuration and browser matrix
├── package.json # npm scripts and packages
│
├── tests/ # Test specs (*.spec.js)
│ ├── auth/
│ │ └── login.spec.js
│ └── cart/
│ └── cart.spec.js
│
├── pages/ # Page Object Model classes
│ ├── BasePage.js
│ └── LoginPage.js
│
├── components/ # Reusable UI widgets
│ └── Navbar.js
│
├── fixtures/ # Custom test fixtures
│ └── customFixtures.js
│
├── utils/ # Non-browser helper functions
│ └── stringHelpers.js
│
├── data/ # Test data JSON files
│ └── users.json
│
└── config/ # Environment endpoints and credentials
└── env.config.jsBefore writing browser tests, professional QA engineers establish a clean folder hierarchy. In this module, we dissect the standard directory structure: tests, pages, components, fixtures, utils, data, and config. Let's inspect the blueprint!
Part of the Playwright + JS course (Playwright with JavaScript). Practice this concept live in the Playwright Online Compiler or explore our free automation practice form.
No. Centralizing test data inside data/ allows multiple test suites to reuse identical mock payloads and prevents test files from becoming cluttered.
Finished reading?
Review the worked example in the editor, then mark the lesson complete.