ai-driven-e2e 0.4.0__py3-none-any.whl
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.
- ai_driven_e2e-0.4.0.dist-info/METADATA +427 -0
- ai_driven_e2e-0.4.0.dist-info/RECORD +49 -0
- ai_driven_e2e-0.4.0.dist-info/WHEEL +4 -0
- ai_driven_e2e-0.4.0.dist-info/entry_points.txt +2 -0
- ai_driven_e2e-0.4.0.dist-info/licenses/LICENSE +21 -0
- app/__init__.py +1 -0
- app/cli.py +381 -0
- app/config.py +105 -0
- app/graph.py +86 -0
- app/llm.py +246 -0
- app/logging.py +22 -0
- app/nodes/__init__.py +1 -0
- app/nodes/diagnoser.py +28 -0
- app/nodes/patch_generator.py +43 -0
- app/nodes/reviewer.py +34 -0
- app/nodes/selector_verifier.py +75 -0
- app/nodes/shadow_verifier.py +106 -0
- app/nodes/test_runner.py +36 -0
- app/preprocess/__init__.py +1 -0
- app/preprocess/aria_snapshot.py +70 -0
- app/preprocess/diff_ast_analyzer.py +201 -0
- app/preprocess/error_log_parser.py +52 -0
- app/preprocess/failure_scanner.py +32 -0
- app/prompts/__init__.py +1 -0
- app/prompts/diagnoser.py +11 -0
- app/prompts/patch_generator.py +14 -0
- app/prompts/reviewer.py +18 -0
- app/runner.py +31 -0
- app/sandbox.py +130 -0
- app/schemas.py +99 -0
- app/shadow/__init__.py +69 -0
- app/shadow/config.py +47 -0
- app/shadow/context.py +30 -0
- app/shadow/in_memory_snapshot_store.py +36 -0
- app/shadow/injector.py +131 -0
- app/shadow/interfaces.py +158 -0
- app/shadow/matcher.py +94 -0
- app/shadow/normalizer.py +119 -0
- app/shadow/runtime.py +233 -0
- app/shadow/schemas.py +62 -0
- app/shadow/scoring.py +114 -0
- app/shadow/snapshot_store.py +106 -0
- app/shadow/trace_parser.py +266 -0
- app/shadow/workspace.py +104 -0
- app/state.py +23 -0
- app/utils/__init__.py +1 -0
- app/utils/files.py +24 -0
- app/verify/__init__.py +1 -0
- app/verify/selector_check.py +92 -0
|
@@ -0,0 +1,427 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: ai-driven-e2e
|
|
3
|
+
Version: 0.4.0
|
|
4
|
+
Summary: LangGraph-based AI-driven E2E test self-healing engine (CLI core + CI integration)
|
|
5
|
+
Project-URL: Homepage, https://github.com/Lee-Dongwook/E2E-Self-Heal
|
|
6
|
+
Project-URL: Repository, https://github.com/Lee-Dongwook/E2E-Self-Heal
|
|
7
|
+
Project-URL: Issues, https://github.com/Lee-Dongwook/E2E-Self-Heal/issues
|
|
8
|
+
Author-email: Lee-Dongwook <dlehddnr0713@gmail.com>, Avaneesh Joshi <avaneeshjoshi18@gmail.com>
|
|
9
|
+
License-Expression: MIT
|
|
10
|
+
License-File: LICENSE
|
|
11
|
+
Keywords: cli,e2e,langgraph,llm,playwright,self-healing,testing
|
|
12
|
+
Classifier: Development Status :: 3 - Alpha
|
|
13
|
+
Classifier: Environment :: Console
|
|
14
|
+
Classifier: Intended Audience :: Developers
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
16
|
+
Classifier: Topic :: Software Development :: Quality Assurance
|
|
17
|
+
Classifier: Topic :: Software Development :: Testing
|
|
18
|
+
Requires-Python: >=3.13
|
|
19
|
+
Requires-Dist: langchain-openai>=1.0
|
|
20
|
+
Requires-Dist: langgraph>=0.2
|
|
21
|
+
Requires-Dist: openai>=1.40
|
|
22
|
+
Requires-Dist: playwright>=1.40
|
|
23
|
+
Requires-Dist: pydantic-settings>=2.3
|
|
24
|
+
Requires-Dist: pydantic>=2.7
|
|
25
|
+
Requires-Dist: rich>=13.7
|
|
26
|
+
Requires-Dist: structlog>=24.1
|
|
27
|
+
Requires-Dist: tenacity>=8.3
|
|
28
|
+
Requires-Dist: tree-sitter-typescript>=0.23.2
|
|
29
|
+
Requires-Dist: tree-sitter>=0.26.0
|
|
30
|
+
Requires-Dist: typer>=0.12
|
|
31
|
+
Provides-Extra: anthropic
|
|
32
|
+
Requires-Dist: langchain-anthropic>=1.0; extra == 'anthropic'
|
|
33
|
+
Provides-Extra: dev
|
|
34
|
+
Requires-Dist: langchain-anthropic>=1.0; extra == 'dev'
|
|
35
|
+
Requires-Dist: langchain-ollama>=1.0; extra == 'dev'
|
|
36
|
+
Requires-Dist: pyright>=1.1; extra == 'dev'
|
|
37
|
+
Requires-Dist: pytest-cov>=5.0; extra == 'dev'
|
|
38
|
+
Requires-Dist: pytest>=8.2; extra == 'dev'
|
|
39
|
+
Requires-Dist: ruff>=0.5; extra == 'dev'
|
|
40
|
+
Provides-Extra: ollama
|
|
41
|
+
Requires-Dist: langchain-ollama>=1.0; extra == 'ollama'
|
|
42
|
+
Description-Content-Type: text/markdown
|
|
43
|
+
|
|
44
|
+
# AI-Driven E2E Test Self-Healing Engine
|
|
45
|
+
|
|
46
|
+
<!-- language: **English** · [한국어](README.ko.md) · [日本語](README.ja.md) · [简体中文](README.zh-CN.md) -->
|
|
47
|
+
|
|
48
|
+
**English** · [한국어](README.ko.md) · [日本語](README.ja.md) · [简体中文](README.zh-CN.md)
|
|
49
|
+
|
|
50
|
+
[](https://github.com/Lee-Dongwook/E2E-Self-Heal/actions/workflows/ci.yml)
|
|
51
|
+
[](https://www.python.org/)
|
|
52
|
+
[](LICENSE)
|
|
53
|
+
|
|
54
|
+
A **self-healing** engine that automatically repairs broken **Playwright** E2E tests with an
|
|
55
|
+
**AI agent** built on **LangGraph**. When a UI change renames or restructures
|
|
56
|
+
an element and a test's selector breaks, the engine diagnoses the failure, patches the
|
|
57
|
+
broken selector/wait, **verifies the new selector against the live DOM**, then re-runs the
|
|
58
|
+
test until it passes (or a retry cap is hit) and writes the fix back — as a local **CLI** or
|
|
59
|
+
a **CI GitHub Action** that opens a patch PR.
|
|
60
|
+
|
|
61
|
+
> **Scope guardrail:** the engine only fixes **failing locators and wait conditions**. It
|
|
62
|
+
> never touches assertions or test logic, and every patch stays human-reviewable.
|
|
63
|
+
|
|
64
|
+
### Two modes: **heal** and **review**
|
|
65
|
+
|
|
66
|
+
Auto-healing patches the _test_. That is fast, but on its own it can look like papering over
|
|
67
|
+
a real problem — the source that broke the selector. So the engine offers a second mode:
|
|
68
|
+
|
|
69
|
+
- **`heal`** (default) — patch the broken selector/wait and re-run until green. Best when the
|
|
70
|
+
UI change is intentional and the test simply needs to catch up.
|
|
71
|
+
- **`review`** — diagnose _why_ the selector broke and post **source-level suggestions** as
|
|
72
|
+
**inline PR comments** (e.g. "this `className` rename broke `#cta`; add a stable
|
|
73
|
+
`data-testid` or use `getByRole`"). It **never edits the test** — it advises the fix at the
|
|
74
|
+
source and pushes teams toward resilient, accessibility-first selectors.
|
|
75
|
+
|
|
76
|
+
Same diagnosis engine, two outputs: a patch, or a review. Pick per-project or per-PR.
|
|
77
|
+
|
|
78
|
+

|
|
79
|
+
|
|
80
|
+
## How it works
|
|
81
|
+
|
|
82
|
+
Four layers drive a LangGraph repair loop:
|
|
83
|
+
|
|
84
|
+
1. **CLI core** — the single entry point (`e2e-healer`); everything, including CI, calls it.
|
|
85
|
+
2. **Data Preprocessor** — abstracts the raw Playwright log and the `git diff` into compact,
|
|
86
|
+
hallucination-resistant context (the failing selector + the DOM attribute that changed).
|
|
87
|
+
3. **LangGraph agent** — `Diagnoser → Patch Generator → Selector Verifier → Test Runner`,
|
|
88
|
+
looping via a conditional Router until the test passes or `max_loops` is reached.
|
|
89
|
+
4. **Selector Verifier** — checks each patched selector against the real page DOM so it
|
|
90
|
+
resolves to **exactly one** element (Node/Playwright helper). Hallucinated (0 matches) or
|
|
91
|
+
ambiguous (>1) selectors are reverted and re-patched _before_ a full test run.
|
|
92
|
+
5. **Test Runner** — runs `npx playwright test` via subprocess to validate each attempt.
|
|
93
|
+
|
|
94
|
+
```
|
|
95
|
+
┌──────────┐ ┌─────────────────┐ ┌───────────────────┐ ┌─────────────┐
|
|
96
|
+
──▶│ Diagnoser│──▶ │ Patch Generator │──▶ │ Selector Verifier │─┬─▶│ Test Runner │──┐
|
|
97
|
+
└──────────┘ └─────────────────┘ └───────────────────┘ │ └─────────────┘ │
|
|
98
|
+
▲ ▲ verify fail (0/2+ match) → repatch ┘ │
|
|
99
|
+
│ └───────────────────────────────────────────────────────┘│
|
|
100
|
+
│ fail & loop_count < max │
|
|
101
|
+
└─────────────────────────────── Router ◀───────────────────────────────────┘
|
|
102
|
+
│ pass or loop cap
|
|
103
|
+
▼
|
|
104
|
+
[End]
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
> The Selector Verifier **skips** gracefully (loop proceeds unverified) when
|
|
108
|
+
> `E2E_HEALER_APP_URL` is empty or the page is unreachable (e.g. Node/Playwright not
|
|
109
|
+
> installed) — tooling problems never block a heal.
|
|
110
|
+
|
|
111
|
+
See [`docs/design.md`](docs/design.md) for the full design, and
|
|
112
|
+
[`docs/shadow-testing.md`](docs/shadow-testing.md) for the planned Shadow Testing pipeline.
|
|
113
|
+
|
|
114
|
+
## Usage (CI / GitHub Action)
|
|
115
|
+
|
|
116
|
+
The flagship workflow: run your suite and auto-heal on failure, opening a patch PR for review:
|
|
117
|
+
|
|
118
|
+
```yaml
|
|
119
|
+
- name: E2E self-heal
|
|
120
|
+
id: heal
|
|
121
|
+
uses: Lee-Dongwook/E2E-Self-Heal@v0.2.0
|
|
122
|
+
with:
|
|
123
|
+
test-path: tests/example.spec.ts
|
|
124
|
+
nvidia-api-key: ${{ secrets.NVIDIA_API_KEY }}
|
|
125
|
+
diff-base: ${{ github.event.pull_request.base.sha }}
|
|
126
|
+
app-url: http://localhost:4173 # optional: enables live selector verification
|
|
127
|
+
|
|
128
|
+
- name: Open patch PR
|
|
129
|
+
if: steps.heal.outputs.outcome == 'healed'
|
|
130
|
+
uses: peter-evans/create-pull-request@v6
|
|
131
|
+
with:
|
|
132
|
+
body-path: ${{ steps.heal.outputs.summary-path }}
|
|
133
|
+
branch: e2e-self-heal/${{ github.run_id }}
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
The action's `outcome` output is `passed` \| `healed` \| `unhealed` (heal mode) or `reviewed`
|
|
137
|
+
(review mode). For a Playwright suite in a subdirectory, pass `working-directory:`. A
|
|
138
|
+
**runnable self-demo** that heals this repo's own `examples/` project lives in
|
|
139
|
+
[`ci/github-workflow.example.yml`](ci/github-workflow.example.yml).
|
|
140
|
+
|
|
141
|
+
To run as a **PR review bot** instead, pass `mode: review` and post the findings as inline PR
|
|
142
|
+
comments — a ready-to-copy workflow lives in
|
|
143
|
+
[`ci/github-review-bot.example.yml`](ci/github-review-bot.example.yml):
|
|
144
|
+
|
|
145
|
+
```yaml
|
|
146
|
+
- name: E2E review
|
|
147
|
+
id: review
|
|
148
|
+
uses: Lee-Dongwook/E2E-Self-Heal@v0.2.0
|
|
149
|
+
with:
|
|
150
|
+
mode: review
|
|
151
|
+
test-path: tests/example.spec.ts
|
|
152
|
+
nvidia-api-key: ${{ secrets.NVIDIA_API_KEY }}
|
|
153
|
+
diff-base: ${{ github.event.pull_request.base.sha }}
|
|
154
|
+
# then read steps.review.outputs.review-path and post inline comments (see the example)
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
## Demo (verified end-to-end)
|
|
158
|
+
|
|
159
|
+
The [`examples/`](examples/) project reproduces a real break: the page's button id was
|
|
160
|
+
renamed `submit-btn` → `submit`, so `example.spec.ts` times out. Running the healer against
|
|
161
|
+
it (with a live NVIDIA key) produces:
|
|
162
|
+
|
|
163
|
+
```text
|
|
164
|
+
diagnoser_finished
|
|
165
|
+
patch_generator_finished instruction_count=1
|
|
166
|
+
selector_verify_started selector_count=1 url=http://localhost:4173
|
|
167
|
+
selector_verify_passed counts={'#submit': 1}
|
|
168
|
+
test_runner_passed loop_count=0
|
|
169
|
+
fixed after 0 loop(s)
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
```diff
|
|
173
|
+
- await page.click("#submit-btn");
|
|
174
|
+
+ await page.click("#submit"); # assertion on "Thanks!" left untouched
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
Reproduce it yourself: see [`examples/README.md`](examples/README.md).
|
|
178
|
+
|
|
179
|
+
## In practice
|
|
180
|
+
|
|
181
|
+
A real run against a landing-page CTA test. A UI refactor renamed the button id
|
|
182
|
+
`#enter-demo-btn` → `#demo-cta-btn`, so `demo-cta.spec.ts` started failing on
|
|
183
|
+
`locator.click`. Pointed at the file, the engine diagnosed the break against the `git diff`,
|
|
184
|
+
patched **only the broken selector** (leaving the `toHaveURL` assertion untouched), re-ran
|
|
185
|
+
the suite, and passed on the first attempt — end to end on NVIDIA NIM
|
|
186
|
+
(`integrate.api.nvidia.com`, `openai/gpt-oss-120b`):
|
|
187
|
+
|
|
188
|
+

|
|
189
|
+
|
|
190
|
+
```text
|
|
191
|
+
playwright_run_finished passed=False # original selector times out
|
|
192
|
+
diagnoser_started loop_count=0
|
|
193
|
+
diagnoser_finished
|
|
194
|
+
patch_generator_finished instruction_count=1
|
|
195
|
+
test_runner_started
|
|
196
|
+
playwright_run_finished passed=True
|
|
197
|
+
repair_run_finished is_success=True loop_count=0
|
|
198
|
+
fixed after 0 loop(s)
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
```diff
|
|
202
|
+
test('guest enters the demo workspace from the landing CTA', async ({ page }) => {
|
|
203
|
+
await page.goto('/')
|
|
204
|
+
- await page.click('#enter-demo-btn')
|
|
205
|
+
+ await page.click('#demo-cta-btn')
|
|
206
|
+
await expect(page).toHaveURL(/\/w\//) // assertion left untouched
|
|
207
|
+
})
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
## Install
|
|
211
|
+
|
|
212
|
+
Requires Python 3.13+ and a Playwright project (Node) in your repo.
|
|
213
|
+
|
|
214
|
+
**Recommended — one-line global install:**
|
|
215
|
+
|
|
216
|
+
```bash
|
|
217
|
+
pipx install ai-driven-e2e
|
|
218
|
+
# or, before PyPI release:
|
|
219
|
+
uv tool install git+https://github.com/Lee-Dongwook/E2E-Self-Heal.git
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
Then in any Playwright project:
|
|
223
|
+
|
|
224
|
+
```bash
|
|
225
|
+
cp .env.example .env # set E2E_HEALER_NVIDIA_API_KEY
|
|
226
|
+
e2e-healer tests/login.spec.ts
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
Get a free NVIDIA NIM API key at [build.nvidia.com](https://build.nvidia.com/) (default
|
|
230
|
+
model `openai/gpt-oss-120b`).
|
|
231
|
+
|
|
232
|
+
<details>
|
|
233
|
+
<summary>Development install from a local clone</summary>
|
|
234
|
+
|
|
235
|
+
```bash
|
|
236
|
+
git clone https://github.com/Lee-Dongwook/E2E-Self-Heal.git
|
|
237
|
+
cd E2E-Self-Heal
|
|
238
|
+
uv sync --extra dev
|
|
239
|
+
uv tool install --force . # global `e2e-healer` from this checkout
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
Re-run `uv tool install --force .` after pulling changes.
|
|
243
|
+
|
|
244
|
+
</details>
|
|
245
|
+
|
|
246
|
+
## Usage (CLI)
|
|
247
|
+
|
|
248
|
+
```bash
|
|
249
|
+
# Heal the WHOLE suite — run every test, then repair each failing file (aggregate summary):
|
|
250
|
+
uv run e2e-healer
|
|
251
|
+
|
|
252
|
+
# Heal a single failing test (with no --log, the tool runs it to capture the failure):
|
|
253
|
+
uv run e2e-healer tests/example.spec.ts
|
|
254
|
+
|
|
255
|
+
# Preview only — run the loop but write nothing:
|
|
256
|
+
uv run e2e-healer tests/example.spec.ts --dry-run
|
|
257
|
+
|
|
258
|
+
# Feed a pre-captured log and a PR-scoped diff (the CI path):
|
|
259
|
+
uv run e2e-healer tests/example.spec.ts --log playwright.log --diff-base origin/main --json
|
|
260
|
+
|
|
261
|
+
# Enable live-DOM selector verification against a running app:
|
|
262
|
+
uv run e2e-healer tests/example.spec.ts --app-url http://localhost:4173
|
|
263
|
+
|
|
264
|
+
# Review mode — suggest source-level fixes instead of patching (never edits the test):
|
|
265
|
+
uv run e2e-healer review tests/example.spec.ts --log playwright.log --diff-base origin/main --json
|
|
266
|
+
```
|
|
267
|
+
|
|
268
|
+
Exit code is `0` when the test is healed, non-zero otherwise. `--json` prints a
|
|
269
|
+
machine-readable `RepairSummary` to stdout (human output goes to stderr) so CI can branch
|
|
270
|
+
on it. `e2e-healer <path>` is shorthand for `e2e-healer heal <path>`; `review` is a separate
|
|
271
|
+
subcommand that emits a `ReviewReport` (findings anchored to the changed source line) and
|
|
272
|
+
always exits `0` — the CI wrapper branches on `has_findings`.
|
|
273
|
+
|
|
274
|
+
## Configuration
|
|
275
|
+
|
|
276
|
+
All settings use the `E2E_HEALER_` prefix (see [`.env.example`](.env.example)). LLM
|
|
277
|
+
configuration is **provider-neutral**: pick a backend with `E2E_HEALER_LLM_PROVIDER` and
|
|
278
|
+
configure it via the generic `LLM_*` vars. The legacy `NVIDIA_*` vars still work — when
|
|
279
|
+
the provider is `nvidia` they are folded into the generic ones, so existing setups need no
|
|
280
|
+
changes.
|
|
281
|
+
|
|
282
|
+
### Provider matrix
|
|
283
|
+
|
|
284
|
+
| Provider | Install | Required env | Structured outputs | Notes |
|
|
285
|
+
| ----------- | ------------------------------ | -------------------------------------------------------- | ----------------------------- | --------------------------------------------------------------------- |
|
|
286
|
+
| `nvidia` | built-in (default) | `E2E_HEALER_LLM_API_KEY` (or legacy `NVIDIA_API_KEY`) | strict `json_schema` | OpenAI-compatible NIM endpoint; default `openai/gpt-oss-120b`. |
|
|
287
|
+
| `openai` | built-in | `E2E_HEALER_LLM_API_KEY` **or** `OPENAI_API_KEY` | strict `json_schema` (native) | Set `LLM_BASE_URL` for Azure / OpenAI-compatible endpoints. |
|
|
288
|
+
| `anthropic` | `ai-driven-e2e[anthropic]` | `E2E_HEALER_LLM_API_KEY` **or** `ANTHROPIC_API_KEY` | tool-use | No OpenAI `response_format`; schema enforced via Claude tool-use. |
|
|
289
|
+
| `ollama` | `ai-driven-e2e[ollama]` | none (local) | native JSON-schema `format` | Fully offline; smaller models are less reliable at strict JSON. |
|
|
290
|
+
|
|
291
|
+
All providers read the generic `E2E_HEALER_LLM_MODEL` / `E2E_HEALER_LLM_MAX_TOKENS` /
|
|
292
|
+
`E2E_HEALER_LLM_BASE_URL`. On a structured-output parse failure the engine retries
|
|
293
|
+
(tenacity) and then falls back to the Patch Generator feedback loop, so a flaky JSON
|
|
294
|
+
response never crashes the run.
|
|
295
|
+
|
|
296
|
+
### Using OpenAI
|
|
297
|
+
|
|
298
|
+
Set the provider to `openai` and supply a key — either the generic `E2E_HEALER_LLM_API_KEY`
|
|
299
|
+
or an existing standard `OPENAI_API_KEY` (used as a fallback). Patch/review use OpenAI's
|
|
300
|
+
native strict Structured Outputs. Point `E2E_HEALER_LLM_BASE_URL` at an Azure or
|
|
301
|
+
OpenAI-compatible endpoint to override the default.
|
|
302
|
+
|
|
303
|
+
```bash
|
|
304
|
+
E2E_HEALER_LLM_PROVIDER=openai
|
|
305
|
+
OPENAI_API_KEY=sk-... # or E2E_HEALER_LLM_API_KEY=sk-...
|
|
306
|
+
E2E_HEALER_LLM_MODEL=gpt-4o-mini
|
|
307
|
+
```
|
|
308
|
+
|
|
309
|
+
### Using Anthropic (Claude)
|
|
310
|
+
|
|
311
|
+
Anthropic is an **optional** dependency — install the extra so non-Anthropic users don't
|
|
312
|
+
pull it in:
|
|
313
|
+
|
|
314
|
+
```bash
|
|
315
|
+
pip install "ai-driven-e2e[anthropic]" # or: uv sync --extra anthropic
|
|
316
|
+
```
|
|
317
|
+
|
|
318
|
+
Then set the provider and a key — either `E2E_HEALER_LLM_API_KEY` or an existing standard
|
|
319
|
+
`ANTHROPIC_API_KEY` (fallback). Claude has no OpenAI-style `response_format`, so
|
|
320
|
+
`PatchOutput`/`ReviewOutput` are enforced via tool-use.
|
|
321
|
+
|
|
322
|
+
```bash
|
|
323
|
+
E2E_HEALER_LLM_PROVIDER=anthropic
|
|
324
|
+
ANTHROPIC_API_KEY=sk-ant-... # or E2E_HEALER_LLM_API_KEY=sk-ant-...
|
|
325
|
+
E2E_HEALER_LLM_MODEL=claude-sonnet-4-6
|
|
326
|
+
```
|
|
327
|
+
|
|
328
|
+
### Using Ollama (local, offline)
|
|
329
|
+
|
|
330
|
+
Run fully offline with **no API key**. Ollama is an optional dependency:
|
|
331
|
+
|
|
332
|
+
```bash
|
|
333
|
+
pip install "ai-driven-e2e[ollama]" # or: uv sync --extra ollama
|
|
334
|
+
```
|
|
335
|
+
|
|
336
|
+
Start Ollama and pull a model, then point the provider at it. Structured outputs use
|
|
337
|
+
Ollama's **native JSON-schema `format`**, so pick a model that handles structured output
|
|
338
|
+
well — recommended: `llama3.1`, `qwen2.5-coder`, or `mistral-nemo`. Smaller/older models are
|
|
339
|
+
less reliable at strict JSON; on a parse failure the engine retries and falls back to the
|
|
340
|
+
Patch Generator feedback loop.
|
|
341
|
+
|
|
342
|
+
```bash
|
|
343
|
+
E2E_HEALER_LLM_PROVIDER=ollama
|
|
344
|
+
E2E_HEALER_LLM_MODEL=llama3.1
|
|
345
|
+
# E2E_HEALER_LLM_BASE_URL=http://localhost:11434 # default; override for a remote host
|
|
346
|
+
```
|
|
347
|
+
|
|
348
|
+
| Variable | Default | Purpose |
|
|
349
|
+
| ------------------------------ | ------------------------------------- | ---------------------------------------------- |
|
|
350
|
+
| `E2E_HEALER_LLM_PROVIDER` | `nvidia` | LLM backend: `nvidia`, `openai`, `anthropic`, `ollama` |
|
|
351
|
+
| `E2E_HEALER_LLM_API_KEY` | — | API key for the selected provider |
|
|
352
|
+
| `E2E_HEALER_LLM_BASE_URL` | — | OpenAI-compatible endpoint (empty = SDK default) |
|
|
353
|
+
| `E2E_HEALER_LLM_MODEL` | — | Structured-Outputs-capable model |
|
|
354
|
+
| `E2E_HEALER_LLM_MAX_TOKENS` | `4096` | Completion token cap (headroom for reasoning) |
|
|
355
|
+
| `E2E_HEALER_NVIDIA_API_KEY` | — | NVIDIA NIM API key (legacy; maps to `LLM_API_KEY`) |
|
|
356
|
+
| `E2E_HEALER_NVIDIA_BASE_URL` | `https://integrate.api.nvidia.com/v1` | OpenAI-compatible endpoint (legacy) |
|
|
357
|
+
| `E2E_HEALER_NVIDIA_MODEL` | `openai/gpt-oss-120b` | Structured-Outputs-capable model (legacy) |
|
|
358
|
+
| `E2E_HEALER_NVIDIA_MAX_TOKENS` | `4096` | Completion token cap (legacy) |
|
|
359
|
+
| `E2E_HEALER_MAX_LOOPS` | `3` | Repair loop cap |
|
|
360
|
+
| `E2E_HEALER_PLAYWRIGHT_CMD` | `npx playwright test` | Playwright invocation |
|
|
361
|
+
| `E2E_HEALER_VERIFY_SELECTORS` | `true` | Toggle live-DOM selector verification |
|
|
362
|
+
| `E2E_HEALER_APP_URL` | — | URL the Selector Verifier loads (empty = skip) |
|
|
363
|
+
| `E2E_HEALER_NODE_CMD` | `node` | Node executable for the verifier |
|
|
364
|
+
| `E2E_HEALER_SANDBOX_MODE` | `relaxed` | `strict`, `relaxed`, or `off` |
|
|
365
|
+
| `E2E_HEALER_WORKSPACE_ROOT` | `.` | Root for strict path checks |
|
|
366
|
+
| `E2E_HEALER_WRITE_GLOBS` | `*.spec.js,...` | Writable test-file globs |
|
|
367
|
+
| `E2E_HEALER_DENY_GLOBS` | `.env,.git/**,...` | Paths blocked by the sandbox |
|
|
368
|
+
| `E2E_HEALER_ALLOW_TEMP_HELPER` | `true` | Permit selector verifier helper file |
|
|
369
|
+
|
|
370
|
+
> The `--app-url` CLI flag overrides `E2E_HEALER_APP_URL`. To actually run selector
|
|
371
|
+
> verification locally, the Playwright project needs browsers installed
|
|
372
|
+
> (`npm install && npx playwright install`).
|
|
373
|
+
|
|
374
|
+
|
|
375
|
+
## Development
|
|
376
|
+
|
|
377
|
+
```bash
|
|
378
|
+
make install # uv sync --extra dev
|
|
379
|
+
make check # ruff + pyright
|
|
380
|
+
make test # pytest
|
|
381
|
+
```
|
|
382
|
+
|
|
383
|
+
See [`CONTRIBUTING.md`](CONTRIBUTING.md).
|
|
384
|
+
|
|
385
|
+
## Documentation site
|
|
386
|
+
|
|
387
|
+
The `docs-site/` directory contains our [Docusaurus](https://docusaurus.io/) documentation site — this is where frontend contributors can help.
|
|
388
|
+
|
|
389
|
+
To run it locally:
|
|
390
|
+
|
|
391
|
+
```bash
|
|
392
|
+
cd docs-site
|
|
393
|
+
npm install
|
|
394
|
+
npm run start # dev server with hot reload
|
|
395
|
+
npm run build # production build
|
|
396
|
+
```
|
|
397
|
+
|
|
398
|
+
Picking up a docs-site component issue? Read [`docs-site/DESIGN.md`](docs-site/DESIGN.md) first — it's the locked design spec (tokens, layout, dark-mode rules) all components must follow.
|
|
399
|
+
|
|
400
|
+
## Contributing
|
|
401
|
+
|
|
402
|
+
|
|
403
|
+
|
|
404
|
+
Contributions of every size are welcome — bug reports, docs, tests, or code. Start with
|
|
405
|
+
[`CONTRIBUTING.md`](CONTRIBUTING.md), then browse
|
|
406
|
+
[**good first issues**](https://github.com/Lee-Dongwook/E2E-Self-Heal/labels/good%20first%20issue)
|
|
407
|
+
and [**help wanted**](https://github.com/Lee-Dongwook/E2E-Self-Heal/labels/help%20wanted).
|
|
408
|
+
|
|
409
|
+
**🙋 We're actively looking for contributors on:**
|
|
410
|
+
|
|
411
|
+
- [#3 — Build a real React + Vite frontend demo environment](https://github.com/Lee-Dongwook/E2E-Self-Heal/issues/3) for the Playwright examples
|
|
412
|
+
|
|
413
|
+
See the [**v0.3 roadmap**](https://github.com/Lee-Dongwook/E2E-Self-Heal/issues/9) for the
|
|
414
|
+
bigger picture. New to the project? Comment on an issue to claim it — we're happy to help.
|
|
415
|
+
|
|
416
|
+
## Limitations
|
|
417
|
+
|
|
418
|
+
- Fixes selectors and waits only — never assertions or control flow.
|
|
419
|
+
- The JSX/TSX diff analyzer is a regex heuristic in v0.1 (tree-sitter upgrade planned).
|
|
420
|
+
- The Selector Verifier checks the **entry-page state** at `APP_URL` in v1. Elements that
|
|
421
|
+
only appear after clicks/navigation aren't verified here; the Test Runner remains the final
|
|
422
|
+
arbiter (failure-time snapshot capture is planned).
|
|
423
|
+
- Healing quality depends on the LLM and the clarity of the `git diff`.
|
|
424
|
+
|
|
425
|
+
## License
|
|
426
|
+
|
|
427
|
+
[MIT](LICENSE)
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
app/__init__.py,sha256=EY5ang2rikNRuWVQvpBDv7dK5vAYXbem_5-eeYF1bQE,46
|
|
2
|
+
app/cli.py,sha256=gYLCYbR2kzxOnJPx_z4wAdr-ppukUwWPzNGztEuJ0mo,15213
|
|
3
|
+
app/config.py,sha256=0tw4kArq9zvg9Irn5JO8Zc90aGGW3gPRHspyGI8YNdQ,4839
|
|
4
|
+
app/graph.py,sha256=vlWb6myAnSISREcH-MUEQgeTz1ouo4VMx-hukzC11EU,3240
|
|
5
|
+
app/llm.py,sha256=D-22R7v-eUn2En7Ev8kaUMnXoBsMd-xbM2gxnK119Xg,10961
|
|
6
|
+
app/logging.py,sha256=auChLIi7wsFq0Oye42EisGz19dotMUuIE0YhdY-A-_s,767
|
|
7
|
+
app/runner.py,sha256=Ek4LGmWhQtuULmElspU-9Cbj2VF8U7ru-9HXI7uAArw,1091
|
|
8
|
+
app/sandbox.py,sha256=s1CITXeCYb0GTe0l1fzzuSt4C_PgGWs7uCZaU674PYw,4074
|
|
9
|
+
app/schemas.py,sha256=BPAhbolwlrkeCE8eLepfoWERX45DymJ_sOZExKfIxvE,3640
|
|
10
|
+
app/state.py,sha256=YMOjnbCuKbuQVEKo961wNIWPM8m1-Dz1DFt9r8nG0pI,1162
|
|
11
|
+
app/nodes/__init__.py,sha256=yy_HS2ZJdlR1KqqdaKUbJRKkHtkv9ewEM0Y2Zq-8A-I,64
|
|
12
|
+
app/nodes/diagnoser.py,sha256=grIFgIg6dai69CMFKI_PuXFnA2TmSQ_5zdcc4L_hjT0,1058
|
|
13
|
+
app/nodes/patch_generator.py,sha256=xKm2IVzdOttqE79GawXeXdkJZnBOEzxGLLpTTSKl3W0,1740
|
|
14
|
+
app/nodes/reviewer.py,sha256=RKplpGNdOW4-J8QTCIW8YQH6LAutP1L41xJl5LtBNho,1226
|
|
15
|
+
app/nodes/selector_verifier.py,sha256=UhoqHDBAxqXPomsmMbHFwsgeFk5aWUGX8w4Vk3EOsdM,3291
|
|
16
|
+
app/nodes/shadow_verifier.py,sha256=AXhK34FLpwg5KEDUXMqOGvJihWclVr7ClPIccdFDyFk,4179
|
|
17
|
+
app/nodes/test_runner.py,sha256=DT6mRIfTXyw4u7RlX6BzDzQfIKJZiXYnAIGjkb6bnZE,1129
|
|
18
|
+
app/preprocess/__init__.py,sha256=6cN6U7KidQRcvp8jC963ucn--iHRoO7ILhIStoVtH1o,73
|
|
19
|
+
app/preprocess/aria_snapshot.py,sha256=ApegFd1r_HpG_hqLCcNO7_FMDN4H2JZb86-Wt_vTkVw,2636
|
|
20
|
+
app/preprocess/diff_ast_analyzer.py,sha256=RxghKLfoHVJyIJfMlcOElMNn6g8HbCXJUz50GwO__tU,7331
|
|
21
|
+
app/preprocess/error_log_parser.py,sha256=kdltLpo1-uEAhI9sKoot3LDaUaXVpPvqHsL_vNrd22o,2072
|
|
22
|
+
app/preprocess/failure_scanner.py,sha256=vWohHKKxUp5N8auAO88T6MsQdDNsqrUEUb0LR-BDquo,1101
|
|
23
|
+
app/prompts/__init__.py,sha256=DS7TDupdrRTdjCLRoD97uZd9fN7TaCV0nv9gxm2XWZI,42
|
|
24
|
+
app/prompts/diagnoser.py,sha256=fv9Py1ohKRCkQqM_wT4gDSDw-M1eWoqr7sfnAQIqhvI,655
|
|
25
|
+
app/prompts/patch_generator.py,sha256=RKyCTT7YVlN38eN0dCZ42YAmyOCc-TkyIHg2SWFbr7c,1030
|
|
26
|
+
app/prompts/reviewer.py,sha256=qi8hX-ogFDEeW57406qEdwLbg6EeLCAFZVJ-3DOPl3M,1392
|
|
27
|
+
app/shadow/__init__.py,sha256=7vVSWWuIsn-5T05BINQnUwkbxQ85EUTJoUdN6aSa88Y,1771
|
|
28
|
+
app/shadow/config.py,sha256=pBjCJy3o7G7PNgiE7pG7bHSLTl1GHRuSRHnioiG7wMg,1493
|
|
29
|
+
app/shadow/context.py,sha256=Fqy0xltcIq98rBDz6__bCB0Hk-IhA7o1bqmFPgA_Ss0,943
|
|
30
|
+
app/shadow/in_memory_snapshot_store.py,sha256=1zZowcaQ9_BSimdFKORwLAvSAFR2_ysuj9vzNRszDmk,1228
|
|
31
|
+
app/shadow/injector.py,sha256=GIpdIbkuE4O91C9U7YzUjFovZV-OIeAh65fZs8beFgA,5418
|
|
32
|
+
app/shadow/interfaces.py,sha256=YoN5duzUq4dHLeb7qs5K475dlaF6tVo_BafS28QACtg,4053
|
|
33
|
+
app/shadow/matcher.py,sha256=1J2m1KXGAFZG_gfYuEs9vUllO9EDPP2hWt97ZrlD57w,3553
|
|
34
|
+
app/shadow/normalizer.py,sha256=en__ZU5Ovrtmj8IT4H9wnsW5ZXWeJ_6pDVvjzmmov50,3960
|
|
35
|
+
app/shadow/runtime.py,sha256=HcxobEJz6zvIX21uxneWvRLPstYVDdQsvexniH_F0TA,8671
|
|
36
|
+
app/shadow/schemas.py,sha256=liqhR6md6Bsdx_RHbOeSdm3KcXy0qV7zT_EGIPEDczA,1980
|
|
37
|
+
app/shadow/scoring.py,sha256=r-nPUydF48o-h1UDC1Oi6-eOP0A-RZKdxowOZI8Nb1Y,4250
|
|
38
|
+
app/shadow/snapshot_store.py,sha256=eLeJAz-E56XMJVRNngRVSkgchIM5kzJeNhXGQ0DxaUo,3860
|
|
39
|
+
app/shadow/trace_parser.py,sha256=buVFmxd7c56PS7V8qdNueM_eplzGigz4jaKOxSo2Mb8,10831
|
|
40
|
+
app/shadow/workspace.py,sha256=I4qilMXPxqO8iFQ-XzWcDaR78k0o5p7-5Gm4FL7xXQw,3599
|
|
41
|
+
app/utils/__init__.py,sha256=1ECwZzIOxNKr8QUV7Sh1GGfrtpVM5TSzAglZUqO-Hzo,24
|
|
42
|
+
app/utils/files.py,sha256=SgTaxIwAhr7JR_JSETRUhFJYebtm8CXXrl1xtj605cw,712
|
|
43
|
+
app/verify/__init__.py,sha256=oPUHuKmGyUDIBbsV7pictiZWnduRP6fv4hW3jVLBoiE,75
|
|
44
|
+
app/verify/selector_check.py,sha256=8R-kBtgcESjYgi4oHugMA0trWj1afHzHCeQEcE3-ePo,3184
|
|
45
|
+
ai_driven_e2e-0.4.0.dist-info/METADATA,sha256=fsS-tnh_F-X3h5OxT4brafKjNRVZmGJbIJrQTOAM9XE,20918
|
|
46
|
+
ai_driven_e2e-0.4.0.dist-info/WHEEL,sha256=lCkmxWfQsSc9CfIClYeavTdQeEX2toPqufh9gI35EQA,87
|
|
47
|
+
ai_driven_e2e-0.4.0.dist-info/entry_points.txt,sha256=5TrXOainw-NlHUTmry_81dcOmyM3sRds5f64ewcaXnQ,43
|
|
48
|
+
ai_driven_e2e-0.4.0.dist-info/licenses/LICENSE,sha256=F31LeldHBAmMSd07NHlj_uJCMAdGgco4wItSsVxiVcA,1069
|
|
49
|
+
ai_driven_e2e-0.4.0.dist-info/RECORD,,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Lee-Dongwook
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
app/__init__.py
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""AI-driven E2E test self-healing engine."""
|