9. Automation Project Hierarchy & Architecture

Standard Playwright JavaScript Project Structure

playwright-project/
├── playwright.config.js    # Runner configuration and projects
├── package.json            # Dependencies and npm scripts
│
├── tests/                  # Test specifications (*.spec.js)
│   ├── auth/
│   │   └── login.spec.js
│   └── checkout/
│       └── checkout.spec.js
│
├── pages/                  # Page Object Model classes
│   ├── BasePage.js
│   └── LoginPage.js
│
├── components/             # Reusable UI fragments (Navigation, Modals)
│   └── Header.js
│
├── fixtures/               # Custom test fixtures
│   └── testBase.js
│
├── utils/                  # Reusable helper functions
│   └── stringHelpers.js
│
├── data/                   # Test fixtures and static JSON
│   └── testUsers.json
│
└── config/                 # Environment endpoints and timeouts
    └── envConfig.js

Task

  • Implement isRecognizedFolder:
  • 1. Accept folderName string.
  • 2. Return true if folderName is in ["tests", "pages", "components", "fixtures", "utils", "data", "config"].
💡Common doubts
Did you like the problem?
Lesson 9 of 35
JavaScript
Loading code editor…
Next