# pavanoltraining/poc_playwright_agents_saucedemo architecture

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

- Interactive diagram: https://gitdiagram.com/pavanoltraining/poc_playwright_agents_saucedemo
- Repository: https://github.com/pavanoltraining/poc_playwright_agents_saucedemo

## Overview

This is a proof-of-concept for AI-assisted Playwright testing of SauceDemo, not the e-commerce application itself. The workflow starts with requirements, turns them into a test plan and end-to-end specs, runs those specs against SauceDemo in a browser, and can use an agent to repair failures. The graph also preserves the documented planning, generation, validation, and healing capabilities. Source excerpts cover only the package and Playwright configuration, so links between the other workflow components rely on README statements rather than inspected implementation.

Main entry points: [`.github/agents/playwright-test-generator.agent.md`](https://github.com/pavanoltraining/poc_playwright_agents_saucedemo/blob/main/.github/agents/playwright-test-generator.agent.md) (Spec generator), [`playwright.config.ts`](https://github.com/pavanoltraining/poc_playwright_agents_saucedemo/blob/main/playwright.config.ts) (Playwright runner), [`.github/agents/playwright-test-healer.agent.md`](https://github.com/pavanoltraining/poc_playwright_agents_saucedemo/blob/main/.github/agents/playwright-test-healer.agent.md) (Test healer), [`tests/login-with-valid-credentials.spec.ts`](https://github.com/pavanoltraining/poc_playwright_agents_saucedemo/blob/main/tests/login-with-valid-credentials.spec.ts) (Login test)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_planning["Planning"]
  node_prd["Shopping requirements<br/>[SauceDemo_PRD.md]"]
  node_plan["Journey test plan"]
end

subgraph group_agents["Test agents"]
  node_planner["Test planner"]
  node_generator["Spec generator"]
  node_healer["Test healer"]
end

subgraph group_execution["Test execution"]
  node_login["Login test"]
  node_browse["Browse and add"]
  node_cart["Cart changes"]
  node_checkout["Purchase checkout"]
  node_logout["Logout and reset"]
  node_runner["Playwright runner"]
end

node_engineer(("Test author"))
node_app["SauceDemo"]

node_engineer -->|"defines needs"| node_prd
node_prd -->|"guides planning"| node_planner
node_planner -->|"creates plan"| node_plan
node_plan -->|"guides generation"| node_generator
node_generator -->|"generates specs"| node_login
node_generator -->|"generates specs"| node_browse
node_generator -->|"generates specs"| node_cart
node_generator -->|"generates specs"| node_checkout
node_generator -->|"generates specs"| node_logout
node_engineer -->|"starts tests"| node_runner
node_runner -->|"runs tests"| node_login
node_runner -->|"runs tests"| node_browse
node_runner -->|"runs tests"| node_cart
node_runner -->|"runs tests"| node_checkout
node_runner -->|"runs tests"| node_logout
node_login -->|"validates journey"| node_app
node_browse -->|"validates journey"| node_app
node_cart -->|"validates journey"| node_app
node_checkout -->|"validates journey"| node_app
node_logout -->|"validates journey"| node_app
node_healer -.->|"repairs failures"| node_login
node_healer -.->|"repairs failures"| node_browse
node_healer -.->|"repairs failures"| node_cart
node_healer -.->|"repairs failures"| node_checkout
node_healer -.->|"repairs failures"| node_logout

click node_prd "https://github.com/pavanoltraining/poc_playwright_agents_saucedemo/blob/main/SauceDemo_PRD.md"
click node_planner "https://github.com/pavanoltraining/poc_playwright_agents_saucedemo/blob/main/.github/agents/playwright-test-planner.agent.md"
click node_plan "https://github.com/pavanoltraining/poc_playwright_agents_saucedemo/blob/main/specs/sauce-demo-core-user-operations.plan.md"
click node_generator "https://github.com/pavanoltraining/poc_playwright_agents_saucedemo/blob/main/.github/agents/playwright-test-generator.agent.md"
click node_login "https://github.com/pavanoltraining/poc_playwright_agents_saucedemo/blob/main/tests/login-with-valid-credentials.spec.ts"
click node_browse "https://github.com/pavanoltraining/poc_playwright_agents_saucedemo/blob/main/tests/browse-products-and-add-to-cart.spec.ts"
click node_cart "https://github.com/pavanoltraining/poc_playwright_agents_saucedemo/blob/main/tests/view-cart-and-modify-order.spec.ts"
click node_checkout "https://github.com/pavanoltraining/poc_playwright_agents_saucedemo/blob/main/tests/checkout-with-required-information-and-complete-purchase.spec.ts"
click node_logout "https://github.com/pavanoltraining/poc_playwright_agents_saucedemo/blob/main/tests/logout-and-reset-application-state.spec.ts"
click node_runner "https://github.com/pavanoltraining/poc_playwright_agents_saucedemo/blob/main/playwright.config.ts"
click node_healer "https://github.com/pavanoltraining/poc_playwright_agents_saucedemo/blob/main/.github/agents/playwright-test-healer.agent.md"

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_prd,node_plan toneBlue
class node_planner,node_generator,node_healer toneAmber
class node_login,node_browse,node_cart,node_checkout,node_logout,node_runner toneMint
class node_engineer,node_app toneIndigo
```

## Components

### Planning

- [Shopping requirements](https://github.com/pavanoltraining/poc_playwright_agents_saucedemo/blob/main/SauceDemo_PRD.md): `SauceDemo_PRD.md`
- [Journey test plan](https://github.com/pavanoltraining/poc_playwright_agents_saucedemo/blob/main/specs/sauce-demo-core-user-operations.plan.md): `specs/sauce-demo-core-user-operations.plan.md`

### Test agents

- [Test planner](https://github.com/pavanoltraining/poc_playwright_agents_saucedemo/blob/main/.github/agents/playwright-test-planner.agent.md): `.github/agents/playwright-test-planner.agent.md`
- [Spec generator](https://github.com/pavanoltraining/poc_playwright_agents_saucedemo/blob/main/.github/agents/playwright-test-generator.agent.md): `.github/agents/playwright-test-generator.agent.md`
- [Test healer](https://github.com/pavanoltraining/poc_playwright_agents_saucedemo/blob/main/.github/agents/playwright-test-healer.agent.md): `.github/agents/playwright-test-healer.agent.md`

### Test execution

- [Login test](https://github.com/pavanoltraining/poc_playwright_agents_saucedemo/blob/main/tests/login-with-valid-credentials.spec.ts): `tests/login-with-valid-credentials.spec.ts`
- [Browse and add](https://github.com/pavanoltraining/poc_playwright_agents_saucedemo/blob/main/tests/browse-products-and-add-to-cart.spec.ts): `tests/browse-products-and-add-to-cart.spec.ts`
- [Cart changes](https://github.com/pavanoltraining/poc_playwright_agents_saucedemo/blob/main/tests/view-cart-and-modify-order.spec.ts): `tests/view-cart-and-modify-order.spec.ts`
- [Purchase checkout](https://github.com/pavanoltraining/poc_playwright_agents_saucedemo/blob/main/tests/checkout-with-required-information-and-complete-purchase.spec.ts): `tests/checkout-with-required-information-and-complete-purchase.spec.ts`
- [Logout and reset](https://github.com/pavanoltraining/poc_playwright_agents_saucedemo/blob/main/tests/logout-and-reset-application-state.spec.ts): `tests/logout-and-reset-application-state.spec.ts`
- [Playwright runner](https://github.com/pavanoltraining/poc_playwright_agents_saucedemo/blob/main/playwright.config.ts): `playwright.config.ts`

### Other components

- **Test author**
- **SauceDemo**

## Connections

- Test author → Shopping requirements: defines needs (evidence: `README.md`)
- Shopping requirements → Test planner: guides planning (evidence: `README.md`)
- Test planner → Journey test plan: creates plan (evidence: `README.md`)
- Journey test plan → Spec generator: guides generation (evidence: `README.md`)
- Spec generator → Login test: generates specs (evidence: `README.md`)
- Spec generator → Browse and add: generates specs (evidence: `README.md`)
- Spec generator → Cart changes: generates specs (evidence: `README.md`)
- Spec generator → Purchase checkout: generates specs (evidence: `README.md`)
- Spec generator → Logout and reset: generates specs (evidence: `README.md`)
- Test author → Playwright runner: starts tests (evidence: `README.md`)
- Playwright runner → Login test: runs tests (evidence: `playwright.config.ts`)
- Playwright runner → Browse and add: runs tests (evidence: `playwright.config.ts`)
- Playwright runner → Cart changes: runs tests (evidence: `playwright.config.ts`)
- Playwright runner → Purchase checkout: runs tests (evidence: `playwright.config.ts`)
- Playwright runner → Logout and reset: runs tests (evidence: `playwright.config.ts`)
- Login test → SauceDemo: validates journey (evidence: `README.md`)
- Browse and add → SauceDemo: validates journey (evidence: `README.md`)
- Cart changes → SauceDemo: validates journey (evidence: `README.md`)
- Purchase checkout → SauceDemo: validates journey (evidence: `README.md`)
- Logout and reset → SauceDemo: validates journey (evidence: `README.md`)
- Test healer → Login test: repairs failures (evidence: `README.md`)
- Test healer → Browse and add: repairs failures (evidence: `README.md`)
- Test healer → Cart changes: repairs failures (evidence: `README.md`)
- Test healer → Purchase checkout: repairs failures (evidence: `README.md`)
- Test healer → Logout and reset: repairs failures (evidence: `README.md`)
