# vinothkumar-sv/locator_qalab architecture

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

- Interactive diagram: https://gitdiagram.com/vinothkumar-sv/locator_qalab
- Repository: https://github.com/vinothkumar-sv/locator_qalab

## Overview

LocatorForge is a Chrome extension for turning a live web page into Playwright locator suggestions and generated tests. A QA engineer starts inspection or recording from the popup, interacts with the page, reviews selections or recorded steps, and generates a Page Object or test. The graph includes locator analysis, interaction capture, selection history, and export capabilities documented in the README. Recorder wiring and some popup storage details are not fully shown in the excerpts, so those links rely on README documentation.

Main entry points: [`src/popup/popup.js`](https://github.com/vinothkumar-sv/locator_qalab/blob/main/src/popup/popup.js) (Popup Controller), [`src/content/content.js`](https://github.com/vinothkumar-sv/locator_qalab/blob/main/src/content/content.js) (Inspector Overlay), [`src/shared/messaging.js`](https://github.com/vinothkumar-sv/locator_qalab/blob/main/src/shared/messaging.js) (Tab Messaging), [`src/background/service-worker.js`](https://github.com/vinothkumar-sv/locator_qalab/blob/main/src/background/service-worker.js) (Service Worker)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["Extension Interface"]
  node_popup_ui["Popup UI<br/>[popup.html]"]
  node_popup["Popup Controller<br/>[popup.js]"]
  node_messaging["Tab Messaging<br/>[messaging.js]"]
  node_constants["Shared Constants<br/>[constants.js]"]
  node_utils["Shared Utilities<br/>[utils.js]"]
  node_worker["Service Worker<br/>[service-worker.js]"]
  node_history[("Selection History<br/>[service-worker.js]")]
end

subgraph group_page["Page Inspection"]
  node_inspector["Inspector Overlay<br/>[content.js]"]
  node_locator_engine["Locator Engine<br/>[locator-engine.js]"]
  node_locator_results["Ranked Locators<br/>[locator-engine.js]"]
end

subgraph group_capture["Journey Capture"]
  node_recorder["Action Recorder<br/>[action-recorder.js]"]
  node_recorded_steps["Recorded Steps<br/>[action-recorder.js]"]
end

subgraph group_generation["Test Generation"]
  node_action_model["Action Model<br/>[action-model.js]"]
  node_pom_builder["Page Object Builder<br/>[popup.js]"]
  node_test_builder["Test Builder<br/>[popup.js]"]
end

node_qa(("QA Engineer"))
node_web_page["Web Page"]
node_playwright_artifacts["Playwright Artifacts"]

node_qa -->|"opens"| node_popup_ui
node_popup_ui -->|"activates"| node_popup
node_popup -->|"sends tab messages"| node_messaging
node_popup -->|"sanitizes names"| node_utils
node_popup -->|"renders steps"| node_action_model
node_messaging -->|"routes messages"| node_web_page
node_popup -->|"starts inspection"| node_inspector
node_web_page -->|"hosts overlay"| node_inspector
node_inspector -->|"queries analysis"| node_locator_engine
node_locator_engine -->|"ranks candidates"| node_locator_results
node_inspector -->|"sends selection"| node_worker
node_worker -->|"stores selections"| node_history
node_popup -->|"reviews locators"| node_locator_results
node_popup -->|"controls recording"| node_recorder
node_web_page -->|"captures interactions"| node_recorder
node_recorder -->|"records steps"| node_recorded_steps
node_popup -->|"reviews steps"| node_recorded_steps
node_popup -->|"generates POM"| node_pom_builder
node_popup -->|"generates test"| node_test_builder
node_pom_builder -->|"renders actions"| node_action_model
node_test_builder -->|"renders steps"| node_action_model
node_pom_builder -->|"emits Page Object"| node_playwright_artifacts
node_test_builder -->|"emits spec"| node_playwright_artifacts
node_messaging -->|"injects scripts"| node_inspector
node_worker -->|"uses message keys"| node_constants
node_popup -->|"uses settings"| node_constants

click node_popup_ui "https://github.com/vinothkumar-sv/locator_qalab/blob/main/src/popup/popup.html"
click node_popup "https://github.com/vinothkumar-sv/locator_qalab/blob/main/src/popup/popup.js"
click node_messaging "https://github.com/vinothkumar-sv/locator_qalab/blob/main/src/shared/messaging.js"
click node_constants "https://github.com/vinothkumar-sv/locator_qalab/blob/main/src/shared/constants.js"
click node_utils "https://github.com/vinothkumar-sv/locator_qalab/blob/main/src/shared/utils.js"
click node_worker "https://github.com/vinothkumar-sv/locator_qalab/blob/main/src/background/service-worker.js"
click node_history "https://github.com/vinothkumar-sv/locator_qalab/blob/main/src/background/service-worker.js"
click node_inspector "https://github.com/vinothkumar-sv/locator_qalab/blob/main/src/content/content.js"
click node_locator_engine "https://github.com/vinothkumar-sv/locator_qalab/blob/main/src/content/locator-engine.js"
click node_locator_results "https://github.com/vinothkumar-sv/locator_qalab/blob/main/src/content/locator-engine.js"
click node_recorder "https://github.com/vinothkumar-sv/locator_qalab/blob/main/src/content/action-recorder.js"
click node_recorded_steps "https://github.com/vinothkumar-sv/locator_qalab/blob/main/src/content/action-recorder.js"
click node_action_model "https://github.com/vinothkumar-sv/locator_qalab/blob/main/src/shared/action-model.js"
click node_pom_builder "https://github.com/vinothkumar-sv/locator_qalab/blob/main/src/popup/popup.js"
click node_test_builder "https://github.com/vinothkumar-sv/locator_qalab/blob/main/src/popup/popup.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_popup_ui,node_popup,node_messaging,node_constants,node_utils,node_worker,node_history toneBlue
class node_inspector,node_locator_engine,node_locator_results toneAmber
class node_recorder,node_recorded_steps toneMint
class node_action_model,node_pom_builder,node_test_builder toneRose
class node_qa,node_web_page,node_playwright_artifacts toneIndigo
```

## Components

### Extension Interface

- [Popup UI](https://github.com/vinothkumar-sv/locator_qalab/blob/main/src/popup/popup.html): `src/popup/popup.html`
- [Popup Controller](https://github.com/vinothkumar-sv/locator_qalab/blob/main/src/popup/popup.js): `src/popup/popup.js`
- [Tab Messaging](https://github.com/vinothkumar-sv/locator_qalab/blob/main/src/shared/messaging.js): `src/shared/messaging.js`
- [Shared Constants](https://github.com/vinothkumar-sv/locator_qalab/blob/main/src/shared/constants.js): `src/shared/constants.js`
- [Shared Utilities](https://github.com/vinothkumar-sv/locator_qalab/blob/main/src/shared/utils.js): `src/shared/utils.js`
- [Service Worker](https://github.com/vinothkumar-sv/locator_qalab/blob/main/src/background/service-worker.js): `src/background/service-worker.js`
- [Selection History](https://github.com/vinothkumar-sv/locator_qalab/blob/main/src/background/service-worker.js): `src/background/service-worker.js`

### Page Inspection

- [Inspector Overlay](https://github.com/vinothkumar-sv/locator_qalab/blob/main/src/content/content.js): `src/content/content.js`
- [Locator Engine](https://github.com/vinothkumar-sv/locator_qalab/blob/main/src/content/locator-engine.js): `src/content/locator-engine.js`
- [Ranked Locators](https://github.com/vinothkumar-sv/locator_qalab/blob/main/src/content/locator-engine.js): `src/content/locator-engine.js`

### Journey Capture

- [Action Recorder](https://github.com/vinothkumar-sv/locator_qalab/blob/main/src/content/action-recorder.js): `src/content/action-recorder.js`
- [Recorded Steps](https://github.com/vinothkumar-sv/locator_qalab/blob/main/src/content/action-recorder.js): `src/content/action-recorder.js`

### Test Generation

- [Action Model](https://github.com/vinothkumar-sv/locator_qalab/blob/main/src/shared/action-model.js): `src/shared/action-model.js`
- [Page Object Builder](https://github.com/vinothkumar-sv/locator_qalab/blob/main/src/popup/popup.js): `src/popup/popup.js`
- [Test Builder](https://github.com/vinothkumar-sv/locator_qalab/blob/main/src/popup/popup.js): `src/popup/popup.js`

### Other components

- **QA Engineer**
- **Web Page**
- **Playwright Artifacts**

## Connections

- QA Engineer → Popup UI: opens (evidence: `README.md`)
- Popup UI → Popup Controller: activates (evidence: `README.md`)
- Popup Controller → Tab Messaging: sends tab messages (evidence: `src/popup/popup.js`)
- Popup Controller → Shared Utilities: sanitizes names (evidence: `src/popup/popup.js`)
- Popup Controller → Action Model: renders steps (evidence: `src/popup/popup.js`)
- Tab Messaging → Web Page: routes messages (evidence: `src/shared/messaging.js`)
- Popup Controller → Inspector Overlay: starts inspection (evidence: `README.md`)
- Web Page → Inspector Overlay: hosts overlay (evidence: `src/content/content.js`)
- Inspector Overlay → Locator Engine: queries analysis (evidence: `src/content/content.js`)
- Locator Engine → Ranked Locators: ranks candidates (evidence: `src/content/locator-engine.js`)
- Inspector Overlay → Service Worker: sends selection (evidence: `src/content/content.js`)
- Service Worker → Selection History: stores selections (evidence: `src/background/service-worker.js`)
- Popup Controller → Ranked Locators: reviews locators (evidence: `README.md`)
- Popup Controller → Action Recorder: controls recording (evidence: `README.md`)
- Web Page → Action Recorder: captures interactions (evidence: `src/content/action-recorder.js`)
- Action Recorder → Recorded Steps: records steps (evidence: `src/content/action-recorder.js`)
- Popup Controller → Recorded Steps: reviews steps (evidence: `README.md`)
- Popup Controller → Page Object Builder: generates POM (evidence: `src/popup/popup.js`)
- Popup Controller → Test Builder: generates test (evidence: `README.md`)
- Page Object Builder → Action Model: renders actions (evidence: `src/popup/popup.js`)
- Test Builder → Action Model: renders steps (evidence: `src/popup/popup.js`)
- Page Object Builder → Playwright Artifacts: emits Page Object (evidence: `README.md`)
- Test Builder → Playwright Artifacts: emits spec (evidence: `README.md`)
- Tab Messaging → Inspector Overlay: injects scripts (evidence: `src/shared/messaging.js`)
- Service Worker → Shared Constants: uses message keys (evidence: `src/background/service-worker.js`)
- Popup Controller → Shared Constants: uses settings (evidence: `src/popup/popup.js`)
