# katdev16/playwright-ai-autonomous-testing architecture

> Architecture diagram of the GitHub repository katdev16/playwright-ai-autonomous-testing, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/katdev16/playwright-ai-autonomous-testing
- Repository: https://github.com/katdev16/playwright-ai-autonomous-testing

## Overview

This is a Playwright testing framework whose central workflow resolves page-object locators using ordered deterministic strategies, then optionally attempts runtime-only AI healing when all fail. A test-runner actor invokes page objects, which perform UI actions through Playwright. The resolver collects bounded, sanitized page evidence before requesting a Claude candidate; it validates that candidate against the live page and reports the outcome. Login, inventory, cart, and checkout are represented as distinct page-object stages, but sampled source does not establish navigation between them. The README documents the workflow; unsampled test wiring is not inferred.

Main entry points: [`utils/locator-resolver.js`](https://github.com/katdev16/playwright-ai-autonomous-testing/blob/main/utils/locator-resolver.js) (Locator Resolver), [`pages/login.page.js`](https://github.com/katdev16/playwright-ai-autonomous-testing/blob/main/pages/login.page.js) (Login Page), [`pages/inventory.page.js`](https://github.com/katdev16/playwright-ai-autonomous-testing/blob/main/pages/inventory.page.js) (Inventory Page), [`pages/cart.page.js`](https://github.com/katdev16/playwright-ai-autonomous-testing/blob/main/pages/cart.page.js) (Cart Page)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_pages["Page Objects"]
  node_login["Login Page<br/>[login.page.js]"]
  node_inventory["Inventory Page<br/>[inventory.page.js]"]
  node_cart["Cart Page<br/>[cart.page.js]"]
  node_checkout["Checkout Page<br/>[checkout.page.js]"]
end

subgraph group_resolution["Locator Resolution"]
  node_loginloc["Login Locators"]
  node_inventoryloc["Inventory Locators"]
  node_cartloc["Cart Locators<br/>[cart.locators.json]"]
  node_checkoutloc["Checkout Locators"]
  node_resolver["Locator Resolver"]
end

subgraph group_healing["Healing"]
  node_evidence["Evidence Collector"]
  node_healer["AI Locator Healer"]
end

subgraph group_reporting["Reporting"]
  node_reporter["Healing Reporter"]
end

node_runner(("Test Runner"))
node_page["Playwright Page"]
node_claude["Anthropic Claude"]
node_filesystem[("Report Filesystem")]

node_runner -->|"invokes"| node_login
node_runner -->|"invokes"| node_inventory
node_runner -->|"invokes"| node_cart
node_runner -->|"invokes"| node_checkout
node_login -->|"resolves"| node_resolver
node_inventory -->|"resolves"| node_resolver
node_cart -->|"resolves"| node_resolver
node_checkout -->|"resolves"| node_resolver
node_login -->|"loads"| node_loginloc
node_inventory -->|"loads"| node_inventoryloc
node_cart -->|"loads"| node_cartloc
node_checkout -->|"loads"| node_checkoutloc
node_resolver -->|"queries"| node_page
node_login -->|"performs actions"| node_page
node_inventory -->|"performs actions"| node_page
node_cart -->|"performs actions"| node_page
node_checkout -->|"performs actions"| node_page
node_resolver -->|"collects on failure"| node_evidence
node_evidence -->|"reads DOM metadata"| node_page
node_resolver -.->|"requests candidate"| node_healer
node_healer -.->|"requests suggestion"| node_claude
node_resolver -->|"records outcome"| node_reporter
node_reporter -.->|"writes on request"| node_filesystem

click node_login "https://github.com/katdev16/playwright-ai-autonomous-testing/blob/main/pages/login.page.js"
click node_inventory "https://github.com/katdev16/playwright-ai-autonomous-testing/blob/main/pages/inventory.page.js"
click node_cart "https://github.com/katdev16/playwright-ai-autonomous-testing/blob/main/pages/cart.page.js"
click node_checkout "https://github.com/katdev16/playwright-ai-autonomous-testing/blob/main/pages/checkout.page.js"
click node_loginloc "https://github.com/katdev16/playwright-ai-autonomous-testing/blob/main/locators/login.locators.json"
click node_inventoryloc "https://github.com/katdev16/playwright-ai-autonomous-testing/blob/main/locators/inventory.locators.json"
click node_cartloc "https://github.com/katdev16/playwright-ai-autonomous-testing/blob/main/locators/cart.locators.json"
click node_checkoutloc "https://github.com/katdev16/playwright-ai-autonomous-testing/blob/main/locators/checkout.locators.json"
click node_resolver "https://github.com/katdev16/playwright-ai-autonomous-testing/blob/main/utils/locator-resolver.js"
click node_evidence "https://github.com/katdev16/playwright-ai-autonomous-testing/blob/main/utils/healing-evidence-collector.js"
click node_healer "https://github.com/katdev16/playwright-ai-autonomous-testing/blob/main/utils/ai-locator-healer.js"
click node_reporter "https://github.com/katdev16/playwright-ai-autonomous-testing/blob/main/utils/healing-reporter.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_login,node_inventory,node_cart,node_checkout toneBlue
class node_loginloc,node_inventoryloc,node_cartloc,node_checkoutloc,node_resolver,node_filesystem toneAmber
class node_evidence,node_healer toneMint
class node_reporter toneRose
class node_runner,node_page,node_claude toneIndigo
```

## Components

### Page Objects

- [Login Page](https://github.com/katdev16/playwright-ai-autonomous-testing/blob/main/pages/login.page.js): `pages/login.page.js`
- [Inventory Page](https://github.com/katdev16/playwright-ai-autonomous-testing/blob/main/pages/inventory.page.js): `pages/inventory.page.js`
- [Cart Page](https://github.com/katdev16/playwright-ai-autonomous-testing/blob/main/pages/cart.page.js): `pages/cart.page.js`
- [Checkout Page](https://github.com/katdev16/playwright-ai-autonomous-testing/blob/main/pages/checkout.page.js): `pages/checkout.page.js`

### Locator Resolution

- [Login Locators](https://github.com/katdev16/playwright-ai-autonomous-testing/blob/main/locators/login.locators.json): `locators/login.locators.json`
- [Inventory Locators](https://github.com/katdev16/playwright-ai-autonomous-testing/blob/main/locators/inventory.locators.json): `locators/inventory.locators.json`
- [Cart Locators](https://github.com/katdev16/playwright-ai-autonomous-testing/blob/main/locators/cart.locators.json): `locators/cart.locators.json`
- [Checkout Locators](https://github.com/katdev16/playwright-ai-autonomous-testing/blob/main/locators/checkout.locators.json): `locators/checkout.locators.json`
- [Locator Resolver](https://github.com/katdev16/playwright-ai-autonomous-testing/blob/main/utils/locator-resolver.js): `utils/locator-resolver.js`

### Healing

- [Evidence Collector](https://github.com/katdev16/playwright-ai-autonomous-testing/blob/main/utils/healing-evidence-collector.js): `utils/healing-evidence-collector.js`
- [AI Locator Healer](https://github.com/katdev16/playwright-ai-autonomous-testing/blob/main/utils/ai-locator-healer.js): `utils/ai-locator-healer.js`

### Reporting

- [Healing Reporter](https://github.com/katdev16/playwright-ai-autonomous-testing/blob/main/utils/healing-reporter.js): `utils/healing-reporter.js`

### Other components

- **Test Runner**
- **Playwright Page**
- **Anthropic Claude**
- **Report Filesystem**

## Connections

- Test Runner → Login Page: invokes
- Test Runner → Inventory Page: invokes
- Test Runner → Cart Page: invokes
- Test Runner → Checkout Page: invokes
- Login Page → Locator Resolver: resolves
- Inventory Page → Locator Resolver: resolves
- Cart Page → Locator Resolver: resolves
- Checkout Page → Locator Resolver: resolves
- Login Page → Login Locators: loads
- Inventory Page → Inventory Locators: loads
- Cart Page → Cart Locators: loads
- Checkout Page → Checkout Locators: loads
- Locator Resolver → Playwright Page: queries
- Login Page → Playwright Page: performs actions
- Inventory Page → Playwright Page: performs actions
- Cart Page → Playwright Page: performs actions
- Checkout Page → Playwright Page: performs actions
- Locator Resolver → Evidence Collector: collects on failure
- Evidence Collector → Playwright Page: reads DOM metadata
- Locator Resolver → AI Locator Healer: requests candidate
- AI Locator Healer → Anthropic Claude: requests suggestion
- Locator Resolver → Healing Reporter: records outcome
- Healing Reporter → Report Filesystem: writes on request
