openspec-playwright 0.1.29 → 0.1.31

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.6"
11
11
  ---
12
12
 
13
13
  ## Input
@@ -194,16 +194,31 @@ 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**, collect evidence:
211
+
212
+ **Evidence checklist** (in order, stop at first match):
213
+ | Check | Signal | Decision |
214
+ |-------|--------|----------|
215
+ | `browser_console_messages` | ERROR-level messages present | App bug → `test.skip()` + report "console error" |
216
+ | `browser_snapshot` | Target element missing from DOM | App bug → `test.skip()` + report "element missing" |
217
+ | `browser_snapshot` | Element exists, no errors | Test bug → report recommendation |
218
+
219
+ - **App bug**: `test.skip('app bug — reason: <signal>')` + detailed report entry
220
+ - **Test bug**: report with "likely selector change, verify manually at file:line"
221
+ - Do NOT retry after evidence checklist — evidence is conclusive
207
222
 
208
223
  ### 9. Report results
209
224
 
@@ -267,8 +282,10 @@ Read the report at `openspec/reports/playwright-e2e-<name>-<timestamp>.md`.
267
282
  | test-plan.md exists | Read and use it — never regenerate |
268
283
  | auth.setup.ts exists | Verify format — update only if stale |
269
284
  | 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 |
285
+ | Test fails (network/backend) | Skip with `test.skip()` backend/app error, not test fragility |
286
+ | Test fails (selector) | Healer: snapshot fix selector → re-run (≤3 attempts) |
287
+ | Test fails (assertion) | Healer: snapshot → fix assertion → re-run (≤3 attempts) |
288
+ | 3 heal attempts failed | Confirm root cause → if app bug: `test.skip()` + report; if unclear: report with recommendation |
272
289
 
273
290
  ## Verification Heuristics
274
291
 
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.31",
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 evidence checklist for Healer skip decision (v2.6)
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.31
Binary file