@qa-gentic/stlc-agents 1.0.27 → 1.0.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ARCHITECTURE-ADO.md +350 -0
- package/ARCHITECTURE-JIRA.md +203 -0
- package/QUICKSTART-ADO.md +400 -0
- package/QUICKSTART-JIRA.md +334 -0
- package/README.md +49 -0
- package/package.json +18 -6
- package/skills/migrate-framework/SKILL.md +207 -0
- package/src/stlc_agents/__pycache__/__init__.cpython-313.pyc +0 -0
- package/src/stlc_agents/agent_gherkin_generator/__pycache__/__init__.cpython-313.pyc +0 -0
- package/src/stlc_agents/agent_gherkin_generator/__pycache__/server.cpython-313.pyc +0 -0
- package/src/stlc_agents/agent_gherkin_generator/tools/__pycache__/__init__.cpython-313.pyc +0 -0
- package/src/stlc_agents/agent_gherkin_generator/tools/__pycache__/ado_gherkin.cpython-313.pyc +0 -0
- package/src/stlc_agents/agent_helix_writer/__pycache__/__init__.cpython-313.pyc +0 -0
- package/src/stlc_agents/agent_helix_writer/__pycache__/server.cpython-313.pyc +0 -0
- package/src/stlc_agents/agent_helix_writer/tools/__pycache__/__init__.cpython-313.pyc +0 -0
- package/src/stlc_agents/agent_helix_writer/tools/__pycache__/boilerplate.cpython-313.pyc +0 -0
- package/src/stlc_agents/agent_helix_writer/tools/__pycache__/helix_write.cpython-313.pyc +0 -0
- package/src/stlc_agents/agent_jira_manager/__pycache__/__init__.cpython-313.pyc +0 -0
- package/src/stlc_agents/agent_jira_manager/__pycache__/server.cpython-313.pyc +0 -0
- package/src/stlc_agents/agent_jira_manager/tools/__pycache__/__init__.cpython-313.pyc +0 -0
- package/src/stlc_agents/agent_jira_manager/tools/__pycache__/jira_workitem.cpython-313.pyc +0 -0
- package/src/stlc_agents/agent_migration/__init__.py +0 -0
- package/src/stlc_agents/agent_migration/__pycache__/__init__.cpython-313.pyc +0 -0
- package/src/stlc_agents/agent_migration/__pycache__/_migrate.cpython-313.pyc +0 -0
- package/src/stlc_agents/agent_migration/__pycache__/cli.cpython-313.pyc +0 -0
- package/src/stlc_agents/agent_migration/__pycache__/detector.cpython-313.pyc +0 -0
- package/src/stlc_agents/agent_migration/__pycache__/mapper.cpython-313.pyc +0 -0
- package/src/stlc_agents/agent_migration/__pycache__/reporter.cpython-313.pyc +0 -0
- package/src/stlc_agents/agent_migration/__pycache__/server.cpython-313.pyc +0 -0
- package/src/stlc_agents/agent_migration/_migrate.py +1398 -0
- package/src/stlc_agents/agent_migration/cli.py +217 -0
- package/src/stlc_agents/agent_migration/detector.py +81 -0
- package/src/stlc_agents/agent_migration/mapper.py +439 -0
- package/src/stlc_agents/agent_migration/reporter.py +86 -0
- package/src/stlc_agents/agent_migration/server.py +267 -0
- package/src/stlc_agents/agent_migration/transformer/__init__.py +0 -0
- package/src/stlc_agents/agent_migration/transformer/__pycache__/__init__.cpython-313.pyc +0 -0
- package/src/stlc_agents/agent_migration/transformer/__pycache__/config_merger.cpython-313.pyc +0 -0
- package/src/stlc_agents/agent_migration/transformer/__pycache__/healer_injector.cpython-313.pyc +0 -0
- package/src/stlc_agents/agent_migration/transformer/__pycache__/import_fixer.cpython-313.pyc +0 -0
- package/src/stlc_agents/agent_migration/transformer/__pycache__/js_to_ts.cpython-313.pyc +0 -0
- package/src/stlc_agents/agent_migration/transformer/__pycache__/local_var_hoister.cpython-313.pyc +0 -0
- package/src/stlc_agents/agent_migration/transformer/__pycache__/locator_moderniser.cpython-313.pyc +0 -0
- package/src/stlc_agents/agent_migration/transformer/__pycache__/locator_registrar.cpython-313.pyc +0 -0
- package/src/stlc_agents/agent_migration/transformer/__pycache__/spec_to_bdd.cpython-313.pyc +0 -0
- package/src/stlc_agents/agent_migration/transformer/config_merger.py +513 -0
- package/src/stlc_agents/agent_migration/transformer/healer_injector.py +1143 -0
- package/src/stlc_agents/agent_migration/transformer/import_fixer.py +419 -0
- package/src/stlc_agents/agent_migration/transformer/js_to_ts.py +413 -0
- package/src/stlc_agents/agent_migration/transformer/local_var_hoister.py +378 -0
- package/src/stlc_agents/agent_migration/transformer/locator_moderniser.py +132 -0
- package/src/stlc_agents/agent_migration/transformer/locator_registrar.py +328 -0
- package/src/stlc_agents/agent_migration/transformer/spec_to_bdd.py +820 -0
- package/src/stlc_agents/agent_playwright_generator/__pycache__/__init__.cpython-313.pyc +0 -0
- package/src/stlc_agents/agent_playwright_generator/__pycache__/server.cpython-313.pyc +0 -0
- package/src/stlc_agents/agent_playwright_generator/server.py +926 -91
- package/src/stlc_agents/agent_playwright_generator/tools/__pycache__/__init__.cpython-313.pyc +0 -0
- package/src/stlc_agents/agent_playwright_generator/tools/__pycache__/ado_attach.cpython-313.pyc +0 -0
- package/src/stlc_agents/agent_test_case_manager/__pycache__/__init__.cpython-313.pyc +0 -0
- package/src/stlc_agents/agent_test_case_manager/__pycache__/server.cpython-313.pyc +0 -0
- package/src/stlc_agents/agent_test_case_manager/tools/__pycache__/__init__.cpython-313.pyc +0 -0
- package/src/stlc_agents/agent_test_case_manager/tools/__pycache__/ado_workitem.cpython-313.pyc +0 -0
- package/src/stlc_agents/shared/__pycache__/__init__.cpython-313.pyc +0 -0
- package/src/stlc_agents/shared/__pycache__/auth.cpython-313.pyc +0 -0
- package/src/stlc_agents/shared/__pycache__/cost_tracker.cpython-313.pyc +0 -0
- package/src/stlc_agents/shared/__pycache__/pricing.cpython-313.pyc +0 -0
- package/src/stlc_agents/shared_jira/__pycache__/__init__.cpython-313.pyc +0 -0
- package/src/stlc_agents/shared_jira/__pycache__/auth.cpython-313.pyc +0 -0
- package/src/stlc_agents/webhook_orchestrator/__pycache__/__init__.cpython-313.pyc +0 -0
- package/src/stlc_agents/webhook_orchestrator/__pycache__/agent_runner.cpython-313.pyc +0 -0
- package/src/stlc_agents/webhook_orchestrator/__pycache__/models.cpython-313.pyc +0 -0
- package/src/stlc_agents/webhook_orchestrator/__pycache__/orchestrator.cpython-313.pyc +0 -0
- package/src/stlc_agents/webhook_orchestrator/__pycache__/webhook_bridge.cpython-313.pyc +0 -0
- package/src/stlc_agents/agent_gherkin_generator/__pycache__/__init__.cpython-314.pyc +0 -0
- package/src/stlc_agents/agent_gherkin_generator/__pycache__/server.cpython-314.pyc +0 -0
- package/src/stlc_agents/agent_gherkin_generator/tools/__pycache__/__init__.cpython-314.pyc +0 -0
- package/src/stlc_agents/agent_gherkin_generator/tools/__pycache__/ado_gherkin.cpython-314.pyc +0 -0
- package/src/stlc_agents/agent_helix_writer/__pycache__/server.cpython-314.pyc +0 -0
- package/src/stlc_agents/agent_playwright_generator/__pycache__/__init__.cpython-314.pyc +0 -0
- package/src/stlc_agents/agent_playwright_generator/__pycache__/server.cpython-314.pyc +0 -0
- package/src/stlc_agents/agent_playwright_generator/tools/__pycache__/__init__.cpython-314.pyc +0 -0
- package/src/stlc_agents/agent_playwright_generator/tools/__pycache__/ado_attach.cpython-314.pyc +0 -0
- package/src/stlc_agents/agent_test_case_manager/__pycache__/__init__.cpython-314.pyc +0 -0
- package/src/stlc_agents/agent_test_case_manager/__pycache__/server.cpython-314.pyc +0 -0
- package/src/stlc_agents/agent_test_case_manager/tools/__pycache__/__init__.cpython-314.pyc +0 -0
- package/src/stlc_agents/agent_test_case_manager/tools/__pycache__/ado_workitem.cpython-314.pyc +0 -0
- package/src/stlc_agents/shared/__pycache__/__init__.cpython-314.pyc +0 -0
- package/src/stlc_agents/shared/__pycache__/auth.cpython-314.pyc +0 -0
- package/src/stlc_agents/shared/__pycache__/cost_tracker.cpython-314.pyc +0 -0
- package/src/stlc_agents/shared/__pycache__/pricing.cpython-314.pyc +0 -0
|
@@ -0,0 +1,334 @@
|
|
|
1
|
+
# @qa-gentic/stlc-agents — Jira Cloud Quick Start
|
|
2
|
+
|
|
3
|
+
> Jira Cloud pipeline: issue → test cases → Gherkin → Playwright TypeScript → Helix-QA.
|
|
4
|
+
> For Azure DevOps see [QUICKSTART-ADO.md](QUICKSTART-ADO.md).
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
Works with **GitHub Copilot** (VS Code Agent mode), **Claude Code**, **Cursor**, and **Windsurf**.
|
|
8
|
+
|
|
9
|
+
[](https://www.npmjs.com/package/@qa-gentic/stlc-agents)
|
|
10
|
+
[](https://pypi.org/project/qa-gentic-stlc-agents/)
|
|
11
|
+
[](LICENSE)
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
## What the Jira Pipeline Does
|
|
17
|
+
|
|
18
|
+
Six Python MCP servers. The Jira pipeline uses `qa-jira-manager` as its entry point, then the three shared agents, with `qa-migration` / `stlc-migrate` available for converting existing Playwright projects:
|
|
19
|
+
|
|
20
|
+
| Step | Agent | What happens |
|
|
21
|
+
|---|---|---|
|
|
22
|
+
| 1 | `qa-jira-manager` | Fetch Jira issue + analyse acceptance criteria |
|
|
23
|
+
| 2 | `qa-jira-manager` | Generate test cases → create in Jira with `is tested by` links |
|
|
24
|
+
| 3 | `qa-gherkin-generator` | Generate Gherkin `.feature` file |
|
|
25
|
+
| 4 | `qa-playwright-generator` | Gherkin + live browser → self-healing Playwright TypeScript |
|
|
26
|
+
| 5 | `qa-helix-writer` | Write generated files to Helix-QA project on disk |
|
|
27
|
+
| — | `qa-migration` / `stlc-migrate` | Existing Playwright project → fully agent-ready Helix-QA tree (Jira `.mcp.json`, skills, healer scaffold, BOILERPLATE infra) |
|
|
28
|
+
|
|
29
|
+
The Playwright MCP server (`http://localhost:8931/mcp`) is required for browser-driven code generation. It is not part of this package and must be started separately.
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
## Install
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
npm install -g @qa-gentic/stlc-agents
|
|
37
|
+
qa-stlc init --vscode --integration jira
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
`qa-stlc init --integration jira` performs:
|
|
42
|
+
1. `pip install qa-gentic-stlc-agents` — installs all six Python MCP servers + `stlc-migrate` CLI
|
|
43
|
+
2. Copies skill files (including `qa-jira-manager/`, `generate-gherkin/`, `generate-playwright-code/`, `write-helix-files/`, `migrate-framework/`) to your coding agent directory
|
|
44
|
+
3. Writes `.vscode/mcp.json` with all required servers configured (`qa-jira-manager` + shared Agents 2–4 + `qa-migration` + `playwright`)
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
Start the Playwright MCP server before your first session:
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
npx @playwright/mcp@latest --port 8931
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
## Requirements
|
|
57
|
+
|
|
58
|
+
- Node.js ≥ 18
|
|
59
|
+
- Python ≥ 3.10, < 3.14
|
|
60
|
+
- Jira Cloud site with OAuth 2.0 credentials (see [Authentication Setup](#authentication-setup))
|
|
61
|
+
- A `.env` file containing:
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
```env
|
|
65
|
+
# Jira Cloud credentials
|
|
66
|
+
JIRA_CLIENT_ID=your-atlassian-oauth-client-id
|
|
67
|
+
JIRA_CLIENT_SECRET=your-atlassian-oauth-client-secret
|
|
68
|
+
JIRA_CLOUD_ID=your-atlassian-cloud-id
|
|
69
|
+
# Optional — defaults to http://localhost:8765/callback
|
|
70
|
+
# JIRA_REDIRECT_URI=http://localhost:8765/callback
|
|
71
|
+
|
|
72
|
+
# Application under test
|
|
73
|
+
APP_BASE_URL=https://your-app.example.com
|
|
74
|
+
APP_EMAIL=your-test-email@example.com
|
|
75
|
+
APP_PASSWORD=your-test-password
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
---
|
|
79
|
+
|
|
80
|
+
## Authentication Setup
|
|
81
|
+
|
|
82
|
+
### Step 1 — Create an Atlassian OAuth 2.0 (3LO) app
|
|
83
|
+
|
|
84
|
+
1. Go to <https://developer.atlassian.com/console/myapps/>
|
|
85
|
+
2. Click **Create** → **OAuth 2.0 integration**
|
|
86
|
+
3. Add callback URL: `http://localhost:8765/callback`
|
|
87
|
+
4. Under **Permissions**, add Jira API scopes: `read:jira-user`, `read:jira-work`, `write:jira-work`
|
|
88
|
+
5. Copy the **Client ID** and **Secret**
|
|
89
|
+
|
|
90
|
+
### Step 2 — Find your Cloud ID
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
curl -H "Authorization: Bearer <any-valid-token>" \
|
|
94
|
+
https://api.atlassian.com/oauth/token/accessible-resources
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
Copy the `id` field for your Jira site.
|
|
98
|
+
|
|
99
|
+
### Step 3 — Add to `.env`
|
|
100
|
+
|
|
101
|
+
```env
|
|
102
|
+
JIRA_CLIENT_ID=your-client-id
|
|
103
|
+
JIRA_CLIENT_SECRET=your-client-secret
|
|
104
|
+
JIRA_CLOUD_ID=your-cloud-id
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
### Step 4 — First run
|
|
108
|
+
|
|
109
|
+
On first use a browser opens once for sign-in. The token is cached at `~/.jira-cache/jira-token.json` and silently refreshed for ~60 days.
|
|
110
|
+
|
|
111
|
+
---
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
## Commands
|
|
115
|
+
|
|
116
|
+
All `qa-stlc` commands accept `--integration jira`:
|
|
117
|
+
|
|
118
|
+
```bash
|
|
119
|
+
qa-stlc init [--vscode] [--python <path>] --integration jira
|
|
120
|
+
# Full bootstrap: pip install + Jira skills + MCP config with all 5 agents
|
|
121
|
+
|
|
122
|
+
qa-stlc mcp-config [--vscode] [--print] [--python <path>] --integration jira
|
|
123
|
+
# Write MCP config including qa-jira-manager + shared agents
|
|
124
|
+
|
|
125
|
+
qa-stlc skills [--target claude|vscode|cursor|windsurf|both|print] --integration jira
|
|
126
|
+
# Install Jira + shared skill files (excludes ADO-only generate-test-cases/)
|
|
127
|
+
|
|
128
|
+
qa-stlc verify --integration jira
|
|
129
|
+
# Check all 6 MCP servers are installed + Jira auth cache exists
|
|
130
|
+
|
|
131
|
+
qa-stlc scaffold [--name <n>] [--dir <path>]
|
|
132
|
+
# Scaffold a new Playwright + Cucumber + TypeScript QA project (same as ADO)
|
|
133
|
+
|
|
134
|
+
stlc-migrate --source <existing> --helix <target> --integration jira [--conflict overwrite|skip|interactive] [--dry-run] [--json]
|
|
135
|
+
# Migrate an existing Playwright (with or without Cucumber) project into the
|
|
136
|
+
# Helix-QA layout, Jira variant. Installs Jira-only skills + .mcp.json with
|
|
137
|
+
# qa-jira-manager (incl. JIRA_CLIENT_ID/SECRET/CLOUD_ID env passthrough),
|
|
138
|
+
# the enhanced healer scaffold (LocatorHealer 8-strategy chain, LocatorRepository
|
|
139
|
+
# schema v1, HealingDashboard with write-back), AGENT-BEHAVIOR.md,
|
|
140
|
+
# ORCHESTRATION_RULES.md, and the 11-file BOILERPLATE allowlist. See
|
|
141
|
+
# `skills/migrate-framework/SKILL.md` for the full pipeline reference.
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
### Makefile shortcuts
|
|
145
|
+
|
|
146
|
+
```bash
|
|
147
|
+
make bootstrap-jira # one-shot: Jira skills + .mcp.json
|
|
148
|
+
make migrate-jira SOURCE=<old> HELIX=<new> # Jira migration with sensible defaults
|
|
149
|
+
make migrate-jira SOURCE=<old> HELIX=<new> CONFLICT=overwrite # re-migrate in place
|
|
150
|
+
make audit-migration HELIX=<new> # framework_state + skills + healer scaffold + heal-store report
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
---
|
|
154
|
+
|
|
155
|
+
## Usage
|
|
156
|
+
|
|
157
|
+
Open your AI coding agent and use natural language:
|
|
158
|
+
|
|
159
|
+
```
|
|
160
|
+
# Full Jira pipeline — single prompt
|
|
161
|
+
Run the full STLC pipeline for Jira issue PROJ-123
|
|
162
|
+
|
|
163
|
+
# Step by step
|
|
164
|
+
Fetch Jira issue PROJ-123 and analyse acceptance criteria
|
|
165
|
+
Generate test cases for PROJ-123 and create them in Jira
|
|
166
|
+
Generate Gherkin feature file for PROJ-123
|
|
167
|
+
Generate Playwright TypeScript for the Gherkin I just created. The login page is at /auth/login
|
|
168
|
+
Write the generated files to my Helix-QA project at /workspace/my-qa-project
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
---
|
|
172
|
+
|
|
173
|
+
## Tool Reference
|
|
174
|
+
|
|
175
|
+
|
|
176
|
+
### qa-jira-manager
|
|
177
|
+
|
|
178
|
+
| Tool | Description |
|
|
179
|
+
|---|---|
|
|
180
|
+
| `fetch_jira_issue` | Fetch a Story, Bug, Task, or Sub-task with acceptance criteria and coverage hints. Routes Epics to `fetch_jira_epic_hierarchy`. |
|
|
181
|
+
| `fetch_jira_epic_hierarchy` | Fetch an Epic and all child issues (Stories, Tasks, Bugs, Sub-tasks). |
|
|
182
|
+
| `create_and_link_test_cases` | Create test case issues in Jira (type `Test`, falls back to `Task`) and link them via `is tested by`. Steps stored as ADF table — no Xray required. Returns `confirmation_required: true` for Epics. |
|
|
183
|
+
| `get_linked_test_cases` | Return all test cases already linked to a Jira issue. Call before generating to power the deduplication gate. |
|
|
184
|
+
|
|
185
|
+
### qa-gherkin-generator (shared)
|
|
186
|
+
|
|
187
|
+
| Tool | Description |
|
|
188
|
+
|---|---|
|
|
189
|
+
| `fetch_work_item_for_gherkin` | Fetch a work item with AC context for Gherkin generation (pass Jira issue key). |
|
|
190
|
+
| `validate_gherkin_content` | Structural validation — tags, scenario count, navigation steps. Returns `valid: bool` + `errors` + `warnings`. |
|
|
191
|
+
| `attach_gherkin_to_work_item` | Validate and attach a `.feature` file (for Jira pipeline: saves locally or attaches via Jira REST). |
|
|
192
|
+
|
|
193
|
+
### qa-playwright-generator (shared)
|
|
194
|
+
|
|
195
|
+
| Tool | Description |
|
|
196
|
+
|---|---|
|
|
197
|
+
| `generate_playwright_code` | Generate `locators.ts`, `*Page.ts`, `*.steps.ts` from validated Gherkin + live AX-tree `context_map`. Blocks if `context_map` is absent. |
|
|
198
|
+
| `scaffold_locator_repository` | Generate the six Helix-QA healing infrastructure files. |
|
|
199
|
+
| `validate_gherkin_steps` | Check for duplicate step strings and missing `When` steps. |
|
|
200
|
+
|
|
201
|
+
### qa-helix-writer (shared)
|
|
202
|
+
|
|
203
|
+
| Tool | Description |
|
|
204
|
+
|---|---|
|
|
205
|
+
| `inspect_helix_project` | Returns `framework_state` (`present` / `partial` / `absent`) and `recommendation`. |
|
|
206
|
+
| `list_helix_tree` | List the full directory tree of a Helix-QA project. |
|
|
207
|
+
| `read_helix_file` | Read an existing file for overlap detection. |
|
|
208
|
+
| `write_helix_files` | Write generated files to the correct Helix-QA paths. |
|
|
209
|
+
|
|
210
|
+
### playwright (external)
|
|
211
|
+
|
|
212
|
+
| Tool | Description |
|
|
213
|
+
|---|---|
|
|
214
|
+
| `browser_navigate` | Navigate to a URL in the live browser. |
|
|
215
|
+
| `browser_snapshot` | Capture the full AX tree — source for zero-hallucination locators. |
|
|
216
|
+
| `browser_fill_form` | Fill multiple form fields by ref. |
|
|
217
|
+
| `browser_click` | Click an element by ref. |
|
|
218
|
+
|
|
219
|
+
---
|
|
220
|
+
|
|
221
|
+
## MCP Config
|
|
222
|
+
|
|
223
|
+
### VS Code / GitHub Copilot (`.vscode/mcp.json`)
|
|
224
|
+
|
|
225
|
+
```json
|
|
226
|
+
{
|
|
227
|
+
"servers": {
|
|
228
|
+
"qa-jira-manager": { "command": "/path/to/.venv/bin/qa-jira-manager",
|
|
229
|
+
"env": { "JIRA_CLIENT_ID": "${env:JIRA_CLIENT_ID}",
|
|
230
|
+
"JIRA_CLIENT_SECRET": "${env:JIRA_CLIENT_SECRET}",
|
|
231
|
+
"JIRA_CLOUD_ID": "${env:JIRA_CLOUD_ID}" } },
|
|
232
|
+
"qa-gherkin-generator": { "command": "/path/to/.venv/bin/qa-gherkin-generator" },
|
|
233
|
+
"qa-playwright-generator": { "command": "/path/to/.venv/bin/qa-playwright-generator" },
|
|
234
|
+
"qa-helix-writer": { "command": "/path/to/.venv/bin/qa-helix-writer" },
|
|
235
|
+
"qa-migration": { "command": "/path/to/.venv/bin/stlc-migrate" },
|
|
236
|
+
"playwright": { "type": "http", "url": "http://localhost:8931/mcp" }
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
### Claude Code (`.mcp.json`)
|
|
242
|
+
|
|
243
|
+
```json
|
|
244
|
+
{
|
|
245
|
+
"mcpServers": {
|
|
246
|
+
"qa-jira-manager": { "command": "/path/to/.venv/bin/qa-jira-manager",
|
|
247
|
+
"env": { "JIRA_CLIENT_ID": "${env:JIRA_CLIENT_ID}",
|
|
248
|
+
"JIRA_CLIENT_SECRET": "${env:JIRA_CLIENT_SECRET}",
|
|
249
|
+
"JIRA_CLOUD_ID": "${env:JIRA_CLOUD_ID}" } },
|
|
250
|
+
"qa-gherkin-generator": { "command": "/path/to/.venv/bin/qa-gherkin-generator" },
|
|
251
|
+
"qa-playwright-generator": { "command": "/path/to/.venv/bin/qa-playwright-generator" },
|
|
252
|
+
"qa-helix-writer": { "command": "/path/to/.venv/bin/qa-helix-writer" },
|
|
253
|
+
"qa-migration": { "command": "/path/to/.venv/bin/stlc-migrate" },
|
|
254
|
+
"playwright": { "command": "npx", "args": ["@playwright/mcp@latest", "--isolated"] }
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
```
|
|
258
|
+
|
|
259
|
+
> Run `qa-stlc mcp-config --integration jira [--vscode]` to generate this
|
|
260
|
+
> manually, or run `stlc-migrate --integration jira` and the migration emits
|
|
261
|
+
> `.mcp.json` automatically with absolute binary paths discovered from the
|
|
262
|
+
> active venv.
|
|
263
|
+
|
|
264
|
+
---
|
|
265
|
+
|
|
266
|
+
|
|
267
|
+
## Skills Installed (Jira integration)
|
|
268
|
+
|
|
269
|
+
| Skill | Purpose |
|
|
270
|
+
|---|---|
|
|
271
|
+
| `AGENT-BEHAVIOR.md` | Zero-inference contract. Read first. Always. |
|
|
272
|
+
| `qa-jira-manager/` | Jira fetch, test case creation, and full pipeline orchestration |
|
|
273
|
+
| `generate-gherkin/` | Gherkin generation from issue AC |
|
|
274
|
+
| `generate-playwright-code/` | Gherkin + live browser → self-healing Playwright TypeScript |
|
|
275
|
+
| `write-helix-files/` | Generated files → Helix-QA disk layout |
|
|
276
|
+
| `deduplication-protocol/` | READ → DIFF → CREATE mandatory pre-flight gate |
|
|
277
|
+
|
|
278
|
+
> `generate-test-cases/` is excluded for Jira-only installs — it is ADO work-item-scoped.
|
|
279
|
+
|
|
280
|
+
---
|
|
281
|
+
|
|
282
|
+
## Three-Layer Self-Healing Architecture
|
|
283
|
+
|
|
284
|
+
Same as the ADO pipeline — the generated Playwright code uses identical healing infrastructure:
|
|
285
|
+
|
|
286
|
+
| Layer | Class | What it heals |
|
|
287
|
+
|---|---|---|
|
|
288
|
+
| 1 — Locator | `LocatorHealer` | 8-strategy chain: cached → primary → **attribute** → **type-hint** → role → label → text → AI Vision. After match, introspects the live element and persists a specific single-attribute selector (`#id`, `[data-testid=…]`, etc.). |
|
|
289
|
+
| 2 — Timing | `TimingHealer` | Network-trace drift → auto-adjusted timeouts → HealingDashboard |
|
|
290
|
+
| 3 — Visual | `VisualIntentChecker` | Element screenshot diff at assertions → HealingDashboard |
|
|
291
|
+
|
|
292
|
+
Refer to [ARCHITECTURE-ADO.md § Three-Layer Self-Healing Architecture](ARCHITECTURE-ADO.md#three-layer-self-healing-architecture) for full strategy ordering, env-var tuning (`HEAL_STRATEGY_ORDER`, `LOCATOR_TIMEOUT`, `LOCATOR_HEAL_ATTEMPTS`, etc.), and HealingDashboard write-back behaviour.
|
|
293
|
+
|
|
294
|
+
---
|
|
295
|
+
|
|
296
|
+
## Run Tests
|
|
297
|
+
|
|
298
|
+
```bash
|
|
299
|
+
ENABLE_SELF_HEALING=true \
|
|
300
|
+
HEALING_DASHBOARD_PORT=7890 \
|
|
301
|
+
APP_BASE_URL=<your-app-base-url> \
|
|
302
|
+
APP_EMAIL=<email> \
|
|
303
|
+
APP_PASSWORD=<password> \
|
|
304
|
+
cucumber-js --config=config/cucumber.js -p <feature_profile>
|
|
305
|
+
```
|
|
306
|
+
|
|
307
|
+
### Inspect healed locators (migrated projects only)
|
|
308
|
+
|
|
309
|
+
```bash
|
|
310
|
+
ENV=qa4 npm run healix:dashboard # http://localhost:7890 — Confirm / Revert
|
|
311
|
+
ENV=qa4 npm run healix:review # http://localhost:7891 — read-only mirror
|
|
312
|
+
cat self-heals/healed-locators.qa4.json | jq .
|
|
313
|
+
tail self-heals/heal.log
|
|
314
|
+
```
|
|
315
|
+
|
|
316
|
+
Confirm on a healed entry rewrites the source `*.locators.ts` file's
|
|
317
|
+
`selector:` field — future runs use it as the primary probe.
|
|
318
|
+
|
|
319
|
+
---
|
|
320
|
+
|
|
321
|
+
## Documentation
|
|
322
|
+
|
|
323
|
+
- [Quick Start: Azure DevOps](QUICKSTART-ADO.md)
|
|
324
|
+
- [Quick Start: Jira Cloud](QUICKSTART-JIRA.md)
|
|
325
|
+
- [Architecture: ADO](ARCHITECTURE-ADO.md)
|
|
326
|
+
- [Architecture: Jira](ARCHITECTURE-JIRA.md)
|
|
327
|
+
- [Walkthrough: ADO](WALKTHROUGH-ADO.md)
|
|
328
|
+
- [Walkthrough: Jira](WALKTHROUGH-JIRA.md)
|
|
329
|
+
|
|
330
|
+
---
|
|
331
|
+
|
|
332
|
+
## License
|
|
333
|
+
|
|
334
|
+
MIT
|
package/README.md
CHANGED
|
@@ -136,6 +136,55 @@ qa-stlc scaffold --name my-qa-project
|
|
|
136
136
|
npx @playwright/mcp@latest --port 8931
|
|
137
137
|
```
|
|
138
138
|
|
|
139
|
+
### Migrating an existing Playwright project
|
|
140
|
+
|
|
141
|
+
If you have an existing Playwright (with or without Cucumber) project and want
|
|
142
|
+
to bring it onto the agent rails, use `stlc-migrate`:
|
|
143
|
+
|
|
144
|
+
```bash
|
|
145
|
+
# Preview without writing
|
|
146
|
+
stlc-migrate --source ./my-old-tests --helix ./helix-qa --dry-run
|
|
147
|
+
|
|
148
|
+
# Full migration — every agent skill, .mcp.json, healer scaffold, agent docs
|
|
149
|
+
stlc-migrate --source ./my-old-tests --helix ./helix-qa --integration both
|
|
150
|
+
|
|
151
|
+
# ADO-only or Jira-only
|
|
152
|
+
stlc-migrate --source ./my-old-tests --helix ./helix-qa --integration ado
|
|
153
|
+
stlc-migrate --source ./my-old-tests --helix ./helix-qa --integration jira
|
|
154
|
+
|
|
155
|
+
# Refresh scaffold/skills on an existing migrated tree
|
|
156
|
+
stlc-migrate --source ./my-old-tests --helix ./helix-qa --conflict overwrite
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
The tool emits a complete agent-ready tree:
|
|
160
|
+
|
|
161
|
+
| Layer | What lands |
|
|
162
|
+
|---|---|
|
|
163
|
+
| **Code** | Page objects + step files + locator files in `{selector, intent, stability}` format; every locator interaction routed through `LocatorHealer.*WithHealing`; non-BDD `.spec.*` files losslessly converted to one-scenario-per-test BDD |
|
|
164
|
+
| **Healing infra** | 8-strategy `LocatorHealer` (attribute / type-hint / role / label / text / AI Vision), `LocatorRepository` with schema-versioned heal-only persist + per-env file suffix, `HealingDashboard` (read/write at 7890 + read-only mirror at `HEALIX_REVIEW_PORT`), `TimingHealer`, `VisualIntentChecker` |
|
|
165
|
+
| **Agent assets** | `.mcp.json` (all 6 MCP servers + Playwright MCP), `.claude/skills/<name>/SKILL.md` per integration, `.github/copilot-instructions/<name>.md` flat copies, `AGENT-BEHAVIOR.md` + `ORCHESTRATION_RULES.md` at root + `.claude/` + `.github/` |
|
|
166
|
+
| **Configs** | `cucumber.js` with `dotenv/config` as first `requireModule`, `package.json` with `dotenv` + `@types/*` companions, `tsconfig.json` aliases, `.env.example` documenting every healing knob |
|
|
167
|
+
|
|
168
|
+
See `skills/migrate-framework/SKILL.md` for the full pipeline + environment variable reference.
|
|
169
|
+
|
|
170
|
+
### Healing dashboard
|
|
171
|
+
|
|
172
|
+
Once a migrated project has run any test that triggers healing, inspect the
|
|
173
|
+
results via the dashboard:
|
|
174
|
+
|
|
175
|
+
```bash
|
|
176
|
+
ENV=qa4 npm run healix:dashboard # full UI at http://localhost:7890
|
|
177
|
+
ENV=qa4 npm run healix:review # read-only mirror at http://localhost:7891
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
The dashboard shows each healed locator with its original selector, the
|
|
181
|
+
specific selector that actually matched on the live page (introspected from
|
|
182
|
+
the matched element — e.g. `#login-username`, not the generic search union),
|
|
183
|
+
and **Confirm / Revert** buttons. **Confirm rewrites the original locator
|
|
184
|
+
`.ts` file's `selector:` field** so the next run uses the verified selector
|
|
185
|
+
as the primary probe — no healing chain required until the page changes
|
|
186
|
+
again.
|
|
187
|
+
|
|
139
188
|
### Cost Tracking Activation
|
|
140
189
|
|
|
141
190
|
**npm install** (`npm install -g @qa-gentic/stlc-agents`): Cost tracking is activated automatically after the Python servers are installed. No manual step required.
|
package/package.json
CHANGED
|
@@ -1,22 +1,29 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@qa-gentic/stlc-agents",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"description": "QA STLC Agents —
|
|
3
|
+
"version": "1.0.28",
|
|
4
|
+
"description": "QA STLC Agents — six MCP servers + skills for AI-powered test case, Gherkin, self-healing Playwright generation, Helix-QA file writing, and existing-framework migration against Azure DevOps and Jira Cloud. Includes an 8-strategy LocatorHealer with a live HealingDashboard (write-back-to-source) and a one-shot `stlc-migrate` CLI that converts an existing Playwright project into a fully agent-ready Helix-QA tree. Works with Claude Code, GitHub Copilot, Cursor, Windsurf.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"playwright",
|
|
7
|
+
"playwright-migration",
|
|
8
|
+
"framework-migration",
|
|
7
9
|
"mcp",
|
|
10
|
+
"mcp-server",
|
|
8
11
|
"azure-devops",
|
|
12
|
+
"jira",
|
|
9
13
|
"gherkin",
|
|
10
14
|
"bdd",
|
|
15
|
+
"cucumber",
|
|
11
16
|
"qa",
|
|
12
17
|
"test-automation",
|
|
18
|
+
"self-healing",
|
|
19
|
+
"healing-dashboard",
|
|
20
|
+
"locator-healer",
|
|
13
21
|
"claude",
|
|
14
|
-
"copilot",
|
|
15
22
|
"claude-code",
|
|
16
|
-
"
|
|
17
|
-
"self-healing",
|
|
23
|
+
"copilot",
|
|
18
24
|
"helix",
|
|
19
25
|
"scaffold",
|
|
26
|
+
"stlc-migrate",
|
|
20
27
|
"cursor",
|
|
21
28
|
"windsurf"
|
|
22
29
|
],
|
|
@@ -38,7 +45,12 @@
|
|
|
38
45
|
"skills/",
|
|
39
46
|
".github/agents/",
|
|
40
47
|
"README.md",
|
|
41
|
-
"ORCHESTRATION_RULES.md"
|
|
48
|
+
"ORCHESTRATION_RULES.md",
|
|
49
|
+
"AGENT-BEHAVIOR.md",
|
|
50
|
+
"ARCHITECTURE-ADO.md",
|
|
51
|
+
"ARCHITECTURE-JIRA.md",
|
|
52
|
+
"QUICKSTART-ADO.md",
|
|
53
|
+
"QUICKSTART-JIRA.md"
|
|
42
54
|
],
|
|
43
55
|
"scripts": {
|
|
44
56
|
"postinstall": "node ./bin/postinstall.js"
|
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
# Skill: migrate-framework
|
|
2
|
+
|
|
3
|
+
Migrate an existing Playwright test framework into the Helix-QA layout so every
|
|
4
|
+
QA STLC agent (qa-test-case-manager, qa-gherkin-generator, qa-playwright-generator,
|
|
5
|
+
qa-helix-writer, qa-jira-manager) can operate against it. The migration ships
|
|
6
|
+
self-healing locator infrastructure, an HTTP healing dashboard, agent skill
|
|
7
|
+
files, an `.mcp.json`, and every other asset the agents expect.
|
|
8
|
+
|
|
9
|
+
## When to use this skill
|
|
10
|
+
|
|
11
|
+
Trigger on any of:
|
|
12
|
+
- "migrate my Playwright tests"
|
|
13
|
+
- "convert existing tests to Helix"
|
|
14
|
+
- "migrate playwright+cucumber project"
|
|
15
|
+
- "bring old tests into the agent framework"
|
|
16
|
+
- "stlc-migrate", "qa-migration", "migrate_framework" tool names
|
|
17
|
+
|
|
18
|
+
## Supported source frameworks
|
|
19
|
+
|
|
20
|
+
| Framework | Detection |
|
|
21
|
+
|-----------|-----------|
|
|
22
|
+
| Plain Playwright JS | `playwright.config.js`, no `.feature` files |
|
|
23
|
+
| Plain Playwright TS | `playwright.config.ts`, no `.feature` files |
|
|
24
|
+
| Playwright + Cucumber JS | `playwright.config.js` + `.feature` files or `@cucumber/cucumber` in package.json |
|
|
25
|
+
| Playwright + Cucumber TS | `playwright.config.ts` + `.feature` files or `@cucumber/cucumber` in package.json |
|
|
26
|
+
|
|
27
|
+
## Step-by-step workflow
|
|
28
|
+
|
|
29
|
+
### Step 1 — Confirm source and target directories
|
|
30
|
+
|
|
31
|
+
Ask the user for:
|
|
32
|
+
- **Source directory** — root of the existing Playwright project (must exist)
|
|
33
|
+
- **Helix root** — root of the Helix-QA project to migrate into (must exist unless dry-run)
|
|
34
|
+
- **Integration** (optional) — `ado`, `jira`, or `both` (default `both`). Controls which agent skills + MCP entries get installed.
|
|
35
|
+
|
|
36
|
+
### Step 2 — Detect the framework
|
|
37
|
+
|
|
38
|
+
```
|
|
39
|
+
detect_framework(source_dir=<source>)
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
Report back:
|
|
43
|
+
- `framework` — one of: `playwright-bdd-ts`, `playwright-bdd-js`, `playwright-ts`, `playwright-js`
|
|
44
|
+
- `language` — `typescript` or `javascript`
|
|
45
|
+
- `bdd` — whether BDD/Cucumber files were found
|
|
46
|
+
- `file_counts` — number of `.ts`, `.js`, `.feature` files found
|
|
47
|
+
|
|
48
|
+
### Step 3 — Preview the migration plan
|
|
49
|
+
|
|
50
|
+
```
|
|
51
|
+
preview_migration(source_dir=<source>, helix_root=<helix>)
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Show the user:
|
|
55
|
+
- Total mappable files and their roles
|
|
56
|
+
- Any conflicts (files already existing in Helix)
|
|
57
|
+
- Files with unknown/unrecognised roles that will be skipped
|
|
58
|
+
|
|
59
|
+
Ask the user to confirm before proceeding if there are conflicts.
|
|
60
|
+
|
|
61
|
+
### Step 4 — Run the migration
|
|
62
|
+
|
|
63
|
+
```
|
|
64
|
+
migrate_framework(
|
|
65
|
+
source_dir=<source>,
|
|
66
|
+
helix_root=<helix>,
|
|
67
|
+
conflict_strategy="interactive", # "overwrite" | "skip" | "interactive"
|
|
68
|
+
integration="both", # "ado" | "jira" | "both"
|
|
69
|
+
dry_run=false,
|
|
70
|
+
)
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
The tool applies this pipeline to each file:
|
|
74
|
+
|
|
75
|
+
| Step | What happens |
|
|
76
|
+
|------|-------------|
|
|
77
|
+
| **JS → TS** | `require(...)` → `import`, `module.exports` → `export default`, async return types added |
|
|
78
|
+
| **Locator modernisation** | `[data-testid]` → `getByTestId`, `text=` → `getByText`, `[aria-label]` → `getByLabel`, `[placeholder]` → `getByPlaceholder`, `role=X[name=Y]` → `getByRole`. Complex XPath/CSS flagged with `// TODO`. **Multi-line string-concat selectors** (`"a" + "b"`) are registered as a single `{selector, intent, stability}` entry preserving the concatenation. |
|
|
79
|
+
| **Healer injection** | EVERY locator interaction (regardless of caller shape) is routed through `_healer.clickWithHealing` / `_healer.fillWithHealing` / `_healer.assertVisibleWithHealing`. Covered patterns: raw `page.click/fill`, chained `page.locator(X).click()`, custom wrappers (`base.waitAndClick`, `base.waitAndFill`, `*ByTestId` variants), non-awaited calls inside `Promise.all([...])`, `currentFixture.page.*` receivers, aliased references (`this.Elements.foo`, `const E = fooLocators`), inline class-field locator dictionaries (`private MassInviteElements = { ... }`), and dynamic selectors (auto-wrapped with `dyn.<prefix>.<n>` keys). Arguments are extracted by **balanced-paren scan** so calls like `fill(X, String(visitorCount))` extract the full second arg. |
|
|
80
|
+
| **Locator registration** | Every page-object constructor gets `Object.entries(xxxLocators).forEach(([k, v]) => { this._repo.register(\`xxxPage.${k}\`, ...); this._repo.register(k, ...); })` so the runtime store knows about every key. Registers under both **namespaced** and **bare** key conventions so legacy hand-written `_healer.<…>("usernameInput", …)` and freshly-emitted `_healer.<…>("loginPage.usernameInput", …)` both resolve. |
|
|
81
|
+
| **Import fixing** | Relative imports remapped to the **mapper's authoritative target paths** (no more "predicted" alias names that don't match what was actually written). Source-project `@pages/scweb/locators` → `@locators/locators.locators` exactly as the mapper renamed it. |
|
|
82
|
+
| **Spec → BDD** | See "Zero-inference guarantees" below. |
|
|
83
|
+
| **Config merge** | `playwright.config` settings merged. `cucumber.js` is rewritten with `dotenv/config` injected as the FIRST `requireModule` entry — so `.env` is loaded before any TS file is compiled. `package.json` gets `dotenv` runtime dep, `@types/*` companions for known JS-only deps (fs-extra, lodash, glob, mkdirp, rimraf, uuid, js-yaml, jsonwebtoken, module-alias, cookie, express, cors, node-fetch, minimist, yargs, semver), and two new scripts: `healix:dashboard` and `healix:review`. |
|
|
84
|
+
| **tsconfig merge** | Adds path aliases (`@pages`, `@steps`, `@features`, `@locators`, `@hooks`, `@helper`, `@utils`, `@config`). Does **not** fabricate `strict: true` / `strictNullChecks` — the source's strictness setting is preserved verbatim (introducing strictness the source didn't have would surface cascading errors on code that compiled fine before). |
|
|
85
|
+
|
|
86
|
+
#### Zero-inference guarantees for spec → BDD
|
|
87
|
+
|
|
88
|
+
The converter is intentionally **lossless** and **non-fabricating**:
|
|
89
|
+
|
|
90
|
+
- **No generic step text.** Step text is always the literal `test()` name (prefixed with the file slug for cross-file uniqueness). The tool does NOT invent `"I run step #N"`, `"I prepare state #N"`, or `"I execute if block #N"` text.
|
|
91
|
+
- **One step per test.** The full original body of each `test('name', body)` is placed inside a single step definition. No per-statement splitting; no Given/When/Then reclassification.
|
|
92
|
+
- **Hooks become real Cucumber hooks.** `test.beforeEach`/`afterEach`/`beforeAll`/`afterAll` → real `Before`/`After`/`BeforeAll`/`AfterAll`. `test.skip`/`only`/`fixme`/`fail`/`slow` modifiers → `@skip`/`@only`/… tags on the scenario.
|
|
93
|
+
- **Nothing is dropped.** Module-level helpers, suite-scope `let`/`const`/`var`, comments, and hook bodies are all preserved. `test.use(...)`/`test.step(...)` and other runner-only calls are commented out as `// MIGRATION TODO:` rather than silently removed.
|
|
94
|
+
- **Source bugs surface, not papered over.** If the original source references a non-existent property (e.g. `GlobalVars.Api.Username` when the class only exposes `username`), the migrated step keeps the original reference. `tsc` will flag it; the tool does not "fix" what it cannot verify.
|
|
95
|
+
- **Step text with `/`, `(`, `)`, `{`, `}`** is rendered as a RegExp step definition automatically so Cucumber Expression parsing doesn't reject the test name.
|
|
96
|
+
|
|
97
|
+
### Step 5 — Scaffold & assets installed automatically
|
|
98
|
+
|
|
99
|
+
In addition to file-by-file migration, the tool emits a complete agent-ready
|
|
100
|
+
tree:
|
|
101
|
+
|
|
102
|
+
| Asset | What it does |
|
|
103
|
+
|---|---|
|
|
104
|
+
| `src/utils/locators/LocatorHealer.ts` | 8-strategy healing chain: cached-healed → primary → **attribute** → **type-hint** → role → label → text → AI Vision. After each successful strategy, the matched element is introspected and the **specific stable selector** (data-testid > id > name > placeholder > aria-label > autocomplete > input[type]) is persisted — not the search union. Strategy order tunable via `HEAL_STRATEGY_ORDER` CSV. |
|
|
105
|
+
| `src/utils/locators/LocatorRepository.ts` | Heal store: schema v1 envelope (`{_version, _writtenAt, entries}`), heal-only persist filter (baseline-only entries don't get written), debounced writes (500ms), singleton process exit hook, read-modify-write merge for multi-instance safety, ENV-suffixed file path (`healed-locators.qa4.json` when ENV=qa4), capped `healingHistory` (default 50, env-tunable). |
|
|
106
|
+
| `src/utils/locators/TimingHealer.ts` / `VisualIntentChecker.ts` | Network-trace timing healer + visual-regression checker. |
|
|
107
|
+
| `src/utils/locators/HealingDashboard.ts` | Two-server HTTP UI. Primary at `HEALING_DASHBOARD_PORT` (default 7890) has Healed-locators + Pending-suggestions tables with Confirm/Revert / Approve/Reject buttons. Read-only mirror at `HEALIX_REVIEW_PORT` (opt-in, default 0). Auto-discovers all sibling heal-store files in the directory (so `healix:dashboard` without an ENV picks up `*.qa4.json` automatically). **Confirm on a healed entry writes the healed selector back to the locator `.ts` file** so the next run uses it as the primary. |
|
|
108
|
+
| `src/utils/locators/dashboard-server.ts` | Standalone launcher for the dashboard. Wired via `healix:dashboard` and `healix:review` npm scripts. |
|
|
109
|
+
| `src/utils/locators/{ElementContextHelper, HealApplicator, LocatorRules, LocatorStrategy, healix-ci-apply, review-server}.ts` | Filled from `agent_helix_writer.tools.boilerplate.BOILERPLATE` — purely additive infrastructure that integrates with the enhanced LocatorHealer. |
|
|
110
|
+
| `src/utils/helpers/{Logger, RetryHandler, WaitHelper}.ts` | Filled from BOILERPLATE — helpers the strategy layer depends on. |
|
|
111
|
+
| `src/config/environment.ts` | Filled from BOILERPLATE — referenced by Logger. |
|
|
112
|
+
| `src/locators/base.locators.ts` | Filled from BOILERPLATE — base locator file. |
|
|
113
|
+
| `.claude/skills/<name>/SKILL.md` + `.github/copilot-instructions/<name>.md` | Per-integration skill files (ado / jira / both). |
|
|
114
|
+
| `AGENT-BEHAVIOR.md` + `ORCHESTRATION_RULES.md` | Copied to project root, `.claude/`, and `.github/copilot-instructions/`. |
|
|
115
|
+
| `.mcp.json` | Auto-generated entries for every agent + Playwright MCP, with absolute binary paths. |
|
|
116
|
+
| `.env.example` | Documents every healing env var: `HEAL_STORE_PATH`, `HEAL_LOG_PATH`, `HEAL_LOG_DISABLED`, `ENABLE_LOCATOR_VERSIONING`, `HEAL_HISTORY_CAP`, `LOCATOR_TIMEOUT`, `LOCATOR_HEAL_ATTEMPTS`, `HEAL_STRATEGY_ORDER`, `HEALING_DASHBOARD_PORT`, `HEALIX_REVIEW_PORT`, `ENABLE_AI_HEALING`, `AI_HEALING_PROVIDER`, `AI_HEALING_API_KEY`, `ENV` / `HELIX_ENV`. |
|
|
117
|
+
|
|
118
|
+
### Step 6 — Review the migration report
|
|
119
|
+
|
|
120
|
+
The tool writes `MIGRATION-REPORT.md` to the Helix root. Report back to the user:
|
|
121
|
+
- Number of files written / skipped / conflicted
|
|
122
|
+
- TODO count (locators needing manual review)
|
|
123
|
+
- Path to `MIGRATION-REPORT.md`
|
|
124
|
+
|
|
125
|
+
### Step 7 — Post-migration steps (tell the user)
|
|
126
|
+
|
|
127
|
+
After migration, the user should:
|
|
128
|
+
|
|
129
|
+
1. `npm install` — picks up new deps (`dotenv`, `@types/fs-extra`, etc.).
|
|
130
|
+
2. `npx tsc --noEmit` — should be clean (any remaining errors are source bugs the migration preserved verbatim per the zero-inference contract).
|
|
131
|
+
3. Review `// TODO: convert to getByRole` comments in locator files (complex XPath/CSS the tool wouldn't auto-rewrite).
|
|
132
|
+
4. Fill in `.env` — at minimum, set `HEADLESS=false` if you want a visible browser.
|
|
133
|
+
5. Verify `inspect_helix_project` reports `framework_state: "present"` against the migrated tree.
|
|
134
|
+
6. Run the existing test suite (e.g. `npm test`) — healing fires automatically on broken primary selectors and writes to `self-heals/healed-locators[.<env>].json`.
|
|
135
|
+
7. Inspect heals visually:
|
|
136
|
+
- `npm run healix:dashboard` → http://localhost:7890 (full UI with Confirm / Revert)
|
|
137
|
+
- `npm run healix:review` → http://localhost:7891 (read-only mirror)
|
|
138
|
+
8. When ready, click **Confirm** on a heal — the migration rewrites the source locator file's `selector:` field with the verified healed value. Future runs use it as the primary; the healing chain only fires if the page changes again.
|
|
139
|
+
|
|
140
|
+
## Helix-QA file layout
|
|
141
|
+
|
|
142
|
+
| Source role | Helix target |
|
|
143
|
+
|-------------|-------------|
|
|
144
|
+
| Locators (`*Locators.ts`, `*selectors.ts`) | `src/locators/<kebab>.locators.ts` |
|
|
145
|
+
| Page objects (`*Page.ts`, `*.page.ts`) | `src/pages/<kebab>.page.ts` |
|
|
146
|
+
| Step definitions (`*.steps.ts`, `step_definitions/**`) | `src/test/steps/<kebab>.steps.ts` |
|
|
147
|
+
| Feature files (`*.feature`) | `src/test/features/<kebab>.feature` |
|
|
148
|
+
| Playwright config | `playwright.config.ts` (merged) |
|
|
149
|
+
| Cucumber config | `config/cucumber.js` (merged, with `dotenv/config` injected) |
|
|
150
|
+
| Heal-store JSON | `self-heals/healed-locators[.<env>].json` (heal-only) |
|
|
151
|
+
| Heal audit log | `self-heals/heal.log` (tab-separated `timestamp / key / strategy / selector`) |
|
|
152
|
+
|
|
153
|
+
## CLI usage (terminal)
|
|
154
|
+
|
|
155
|
+
```bash
|
|
156
|
+
# Preview migration without writing
|
|
157
|
+
stlc-migrate --source ./my-old-tests --helix ./helix-qa --dry-run
|
|
158
|
+
|
|
159
|
+
# Full migration (interactive conflict handling, every agent reachable)
|
|
160
|
+
stlc-migrate --source ./my-old-tests --helix ./helix-qa
|
|
161
|
+
|
|
162
|
+
# ADO-only integration (no Jira skill / MCP entry)
|
|
163
|
+
stlc-migrate --source ./my-old-tests --helix ./helix-qa --integration ado
|
|
164
|
+
|
|
165
|
+
# Jira-only
|
|
166
|
+
stlc-migrate --source ./my-old-tests --helix ./helix-qa --integration jira
|
|
167
|
+
|
|
168
|
+
# Overwrite all existing files (refreshes scaffold + skill files)
|
|
169
|
+
stlc-migrate --source ./my-old-tests --helix ./helix-qa --conflict overwrite
|
|
170
|
+
|
|
171
|
+
# JSON output for scripting
|
|
172
|
+
stlc-migrate --source ./my-old-tests --helix ./helix-qa --json
|
|
173
|
+
|
|
174
|
+
# Makefile shortcut
|
|
175
|
+
make migrate-preview SOURCE=./my-old-tests HELIX=./helix-qa
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
## Runtime environment variables
|
|
179
|
+
|
|
180
|
+
Every knob has a sensible default. Override per-run in `.env` or via `cross-env` in npm scripts.
|
|
181
|
+
|
|
182
|
+
| Variable | Default | Effect |
|
|
183
|
+
|---|---|---|
|
|
184
|
+
| `HEAL_STORE_PATH` | `./self-heals/healed-locators.json` | Where the heal-store JSON is read/written. |
|
|
185
|
+
| `HEAL_LOG_PATH` | sibling `heal.log` | Tab-separated audit log per heal. |
|
|
186
|
+
| `HEAL_LOG_DISABLED` | `false` | Set `true` to skip the audit log. |
|
|
187
|
+
| `ENV` / `HELIX_ENV` | unset | When set, auto-suffixes the heal-store path: `healed-locators.qa4.json`. |
|
|
188
|
+
| `ENABLE_LOCATOR_VERSIONING` | `true` | When `false`, keeps only the latest heal entry (no `healingHistory[]` accumulation). |
|
|
189
|
+
| `HEAL_HISTORY_CAP` | `50` | Max heals retained per locator. `0` = unlimited. |
|
|
190
|
+
| `LOCATOR_TIMEOUT` | `3000` | Per-strategy attach-probe timeout (ms). |
|
|
191
|
+
| `LOCATOR_HEAL_ATTEMPTS` | `0` (unlimited) | Bound on the total number of probes before AI Vision fallback. |
|
|
192
|
+
| `HEAL_STRATEGY_ORDER` | `attribute,type-hint,role,label,text` | CSV — omit names to disable; reorder to prioritise. |
|
|
193
|
+
| `HEALING_DASHBOARD_PORT` | `7890` | Dashboard server port. `0` to disable. |
|
|
194
|
+
| `HEALIX_REVIEW_PORT` | `0` (disabled) | Read-only review server port (rejects POSTs with 403). |
|
|
195
|
+
| `ENABLE_AI_HEALING` | `true` | When `false`, AI Vision strategy is skipped. |
|
|
196
|
+
| `AI_HEALING_PROVIDER` | `anthropic` | One of `anthropic` / `copilot` / `claude-code`. |
|
|
197
|
+
| `AI_HEALING_API_KEY` (or `ANTHROPIC_API_KEY`) | unset | Required when AI Vision is enabled and primary fails. |
|
|
198
|
+
|
|
199
|
+
## Key rules
|
|
200
|
+
|
|
201
|
+
1. **Always run `preview_migration` first** — review the plan and conflicts before writing.
|
|
202
|
+
2. **Never infer conflict decisions** — ask the user whether to overwrite, skip, or abort.
|
|
203
|
+
3. **TODO comments are not errors** — complex locators flagged with `// TODO` are valid output; inform the user they need manual review.
|
|
204
|
+
4. **Feature files are copied as-is** — no Gherkin transformation is applied to `.feature` files during migration (the spec→BDD conversion is only for non-BDD `.spec.*` sources).
|
|
205
|
+
5. **BOILERPLATE fill is allowlisted** — `_BOILERPLATE_FILL_ALLOWLIST` in `_migrate.py` lists exactly which boilerplate entries are dropped in (the rest are held back because they assume APIs the enhanced scaffold doesn't expose).
|
|
206
|
+
6. **Config merge is non-destructive** — existing settings in Helix configs are never overwritten; only missing settings are added. `--conflict overwrite` refreshes `.mcp.json`, `.env.example`, generated scaffolds, and the cucumber config to pick up tool-side improvements.
|
|
207
|
+
7. **Healing scaffold takes precedence over BOILERPLATE** — the enhanced `LocatorHealer.ts` / `LocatorRepository.ts` / `TimingHealer.ts` / `VisualIntentChecker.ts` / `HealingDashboard.ts` are written first by `_scaffold_locator_repository`; the BOILERPLATE versions of the same files are never written.
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|