# rralex95/playwright-ts-e2e-framework architecture

> Architecture diagram of the GitHub repository rralex95/playwright-ts-e2e-framework, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-05-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/rralex95/playwright-ts-e2e-framework
- Repository: https://github.com/rralex95/playwright-ts-e2e-framework

## Overview

1. **What this repository is**
   - A TypeScript-based Playwright end-to-end test framework, not an application under test.
   - Its main job is to automate browser flows against an external target site, with reusable page objects and data fixtures.

2. **Top-level runtime and tooling**
   - The framework runs on Node.js/npm, with Playwright as the test runner and browser automation layer.
   - TypeScript is used throughout for strongly typed tests and page objects.
   - `dotenv` is used to load environment-specific values such as the base URL and credentials.

3. **Environment and configuration boundary**
   - `config/env.ts` is the configuration entry point for reading environment variables.
   - `.env.example` defines the expected runtime inputs, including `BASE_URL`, `ADMIN_USERNAME`, and `ADMIN_PASSWORD`.
   - `playwright.config.ts` is the execution boundary for browser setup, test discovery, and project configuration.

4. **Test data layer**
   - `data/messages.ts` centralizes validation/error text used by assertions.
   - `data/users.ts` stores user identities and credentials/roles used by auth-oriented tests.
   - `data/testData.ts` provides datasets for parameterized/data-driven scenarios.
   - This separates test logic from test inputs so assertions and scenarios stay maintainable.

5. **Page Object Model layer**
   - `e2e/e2e/pages/...` contains reusable page abstractions.
   - `client/` page objects cover client-facing flows such as login, registration, dashboard, and cart.
   - `practice/` page objects cover the practice site flows, including login and shop interactions.
   - Tests call these page objects rather than directly manipulating selectors everywhere, which is the main maintainability boundary.

6. **Client test suite**
   - `e2e/e2e/tests/client/` contains focused end-to-end specs for client workflows.
   - These include login and registration happy-path flows.
   - The client suite maps to the `client/` page object set and likely exercises a different part of the target application than the practice suite.

7. **Practice test suite**
   - `e2e/e2e/tests/practice/` is organized by concern:
     - `auth/` for login and validation behavior
     - `ui/` for dropdown, modal, radio button, and UX behavior checks
     - `advanced/` for data-driven scenarios
   - This suite shows the framework is designed for both functional flows and UI interaction checks, not just authentication.

8. **Data flow through a test**
   - A spec reads scenario data from `data/*`.
   - It loads runtime configuration from `config/env.ts`.
   - It drives the browser through a page object in `e2e/e2e/pages/*`.
   - Assertions verify visible UI state or messages defined in the shared data files.
   - That flow keeps test specs thin and pushes interaction details into the page layer.

9. **Cross-browser execution model**
   - The framework is configured to run across Chromium, Firefox, and WebKit.
   - That means the same spec suite is executed against multiple browser projects, producing the total run count described in the README.
   - Browser choice is a key architectural feature here because compatibility is part of the test goal.

10. **CI/CD boundary**
   - `.github/workflows/playwright.yml` runs the suite in GitHub Actions.
   - The pipeline triggers on pushes to `main` and `feature/**`.
   - The workflow uploads the test report as an artifact, making results available outside the runner.

11. **External system under test**
   - The tests target a remote web application, with `BASE_URL` pointing to the live environment.
   - Because the target is external, the framework’s architecture is centered on stable selectors, reusable flows, and environment-driven configuration rather than local service orchestration.

12. **How to draw the architecture**
   - Place `playwright.config.ts` and `config/env.ts` as the control layer.
   - Put `data/*` as the shared input/assertion layer.
   - Put `e2e/e2e/pages/*` as the reusable interaction layer.
   - Put `e2e/e2e/tests/*` as the scenario/orchestration layer.
   - Show GitHub Actions as the execution/automation boundary and the external website as the system under test.

