QA Automation — Playwright 3-Layer Architecture
Architecture (mandatory for all projects)
tests/**/*.spec.ts ← Layer 1: Specs (orchestration only)
↓ uses fixture
src/utils/fixtures/*.ts ← Dependency injection (NO new elsewhere)
↓ injects
src/steps/**/*.ts ← Layer 2: Steps (business logic, no locators)
↓ calls
src/pages/**/*.ts ← Layer 3: POM (locators + UI interactions)
↑
fixtures/jdd/*.json ← Test data: entrants (inputs) / sortants (expected)
Golden Rules
new PageX()andnew StepsX()— ONLY inside fixture files- Locators — ONLY in POM (Layer 3), never in specs or steps
- Business logic — ONLY in Steps (Layer 2), never in specs
- Specs — orchestration only: call step methods, pass JDD data
- JDD — externalize ALL test data; no hardcoded strings in specs or steps
- Typed — use TypeScript interfaces for JDD data, avoid
any
Workflow — Adding/Modifying Tests
Step 1 — Discover the project
Explore the codebase: read existing fixtures, steps, pages, enums, types, and conf.json to understand available navigation, components, and conventions.
Step 2 — Identify which layer to modify
| Task | Layer | File pattern |
|---|---|---|
| New UI interaction | POM | src/pages/[module]/Page*.ts |
| New business flow | Steps | src/steps/[module]/Etapes*.ts |
| New test scenario | Spec | tests/[module]/*.spec.ts |
| New test data | JDD | fixtures/jdd/[PRODUCT]-[MODULE]-[NNN].json |
| New module wiring | Fixture | src/utils/fixtures/[module].fixtures.ts |
Step 3 — Implement following layer rules
See architecture guide for layer-by-layer rules and examples.
Step 4 — Wire fixtures
Register new pages/steps in the module's fixture file. See architecture guide.
Step 5 — Write/update spec
Use proper tags, annotations, and JDD imports. See patterns.
Step 6 — Verify
Run tests, check Allure report, validate assertions. See checklist.
Key References
- Architecture guide — layers, fixtures, environment config
- Code patterns — forms, navigation, CRUD, reporting, anti-patterns
- Locator strategy — accessibility-first, custom locators, waits
- Test data (JDD) — entrants/sortants, typing, naming, cleanup
- Checklist & CI/CD — new feature checklist, tagging, debugging, CI
Integration
The manual-test-designer skill generates Xray-compatible CSV test cases. Use those as input to scaffold automated tests following this architecture.