openspec-playwright 0.3.73 → 0.3.75

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.
Files changed (63) hide show
  1. package/README.md +18 -17
  2. package/README.zh-CN.md +19 -18
  3. package/dist/commands/doctor.d.ts +1 -0
  4. package/dist/commands/doctor.js +54 -23
  5. package/dist/commands/doctor.js.map +1 -1
  6. package/dist/commands/editors/adapters/claude.d.ts +5 -0
  7. package/dist/commands/editors/adapters/claude.js +79 -0
  8. package/dist/commands/editors/adapters/claude.js.map +1 -0
  9. package/dist/commands/editors/adapters/cline.d.ts +15 -0
  10. package/dist/commands/editors/adapters/cline.js +63 -0
  11. package/dist/commands/editors/adapters/cline.js.map +1 -0
  12. package/dist/commands/editors/adapters/cursor.d.ts +15 -0
  13. package/dist/commands/editors/adapters/cursor.js +79 -0
  14. package/dist/commands/editors/adapters/cursor.js.map +1 -0
  15. package/dist/commands/editors/adapters/dsh.d.ts +27 -0
  16. package/dist/commands/editors/adapters/dsh.js +67 -0
  17. package/dist/commands/editors/adapters/dsh.js.map +1 -0
  18. package/dist/commands/editors/adapters/omp.d.ts +24 -0
  19. package/dist/commands/editors/adapters/omp.js +73 -0
  20. package/dist/commands/editors/adapters/omp.js.map +1 -0
  21. package/dist/commands/editors/adapters/opencode.d.ts +8 -0
  22. package/dist/commands/editors/adapters/opencode.js +133 -0
  23. package/dist/commands/editors/adapters/opencode.js.map +1 -0
  24. package/dist/commands/editors/adapters/pi.d.ts +27 -0
  25. package/dist/commands/editors/adapters/pi.js +64 -0
  26. package/dist/commands/editors/adapters/pi.js.map +1 -0
  27. package/dist/commands/editors/project-rules.d.ts +69 -0
  28. package/dist/commands/editors/project-rules.js +246 -0
  29. package/dist/commands/editors/project-rules.js.map +1 -0
  30. package/dist/commands/editors/registry.d.ts +12 -0
  31. package/dist/commands/editors/registry.js +59 -0
  32. package/dist/commands/editors/registry.js.map +1 -0
  33. package/dist/commands/editors/shared.d.ts +37 -0
  34. package/dist/commands/editors/shared.js +92 -0
  35. package/dist/commands/editors/shared.js.map +1 -0
  36. package/dist/commands/editors/tool-selection.d.ts +17 -0
  37. package/dist/commands/editors/tool-selection.js +60 -0
  38. package/dist/commands/editors/tool-selection.js.map +1 -0
  39. package/dist/commands/editors/types.d.ts +82 -0
  40. package/dist/commands/editors/types.js +41 -0
  41. package/dist/commands/editors/types.js.map +1 -0
  42. package/dist/commands/editors.d.ts +32 -309
  43. package/dist/commands/editors.js +38 -960
  44. package/dist/commands/editors.js.map +1 -1
  45. package/dist/commands/explore.d.ts +2 -0
  46. package/dist/commands/explore.js +2 -2
  47. package/dist/commands/explore.js.map +1 -1
  48. package/dist/commands/init.js +15 -25
  49. package/dist/commands/init.js.map +1 -1
  50. package/dist/commands/uninstall.js +4 -2
  51. package/dist/commands/uninstall.js.map +1 -1
  52. package/dist/commands/update.d.ts +8 -0
  53. package/dist/commands/update.js +12 -8
  54. package/dist/commands/update.js.map +1 -1
  55. package/dist/shared/index.d.ts +1 -1
  56. package/dist/shared/index.js +1 -1
  57. package/dist/shared/index.js.map +1 -1
  58. package/dist/shared/mcp.d.ts +5 -2
  59. package/dist/shared/mcp.js +15 -7
  60. package/dist/shared/mcp.js.map +1 -1
  61. package/employee-standards.md +2 -0
  62. package/package.json +5 -5
  63. package/templates/e2e-command.md +6 -2
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "openspec-playwright",
3
- "version": "0.3.73",
3
+ "version": "0.3.75",
4
4
  "description": "OpenSpec + Playwright E2E verification setup tool for Claude Code, OpenCode, Cline, and Cursor",
5
5
  "type": "module",
6
6
  "bin": {
7
7
  "openspec-pw": "bin/openspec-pw.js"
8
8
  },
