openspec-playwright 0.1.29 → 0.1.30

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.
@@ -7,7 +7,7 @@ compatibility: Requires openspec CLI, Playwright (with browsers installed), and
7
7
  **Architecture**: Uses CLI + SKILLs (not `init-agents`). This follows Playwright's recommended approach for coding agents — CLI is more token-efficient than loading MCP tool schemas into context. MCP is used only for Healer (UI inspection on failure).
8
8
  metadata:
9
9
  author: openspec-playwright
10
- version: "2.4"
10
+ version: "2.5"
11
11
  ---
12
12
 
13
13
  ## Input
@@ -194,16 +194,23 @@ If tests fail → analyze failures, use **Playwright MCP tools** to inspect UI s
194
194
  | `browser_run_code` | Execute custom fix logic (optional) |
195
195
 
196
196
  **Healer workflow**:
197
- 1. Read the failing test file identify the broken selector or assertion
198
- 2. Navigate to the target page with `browser_navigate`
199
- 3. Take a `browser_snapshot` — find an equivalent stable selector
200
- 4. Fix the selector in the test file using the Edit tool
201
- 5. Re-run: `openspec-pw run <name>`
202
- 6. Repeat until pass or 3 attempts reached
203
-
204
- **Note**: For selector fixes, prefer `getByRole`, `getByLabel`, `getByText` over CSS paths. For structural issues (wrong page content), update the assertion in the test file.
205
-
206
- **Cap auto-heal attempts at 3** to prevent infinite loops.
197
+ 1. Read the failing test identify failure type by checking error message and console output
198
+ 2. Classify the failure:
199
+
200
+ | Failure type | Signal | Action |
201
+ |-------------|--------|--------|
202
+ | **Network/backend** | `fetch failed`, `net::ERR`, 5xx, timeout | `browser_console_messages` → add `test.skip()` + report "backend error" |
203
+ | **Selector changed** | Element not found, page loaded | `browser_snapshot` → fix selector → re-run |
204
+ | **Assertion mismatch** | Element exists, wrong content/value | `browser_snapshot` compare fix assertion re-run |
205
+ | **Timing issue** | `waitFor` timeout, race condition | Adjust wait strategy → re-run |
206
+
207
+ 3. **Attempt heal** (up to 3 times):
208
+ - Apply fix using `browser_snapshot` (prefer `getByRole`, `getByLabel`, `getByText`)
209
+ - Re-run: `openspec-pw run <name> --project=<role>`
210
+ 4. **After 3 failed attempts**:
211
+ - Use `browser_console_messages` + `browser_snapshot` to confirm root cause
212
+ - If app is clearly broken (e.g., API returns 500, element missing from flow) → add `test.skip()` + report "app bug — needs fix"
213
+ - If unclear → report with recommendation ("likely selector change, verify manually")
207
214
 
208
215
  ### 9. Report results
209
216
 
@@ -267,8 +274,10 @@ Read the report at `openspec/reports/playwright-e2e-<name>-<timestamp>.md`.
267
274
  | test-plan.md exists | Read and use it — never regenerate |
268
275
  | auth.setup.ts exists | Verify format — update only if stale |
269
276
  | playwright.config.ts exists | Read and preserve all fields — add only missing |
270
- | Test fails (selector) | Healer: snapshot fix re-run, cap at 3 attempts |
271
- | Test fails (app bug) | Report as failed with recommendation |
277
+ | Test fails (network/backend) | Skip with `test.skip()` backend/app error, not test fragility |
278
+ | Test fails (selector) | Healer: snapshot fix selector → re-run (≤3 attempts) |
279
+ | Test fails (assertion) | Healer: snapshot → fix assertion → re-run (≤3 attempts) |
280
+ | 3 heal attempts failed | Confirm root cause → if app bug: `test.skip()` + report; if unclear: report with recommendation |
272
281
 
273
282
  ## Verification Heuristics
274
283
 
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openspec-playwright",
3
- "version": "0.1.29",
3
+ "version": "0.1.30",
4
4
  "description": "OpenSpec + Playwright E2E verification setup tool for Claude Code",
5
5
  "type": "module",
6
6
  "bin": {
package/release-notes.md CHANGED
@@ -1,5 +1,5 @@
1
1
  ## What's Changed
2
2
 
3
- - feat: add MCP version sync for Healer tools (init + update)
3
+ - feat(skill): add explicit Healer failure classification (v2.5)
4
4
 
5
- **Full Changelog**: https://github.com/wxhou/openspec-playwright/releases/tag/v0.1.29
5
+ **Full Changelog**: https://github.com/wxhou/openspec-playwright/releases/tag/v0.1.30
Binary file