# caprisrv/playwright-js-e2e-framework architecture

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

- Interactive diagram: https://gitdiagram.com/caprisrv/playwright-js-e2e-framework
- Repository: https://github.com/caprisrv/playwright-js-e2e-framework

## Overview

This repository is a Playwright end-to-end testing framework for UI and API-backed scenarios. Its central workflow discovers scenarios, creates scenario-level shards, executes them through Playwright, retries failures, persists run artifacts, and aggregates scenario history and final status. Separate utilities support test discovery, retry planning, GitHub Actions result retrieval, historical validation, and reporting. The tree and excerpts identify these capabilities, but the README is empty; some subsystem links are therefore omitted where source relationships were not shown.

Main entry points: [`utils/testOrchestrator.js`](https://github.com/caprisrv/playwright-js-e2e-framework/blob/main/utils/testOrchestrator.js) (Test orchestrator), [`tests`](https://github.com/caprisrv/playwright-js-e2e-framework/tree/main/tests) (Scenario specs), [`utils/shardExecutor.js`](https://github.com/caprisrv/playwright-js-e2e-framework/blob/main/utils/shardExecutor.js) (Shard executor), [`utils/shardManager.js`](https://github.com/caprisrv/playwright-js-e2e-framework/blob/main/utils/shardManager.js) (Shard planning)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_scenarios["Test scenarios"]
  node_scenario_specs["Scenario specs"]
  node_cart_tests["Cart scenarios"]
  node_login_tests["Login scenarios"]
  node_booking_tests["Booking scenarios"]
end

subgraph group_coordination["Run coordination"]
  node_orchestrator["Test orchestrator"]
  node_discovery["Test discovery<br/>[testDiscovery.js]"]
  node_sharding["Shard planning<br/>[shardManager.js]"]
  node_executor["Shard executor<br/>[shardExecutor.js]"]
  node_retry["Retry manager<br/>[retryManager.js]"]
  node_retry_planner["Retry planner<br/>[retryPlanner.js]"]
  node_retry_plan_cli["Retry-plan command"]
  node_discover_cli["Discovery command<br/>[discover-tests.js]"]
  node_shard_cli["Shard command<br/>[execute-shard.js]"]
end

subgraph group_results["Results and analysis"]
  node_parser["Result parser<br/>[resultParser.js]"]
  node_result_store[("Execution artifact store<br/>[resultStore.js]")]
  node_manifest[("Run manifest<br/>[runManifest.js]")]
  node_aggregator["Scenario aggregator"]
  node_github_results["GitHub run results"]
  node_historical_cli["Historical validation"]
  node_report_cli["Extent reporting"]
end

subgraph group_interfaces["Application interfaces"]
  node_base_page["Base page<br/>[BasePage.js]"]
  node_cart_page["Cart page<br/>[CartPage.js]"]
  node_login_page["Login page<br/>[LoginPage.js]"]
  node_products_page["Products page<br/>[ProductsPage.js]"]
  node_booking_page["Booking page"]
  node_booker_api["Booking API client"]
end

node_test_author(("Test author"))
node_playwright(("Playwright runner"))
node_github(("GitHub Actions"))
node_saucedemo(("Sauce Demo site"))
node_booker_site(("Booking site"))

node_test_author -.->|"defines scenarios"| node_scenario_specs
node_scenario_specs -.->|"includes"| node_cart_tests
node_scenario_specs -.->|"includes"| node_login_tests
node_scenario_specs -.->|"includes"| node_booking_tests
node_test_author -.->|"starts run"| node_orchestrator
node_orchestrator -->|"creates and records"| node_manifest
node_orchestrator -->|"discovers scenarios"| node_discovery
node_orchestrator -->|"plans shards"| node_sharding
node_orchestrator -->|"executes shards"| node_executor
node_orchestrator -->|"saves results"| node_result_store
node_orchestrator -->|"selects failures"| node_parser
node_orchestrator -->|"retries failures"| node_retry
node_orchestrator -->|"aggregates executions"| node_aggregator
node_retry -->|"runs retry shards"| node_executor
node_retry -->|"filters failures"| node_parser
node_executor -->|"runs scenarios"| node_playwright
node_executor -->|"normalizes report"| node_parser
node_discover_cli -->|"discovers tests"| node_discovery
node_discover_cli -->|"plans shards"| node_sharding
node_shard_cli -->|"executes shard"| node_executor
node_shard_cli -->|"saves result"| node_result_store
node_retry_plan_cli -->|"creates retry plan"| node_retry_planner
node_retry_planner -->|"uses shard plan"| node_sharding
node_historical_cli -->|"uses history"| node_aggregator
node_historical_cli -->|"retrieves executions"| node_github_results
node_historical_cli -->|"uses shard plan"| node_sharding
node_report_cli -->|"aggregates results"| node_aggregator
node_report_cli -->|"loads run results"| node_github_results
node_github_results -->|"downloads artifacts"| node_github
node_cart_page -->|"extends"| node_base_page
node_login_page -->|"extends"| node_base_page
node_products_page -->|"extends"| node_base_page
node_booking_page -->|"extends"| node_base_page
node_login_page -->|"navigates to"| node_saucedemo
node_booking_page -->|"navigates to"| node_booker_site
node_scenario_specs -.->|"uses page object"| node_cart_page
node_scenario_specs -.->|"uses page object"| node_login_page
node_scenario_specs -.->|"uses page object"| node_booking_page

click node_scenario_specs "https://github.com/caprisrv/playwright-js-e2e-framework/tree/main/tests"
click node_cart_tests "https://github.com/caprisrv/playwright-js-e2e-framework/tree/main/tests/cart"
click node_login_tests "https://github.com/caprisrv/playwright-js-e2e-framework/tree/main/tests/login"
click node_booking_tests "https://github.com/caprisrv/playwright-js-e2e-framework/tree/main/tests/restfulbooker"
click node_orchestrator "https://github.com/caprisrv/playwright-js-e2e-framework/blob/main/utils/testOrchestrator.js"
click node_discovery "https://github.com/caprisrv/playwright-js-e2e-framework/blob/main/utils/testDiscovery.js"
click node_sharding "https://github.com/caprisrv/playwright-js-e2e-framework/blob/main/utils/shardManager.js"
click node_executor "https://github.com/caprisrv/playwright-js-e2e-framework/blob/main/utils/shardExecutor.js"
click node_retry "https://github.com/caprisrv/playwright-js-e2e-framework/blob/main/utils/retryManager.js"
click node_retry_planner "https://github.com/caprisrv/playwright-js-e2e-framework/blob/main/utils/retryPlanner.js"
click node_retry_plan_cli "https://github.com/caprisrv/playwright-js-e2e-framework/blob/main/scripts/create-retry-plan.js"
click node_discover_cli "https://github.com/caprisrv/playwright-js-e2e-framework/blob/main/scripts/discover-tests.js"
click node_shard_cli "https://github.com/caprisrv/playwright-js-e2e-framework/blob/main/scripts/execute-shard.js"
click node_parser "https://github.com/caprisrv/playwright-js-e2e-framework/blob/main/utils/resultParser.js"
click node_result_store "https://github.com/caprisrv/playwright-js-e2e-framework/blob/main/utils/resultStore.js"
click node_manifest "https://github.com/caprisrv/playwright-js-e2e-framework/blob/main/utils/runManifest.js"
click node_aggregator "https://github.com/caprisrv/playwright-js-e2e-framework/blob/main/utils/resultAggregator.js"
click node_github_results "https://github.com/caprisrv/playwright-js-e2e-framework/blob/main/utils/githubExecutionResults.js"
click node_historical_cli "https://github.com/caprisrv/playwright-js-e2e-framework/blob/main/scripts/create-historical-validation-plan.js"
click node_report_cli "https://github.com/caprisrv/playwright-js-e2e-framework/blob/main/scripts/generate-extent-report.js"
click node_base_page "https://github.com/caprisrv/playwright-js-e2e-framework/blob/main/pages/BasePage.js"
click node_cart_page "https://github.com/caprisrv/playwright-js-e2e-framework/blob/main/pages/CartPage.js"
click node_login_page "https://github.com/caprisrv/playwright-js-e2e-framework/blob/main/pages/LoginPage.js"
click node_products_page "https://github.com/caprisrv/playwright-js-e2e-framework/blob/main/pages/ProductsPage.js"
click node_booking_page "https://github.com/caprisrv/playwright-js-e2e-framework/blob/main/pages/RestfulBookerBookingPage.js"
click node_booker_api "https://github.com/caprisrv/playwright-js-e2e-framework/blob/main/api/RestfulBookerApi.js"

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_scenario_specs,node_cart_tests,node_login_tests,node_booking_tests toneBlue
class node_orchestrator,node_discovery,node_sharding,node_executor,node_retry,node_retry_planner,node_retry_plan_cli,node_discover_cli,node_shard_cli toneAmber
class node_parser,node_result_store,node_manifest,node_aggregator,node_github_results,node_historical_cli,node_report_cli toneMint
class node_base_page,node_cart_page,node_login_page,node_products_page,node_booking_page,node_booker_api toneRose
class node_test_author,node_playwright,node_github,node_saucedemo,node_booker_site toneIndigo
```

## Components

### Test scenarios

- [Scenario specs](https://github.com/caprisrv/playwright-js-e2e-framework/tree/main/tests): `tests`
- [Cart scenarios](https://github.com/caprisrv/playwright-js-e2e-framework/tree/main/tests/cart): `tests/cart`
- [Login scenarios](https://github.com/caprisrv/playwright-js-e2e-framework/tree/main/tests/login): `tests/login`
- [Booking scenarios](https://github.com/caprisrv/playwright-js-e2e-framework/tree/main/tests/restfulbooker): `tests/restfulbooker`

### Run coordination

- [Test orchestrator](https://github.com/caprisrv/playwright-js-e2e-framework/blob/main/utils/testOrchestrator.js): `utils/testOrchestrator.js`
- [Test discovery](https://github.com/caprisrv/playwright-js-e2e-framework/blob/main/utils/testDiscovery.js): `utils/testDiscovery.js`
- [Shard planning](https://github.com/caprisrv/playwright-js-e2e-framework/blob/main/utils/shardManager.js): `utils/shardManager.js`
- [Shard executor](https://github.com/caprisrv/playwright-js-e2e-framework/blob/main/utils/shardExecutor.js): `utils/shardExecutor.js`
- [Retry manager](https://github.com/caprisrv/playwright-js-e2e-framework/blob/main/utils/retryManager.js): `utils/retryManager.js`
- [Retry planner](https://github.com/caprisrv/playwright-js-e2e-framework/blob/main/utils/retryPlanner.js): `utils/retryPlanner.js`
- [Retry-plan command](https://github.com/caprisrv/playwright-js-e2e-framework/blob/main/scripts/create-retry-plan.js): `scripts/create-retry-plan.js`
- [Discovery command](https://github.com/caprisrv/playwright-js-e2e-framework/blob/main/scripts/discover-tests.js): `scripts/discover-tests.js`
- [Shard command](https://github.com/caprisrv/playwright-js-e2e-framework/blob/main/scripts/execute-shard.js): `scripts/execute-shard.js`

### Results and analysis

- [Result parser](https://github.com/caprisrv/playwright-js-e2e-framework/blob/main/utils/resultParser.js): `utils/resultParser.js`
- [Execution artifact store](https://github.com/caprisrv/playwright-js-e2e-framework/blob/main/utils/resultStore.js): `utils/resultStore.js`
- [Run manifest](https://github.com/caprisrv/playwright-js-e2e-framework/blob/main/utils/runManifest.js): `utils/runManifest.js`
- [Scenario aggregator](https://github.com/caprisrv/playwright-js-e2e-framework/blob/main/utils/resultAggregator.js): `utils/resultAggregator.js`
- [GitHub run results](https://github.com/caprisrv/playwright-js-e2e-framework/blob/main/utils/githubExecutionResults.js): `utils/githubExecutionResults.js`
- [Historical validation](https://github.com/caprisrv/playwright-js-e2e-framework/blob/main/scripts/create-historical-validation-plan.js): `scripts/create-historical-validation-plan.js`
- [Extent reporting](https://github.com/caprisrv/playwright-js-e2e-framework/blob/main/scripts/generate-extent-report.js): `scripts/generate-extent-report.js`

### Application interfaces

- [Base page](https://github.com/caprisrv/playwright-js-e2e-framework/blob/main/pages/BasePage.js): `pages/BasePage.js`
- [Cart page](https://github.com/caprisrv/playwright-js-e2e-framework/blob/main/pages/CartPage.js): `pages/CartPage.js`
- [Login page](https://github.com/caprisrv/playwright-js-e2e-framework/blob/main/pages/LoginPage.js): `pages/LoginPage.js`
- [Products page](https://github.com/caprisrv/playwright-js-e2e-framework/blob/main/pages/ProductsPage.js): `pages/ProductsPage.js`
- [Booking page](https://github.com/caprisrv/playwright-js-e2e-framework/blob/main/pages/RestfulBookerBookingPage.js): `pages/RestfulBookerBookingPage.js`
- [Booking API client](https://github.com/caprisrv/playwright-js-e2e-framework/blob/main/api/RestfulBookerApi.js): `api/RestfulBookerApi.js`

### Other components

- **Test author**
- **Playwright runner**
- **GitHub Actions**
- **Sauce Demo site**
- **Booking site**

## Connections

- Test author → Scenario specs: defines scenarios
- Scenario specs → Cart scenarios: includes
- Scenario specs → Login scenarios: includes
- Scenario specs → Booking scenarios: includes
- Test author → Test orchestrator: starts run
- Test orchestrator → Run manifest: creates and records (evidence: `utils/testOrchestrator.js`)
- Test orchestrator → Test discovery: discovers scenarios (evidence: `utils/testOrchestrator.js`)
- Test orchestrator → Shard planning: plans shards (evidence: `utils/testOrchestrator.js`)
- Test orchestrator → Shard executor: executes shards (evidence: `utils/testOrchestrator.js`)
- Test orchestrator → Execution artifact store: saves results (evidence: `utils/testOrchestrator.js`)
- Test orchestrator → Result parser: selects failures (evidence: `utils/testOrchestrator.js`)
- Test orchestrator → Retry manager: retries failures (evidence: `utils/testOrchestrator.js`)
- Test orchestrator → Scenario aggregator: aggregates executions (evidence: `utils/testOrchestrator.js`)
- Retry manager → Shard executor: runs retry shards (evidence: `utils/retryManager.js`)
- Retry manager → Result parser: filters failures (evidence: `utils/retryManager.js`)
- Shard executor → Playwright runner: runs scenarios (evidence: `utils/shardExecutor.js`)
- Shard executor → Result parser: normalizes report (evidence: `utils/shardExecutor.js`)
- Discovery command → Test discovery: discovers tests (evidence: `scripts/discover-tests.js`)
- Discovery command → Shard planning: plans shards (evidence: `scripts/discover-tests.js`)
- Shard command → Shard executor: executes shard (evidence: `scripts/execute-shard.js`)
- Shard command → Execution artifact store: saves result (evidence: `scripts/execute-shard.js`)
- Retry-plan command → Retry planner: creates retry plan (evidence: `scripts/create-retry-plan.js`)
- Retry planner → Shard planning: uses shard plan (evidence: `utils/retryPlanner.js`)
- Historical validation → Scenario aggregator: uses history (evidence: `scripts/create-historical-validation-plan.js`)
- Historical validation → GitHub run results: retrieves executions (evidence: `scripts/create-historical-validation-plan.js`)
- Historical validation → Shard planning: uses shard plan (evidence: `scripts/create-historical-validation-plan.js`)
- Extent reporting → Scenario aggregator: aggregates results (evidence: `scripts/generate-extent-report.js`)
- Extent reporting → GitHub run results: loads run results (evidence: `scripts/generate-extent-report.js`)
- GitHub run results → GitHub Actions: downloads artifacts (evidence: `utils/githubExecutionResults.js`)
- Cart page → Base page: extends (evidence: `pages/CartPage.js`)
- Login page → Base page: extends (evidence: `pages/LoginPage.js`)
- Products page → Base page: extends (evidence: `pages/ProductsPage.js`)
- Booking page → Base page: extends (evidence: `pages/RestfulBookerBookingPage.js`)
- Login page → Sauce Demo site: navigates to (evidence: `pages/LoginPage.js`)
- Booking page → Booking site: navigates to (evidence: `pages/RestfulBookerBookingPage.js`)
- Scenario specs → Cart page: uses page object
- Scenario specs → Login page: uses page object
- Scenario specs → Booking page: uses page object