9
9
  "scripts": {
10
- "build": "rm -rf dist/ && tsc",
10
+ "build": "node -e \"require('fs').rmSync('dist',{recursive:true,force:true})\" && tsc",
11
11
  "typecheck": "tsc --noEmit",
12
12
  "lint": "eslint src/ tests/",
13
13
  "lint:fix": "eslint src/ tests/ --fix",
@@ -22,13 +22,14 @@
22
22
  "dependencies": {
23
23
  "@inquirer/prompts": "^8.5.2",
24
24
  "chalk": "^5.3.0",
25
- "commander": "^12.1.0",
25
+ "commander": "^15.0.0",
26
26
  "glob": "^13.0.6",
27
27
  "jsonc-parser": "^3.3.1",
28
28
  "playwright": "^1.50.0",
29
29
  "tar": "^7.5.16"
30
30
  },
31
31
  "devDependencies": {
32
+ "@playwright/test": "^1.50.0",
32
33
  "@types/glob": "^8.1.0",
33
34
  "@types/node": "^22.0.0",
34
35
  "@types/tar": "^6.1.13",
@@ -38,8 +39,7 @@
38
39
  "eslint": "^10.1.0",
39
40
  "prettier": "^3.8.1",
40
41
  "typescript": "^5.6.0",
41
- "vitest": "^4.1.2",
42
- "@playwright/test": "^1.50.0"
42
+ "vitest": "^4.1.2"
43
43
  },
44
44
  "overrides": {
45
45
  "vite": "^8.0.16",
@@ -24,7 +24,7 @@
24
24
  > **Full regression is opt-in only.** Run `npx playwright test` for one spec file or full suite. Do NOT use `--only-changed` unless the user explicitly requests it.
25
25
  > **Roles**: Planner (Steps 4–5) → test-plan.md; Generator (Step 6) → `.spec.ts` + Page Objects; Healer (Step 9) → repairs failures via MCP.
26
26
 
27
- Browser exploration is tool-agnostic: Playwright MCP or `openspec-pw explore --parallel N`.
27
+ Browser exploration is tool-agnostic: the `playwright-test` MCP server's browser tools or `openspec-pw explore --parallel N`.
28
28
 
29
29
  ## Testing Principles
30
30
 
@@ -252,7 +252,7 @@ When tests fail → **Healer** (3 phases):
252
252
 
253
253
  2-5. **Selector repair**: Pick highest-stability candidate: `getByRole` > `getByText/getByLabel` > `locator('#id')` > `locator('.class')` > `locator('nth-child')`.
254
254
 
255
- 2-6. **Fix + verify**: Apply fix → `npx playwright test --grep "<test-name>"` → if passes, log to app-knowledge.md (Selector Fixes / Assertion Fixes). Max 3 heal attempts per test.
255
+ 2-6. **Fix + verify**: Apply fix → verify via the test-runner MCP tools when available (`test_list` → `test_debug` (pass the test id from `test_list`) → repair → `test_run` with `locations` scoped to the single test file for structured results; fall back to `npx playwright test --grep "<test-name>"` if the playwright-test MCP server is not configured) → if passes, log to app-knowledge.md (Selector Fixes / Assertion Fixes). Max 3 heal attempts per test. **One error per round**: fix a single error, re-run, then address the next.
256
256
 
257
257
  2-7. **Log**: Append healed selector/assertion to `app-knowledge.md`. Auto-de-duplicate by Route + Old Selector (selectors) or Test + Old Assertion (assertions).
258
258
 
@@ -266,6 +266,10 @@ Options: (a) Fix app, (b) Update spec, (c) Update assertion, (d) Skip
266
266
 
267
267
  Wait for user input. Track escalation attempts — if 3 consecutive Phase 3 with no progress, STOP and flag.
268
268
 
269
+ **Healer guardrails** (non-negotiable during autonomous repair; aligned with the official Playwright healer):
270
+ - **One error per round**: fix a single error, re-run (`test_run` or `npx playwright test --grep`), then move to the next. Never batch multiple repairs.
271
+ - **Honest failure exit**: if the test logic is verified correct and the failure persists, the product behavior is wrong — mark the test `test.fixme()` with a comment before the failing step explaining ACTUAL vs EXPECTED behavior. During autonomous repair, **never** loosen assertions, edit expected values, or delete checks to make a failing test pass. (Updating assertions or specs remains a legitimate *human* Phase 3 decision — option (c) below.)
272
+
269
273
  **Post-heal**: After all Phase 2 tests healed, run `npx playwright test --only-changed` as pre-commit guard.
270
274
 
271
275
  ### 10. Report results