Main entry points: [`e2e/e2e/tests/client`](https://github.com/rralex95/playwright-ts-e2e-framework/tree/main/e2e/e2e/tests/client) (Client suite), [`playwright.config.ts`](https://github.com/rralex95/playwright-ts-e2e-framework/blob/main/playwright.config.ts) (Playwright config), [`e2e/e2e/tests/practice/auth`](https://github.com/rralex95/playwright-ts-e2e-framework/tree/main/e2e/e2e/tests/practice/auth) (Practice auth), [`e2e/e2e/tests/practice/advanced`](https://github.com/rralex95/playwright-ts-e2e-framework/tree/main/e2e/e2e/tests/practice/advanced) (Practice data-driven)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_group_control["Control layer"]
  node_node_runtime["Node/npm<br/>runtime<br/>[package.json]"]
  node_node_playwright_config["Playwright config<br/>runner config"]
  node_node_env_config["Env config<br/>env loader<br/>[env.ts]"]
  node_node_env_example["Env example<br/>env contract<br/>[.env.example]"]
end

subgraph group_group_data["Shared data"]
  node_node_messages["Messages<br/>assertion data<br/>[messages.ts]"]
  node_node_users["Users<br/>fixture data<br/>[users.ts]"]
  node_node_testdata["Test data<br/>scenario data<br/>[testData.ts]"]
end

subgraph group_group_client_pages["Client pages"]
  node_node_client_login_page["Client login<br/>page object<br/>[ClientLoginPage.ts]"]
  node_node_client_register_page["Client register<br/>page object<br/>[RegisterPage.ts]"]
  node_node_client_dashboard_page["Client dashboard<br/>page object<br/>[DashboardPage.ts]"]
  node_node_client_cart_page["Client cart<br/>page object<br/>[CartPage.ts]"]
end

subgraph group_group_practice_pages["Practice pages"]
  node_node_practice_login_page["Practice login<br/>page object<br/>[LoginPage.ts]"]
  node_node_practice_shop_page["Practice shop<br/>page object<br/>[ShopPage.ts]"]
end

subgraph group_group_client_tests["Client tests"]
  node_node_client_tests["Client suite<br/>spec suite"]
end

subgraph group_group_practice_tests["Practice tests"]
  node_node_practice_auth_tests["Practice auth<br/>spec suite"]
  node_node_practice_ui_tests["Practice UI<br/>spec suite"]
  node_node_practice_advanced_tests["Practice data-driven<br/>spec suite"]
end

subgraph group_group_ci["CI/CD"]
  node_node_github_actions["GitHub Actions<br/>ci workflow<br/>[playwright.yml]"]
end

subgraph group_group_external["External target"]
  node_node_target_app[("Target app<br/>external system")]
end

node_node_runtime -->|"runs with"| node_node_playwright_config
node_node_playwright_config -->|"loads env"| node_node_env_config
node_node_env_config -.->|"defined by"| node_node_env_example
node_node_playwright_config -->|"discovers"| node_node_client_tests
node_node_playwright_config -->|"discovers"| node_node_practice_auth_tests
node_node_playwright_config -->|"discovers"| node_node_practice_ui_tests
node_node_playwright_config -->|"discovers"| node_node_practice_advanced_tests
node_node_client_tests -->|"uses"| node_node_client_login_page
node_node_client_tests -->|"uses"| node_node_client_register_page
node_node_client_tests -->|"uses"| node_node_client_dashboard_page
node_node_client_tests -->|"uses"| node_node_client_cart_page
node_node_practice_auth_tests -->|"uses"| node_node_practice_login_page
node_node_practice_ui_tests -->|"uses"| node_node_practice_shop_page
node_node_practice_advanced_tests -->|"uses"| node_node_practice_shop_page
node_node_client_tests -->|"asserts with"| node_node_messages
node_node_practice_auth_tests -->|"asserts with"| node_node_messages
node_node_practice_auth_tests -->|"uses"| node_node_users
node_node_client_tests -->|"uses"| node_node_users
node_node_practice_advanced_tests -->|"uses"| node_node_testdata
node_node_client_tests -->|"targets"| node_node_target_app
node_node_practice_auth_tests -->|"targets"| node_node_target_app
node_node_practice_ui_tests -->|"targets"| node_node_target_app
node_node_practice_advanced_tests -->|"targets"| node_node_target_app
node_node_github_actions -->|"executes"| node_node_playwright_config
node_node_github_actions -->|"provisions"| node_node_runtime
node_node_github_actions -.->|"tests"| node_node_target_app

click node_node_runtime "https://github.com/rralex95/playwright-ts-e2e-framework/blob/main/package.json"
click node_node_playwright_config "https://github.com/rralex95/playwright-ts-e2e-framework/blob/main/playwright.config.ts"
click node_node_env_config "https://github.com/rralex95/playwright-ts-e2e-framework/blob/main/config/env.ts"
click node_node_env_example "https://github.com/rralex95/playwright-ts-e2e-framework/blob/main/.env.example"
click node_node_messages "https://github.com/rralex95/playwright-ts-e2e-framework/blob/main/data/messages.ts"
click node_node_users "https://github.com/rralex95/playwright-ts-e2e-framework/blob/main/data/users.ts"
click node_node_testdata "https://github.com/rralex95/playwright-ts-e2e-framework/blob/main/data/testData.ts"
click node_node_client_login_page "https://github.com/rralex95/playwright-ts-e2e-framework/blob/main/e2e/e2e/pages/client/ClientLoginPage.ts"
click node_node_client_register_page "https://github.com/rralex95/playwright-ts-e2e-framework/blob/main/e2e/e2e/pages/client/RegisterPage.ts"
click node_node_client_dashboard_page "https://github.com/rralex95/playwright-ts-e2e-framework/blob/main/e2e/e2e/pages/client/DashboardPage.ts"
click node_node_client_cart_page "https://github.com/rralex95/playwright-ts-e2e-framework/blob/main/e2e/e2e/pages/client/CartPage.ts"
click node_node_practice_login_page "https://github.com/rralex95/playwright-ts-e2e-framework/blob/main/e2e/e2e/pages/practice/LoginPage.ts"
click node_node_practice_shop_page "https://github.com/rralex95/playwright-ts-e2e-framework/blob/main/e2e/e2e/pages/practice/ShopPage.ts"
click node_node_client_tests "https://github.com/rralex95/playwright-ts-e2e-framework/tree/main/e2e/e2e/tests/client"
click node_node_practice_auth_tests "https://github.com/rralex95/playwright-ts-e2e-framework/tree/main/e2e/e2e/tests/practice/auth"
click node_node_practice_ui_tests "https://github.com/rralex95/playwright-ts-e2e-framework/tree/main/e2e/e2e/tests/practice/ui"
click node_node_practice_advanced_tests "https://github.com/rralex95/playwright-ts-e2e-framework/tree/main/e2e/e2e/tests/practice/advanced"
click node_node_github_actions "https://github.com/rralex95/playwright-ts-e2e-framework/blob/main/.github/workflows/playwright.yml"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_node_runtime,node_node_playwright_config,node_node_env_config,node_node_env_example,node_node_github_actions toneBlue
class node_node_messages,node_node_users,node_node_testdata,node_node_target_app toneAmber
class node_node_client_login_page,node_node_client_register_page,node_node_client_dashboard_page,node_node_client_cart_page toneMint
class node_node_practice_login_page,node_node_practice_shop_page toneRose
class node_node_client_tests toneIndigo
class node_node_practice_auth_tests,node_node_practice_ui_tests,node_node_practice_advanced_tests toneTeal
```

## Components

### Control layer

Execution, configuration, and CI orchestration

- [Node/npm](https://github.com/rralex95/playwright-ts-e2e-framework/blob/main/package.json): runtime · TypeScript Playwright test framework runtime · `package.json`
- [Playwright config](https://github.com/rralex95/playwright-ts-e2e-framework/blob/main/playwright.config.ts): runner config · Browser projects, discovery, and execution boundary · `playwright.config.ts`
- [Env config](https://github.com/rralex95/playwright-ts-e2e-framework/blob/main/config/env.ts): env loader · Reads environment variables with dotenv · `config/env.ts`
- [Env example](https://github.com/rralex95/playwright-ts-e2e-framework/blob/main/.env.example): env contract · Expected runtime inputs such as base URL and credentials · `.env.example`

### Shared data

Environment inputs and reusable assertions

- [Messages](https://github.com/rralex95/playwright-ts-e2e-framework/blob/main/data/messages.ts): assertion data · Shared validation and error text · `data/messages.ts`
- [Users](https://github.com/rralex95/playwright-ts-e2e-framework/blob/main/data/users.ts): fixture data · User identities and credentials for auth flows · `data/users.ts`
- [Test data](https://github.com/rralex95/playwright-ts-e2e-framework/blob/main/data/testData.ts): scenario data · Parameterized datasets for data-driven specs · `data/testData.ts`

### Client pages

Page objects for client-facing flows

- [Client login](https://github.com/rralex95/playwright-ts-e2e-framework/blob/main/e2e/e2e/pages/client/ClientLoginPage.ts): page object · Client login interactions · `e2e/e2e/pages/client/ClientLoginPage.ts`
- [Client register](https://github.com/rralex95/playwright-ts-e2e-framework/blob/main/e2e/e2e/pages/client/RegisterPage.ts): page object · Client registration interactions · `e2e/e2e/pages/client/RegisterPage.ts`
- [Client dashboard](https://github.com/rralex95/playwright-ts-e2e-framework/blob/main/e2e/e2e/pages/client/DashboardPage.ts): page object · Client dashboard interactions · `e2e/e2e/pages/client/DashboardPage.ts`
- [Client cart](https://github.com/rralex95/playwright-ts-e2e-framework/blob/main/e2e/e2e/pages/client/CartPage.ts): page object · Client cart interactions · `e2e/e2e/pages/client/CartPage.ts`

### Practice pages

Page objects for practice-site flows

- [Practice login](https://github.com/rralex95/playwright-ts-e2e-framework/blob/main/e2e/e2e/pages/practice/LoginPage.ts): page object · Practice-site login interactions · `e2e/e2e/pages/practice/LoginPage.ts`
- [Practice shop](https://github.com/rralex95/playwright-ts-e2e-framework/blob/main/e2e/e2e/pages/practice/ShopPage.ts): page object · Practice-site shop interactions · `e2e/e2e/pages/practice/ShopPage.ts`

### Client tests

Client workflow specs

- [Client suite](https://github.com/rralex95/playwright-ts-e2e-framework/tree/main/e2e/e2e/tests/client): spec suite · Client login and registration end-to-end scenarios · `e2e/e2e/tests/client`

### Practice tests

Practice-site specs across auth, UI, and data-driven scenarios

- [Practice auth](https://github.com/rralex95/playwright-ts-e2e-framework/tree/main/e2e/e2e/tests/practice/auth): spec suite · Practice login and validation scenarios · `e2e/e2e/tests/practice/auth`
- [Practice UI](https://github.com/rralex95/playwright-ts-e2e-framework/tree/main/e2e/e2e/tests/practice/ui): spec suite · Dropdown, modal, radio, and UX behavior checks · `e2e/e2e/tests/practice/ui`
- [Practice data-driven](https://github.com/rralex95/playwright-ts-e2e-framework/tree/main/e2e/e2e/tests/practice/advanced): spec suite · Parameterized practice scenarios · `e2e/e2e/tests/practice/advanced`

### CI/CD

GitHub Actions execution boundary

- [GitHub Actions](https://github.com/rralex95/playwright-ts-e2e-framework/blob/main/.github/workflows/playwright.yml): ci workflow · Runs Playwright on pushes and uploads reports · `.github/workflows/playwright.yml`

### External target

Remote application under test

- **Target app**: external system · Remote web application under test

## Connections

- Node/npm → Playwright config: runs with · Node/npm launches Playwright under this configuration
- Playwright config → Env config: loads env · Execution uses environment-derived values
- Env config → Env example: defined by · Expected variables are documented in the example file
- Playwright config → Client suite: discovers · Playwright executes client specs as projects
- Playwright config → Practice auth: discovers · Playwright executes practice specs as projects
- Playwright config → Practice UI: discovers · Playwright executes practice specs as projects
- Playwright config → Practice data-driven: discovers · Playwright executes practice specs as projects
- Client suite → Client login: uses · Client specs drive the login page object
- Client suite → Client register: uses · Client specs drive the registration page object
- Client suite → Client dashboard: uses · Client flows continue through dashboard interactions
- Client suite → Client cart: uses · Client flows can validate cart behavior
- Practice auth → Practice login: uses · Practice auth specs drive login interactions
- Practice UI → Practice shop: uses · UI specs exercise shop and widget behaviors
- Practice data-driven → Practice shop: uses · Data-driven scenarios reuse shop interactions
- Client suite → Messages: asserts with · Client assertions reuse shared message text
- Practice auth → Messages: asserts with · Auth validation uses shared message text
- Practice auth → Users: uses · Practice auth scenarios draw from user fixtures
- Client suite → Users: uses · Client auth flows use credential fixtures
- Practice data-driven → Test data: uses · Parameterized practice specs consume datasets
- Client suite → Target app: targets · Client flows exercise the remote application
- Practice auth → Target app: targets · Practice auth flows exercise the remote application
- Practice UI → Target app: targets · Practice UI checks run against the remote application
- Practice data-driven → Target app: targets · Data-driven practice scenarios run against the remote application
- GitHub Actions → Playwright config: executes · CI runs the same Playwright configuration
- GitHub Actions → Node/npm: provisions · Workflow sets up the Node/npm runtime
- GitHub Actions → Target app: tests · CI validates the external target from GitHub Actions
