This framework follows a layered architecture based on SOLID principles, designed to scale across Web, API, and Mobile testing from a single codebase.
The outermost layer. Contains all test specs organized by type:
tests/web/— Playwright browser automation teststests/api/— REST API teststests/mobile/— Appium mobile teststests/e2e/— Cross-layer end-to-end flows
Rule: Test files only contain assertions and orchestration logic. Zero implementation details.
Encapsulates all UI interactions behind clean interfaces:
src/web/pages/— Page Object classes for websrc/web/components/— Reusable UI component abstractionssrc/mobile/screens/— Screen Objects for mobile
Rule: No assertions here. Only actions and state queries.
Abstracts all HTTP communication:
src/api/clients/— Typed API clients extending BaseApiClientsrc/api/schemas/— JSON schema definitions for validationsrc/api/interceptors/— Request/response interceptors
Rule: Returns typed responses. Handles errors centrally.
The foundation everything else builds on:
src/core/interfaces/— TypeScript contracts (IPage, IApiClient, etc.)src/core/base/— Abstract base classes (BasePage, BaseApiClient)src/core/di/— Dependency injection container
Rule: No test logic here. Pure framework infrastructure.
Cross-cutting concerns:
src/shared/types/— Global TypeScript typessrc/shared/constants/— Timeouts, HTTP status codes, tagssrc/shared/helpers/— Pure utility functionssrc/shared/utils/— Data factories
Rule: No dependencies on other layers.
Environment-aware configuration:
config/environments/— Per-environment settingsconfig/browserstack/— BrowserStack capabilities
Rule: No hardcoded values anywhere else in the codebase.
| Principle | Application |
|---|---|
| S — Single Responsibility | Each class has one job (LoginPage only handles login UI) |
| O — Open/Closed | BasePage is open for extension, closed for modification |
| L — Liskov Substitution | Any Page can replace BasePage without breaking tests |
| I — Interface Segregation | IPage, IApiClient, ITestDataFactory are focused interfaces |
| D — Dependency Inversion | Tests depend on abstractions, not concrete implementations |
Test Spec
│
▼
Page Object / API Client ← uses factories for test data
│
▼
Base Class (BasePage / BaseApiClient)
│
▼
Playwright (browser / request)
│
▼
Application Under Test
Playwright's APIRequestContext shares the same session as the browser, enabling seamless auth token reuse between web and API layers in E2E tests.
Keeps page objects and API clients decoupled from test setup, making it trivial to swap implementations for different environments.
Allows running the exact same test suite against dev, qa, or staging by simply changing the ENV variable — no code changes needed.