openspec-playwright 0.2.7 → 0.2.8

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.
@@ -5,7 +5,7 @@ license: MIT
5
5
  compatibility: Requires openspec CLI, Playwright (with browsers installed), and @playwright/mcp (globally installed via `claude mcp add playwright npx @playwright/mcp@latest`).
6
6
  metadata:
7
7
  author: openspec-playwright
8
- version: "2.19"
8
+ version: "2.20"
9
9
  ---
10
10
 
11
11
  ## Input
@@ -210,6 +210,32 @@ browser_navigate → browser_console_messages → browser_snapshot → browser_t
210
210
  | Auth required, no credentials | Missing auth setup | Continue — skip protected routes, explore login page |
211
211
  | Suspicious network request | API returned 4xx/5xx | Continue — mark `⚠️ API error: <endpoint> returned <code>` in app-exploration.md |
212
212
 
213
+ **Redirect / Refresh loop detection** — run after initial navigate:
214
+
215
+ ```
216
+ // 1. Initial capture
217
+ await browser_navigate(`${BASE_URL}/<route>`);
218
+ await new Promise(r => setTimeout(r, 1500)); // wait for SPA hydration
219
+ const url1 = await browser_evaluate(() => window.location.href);
220
+
221
+ // 2. Observe stability
222
+ await new Promise(r => setTimeout(r, 2000));
223
+ const url2 = await browser_evaluate(() => window.location.href);
224
+ const msgs = await browser_console_messages();
225
+
226
+ // 3. Detect
227
+ if (url1 !== url2) {
228
+ → ❌ URL changed — redirect loop (ERR_TOO_MANY_REDIRECTS)
229
+ → Is this route protected without valid auth.storageState?
230
+ → Yes → auth.setup.ts is broken → fix auth first
231
+ → No → App middleware bug → mark route ❌ skip, record as App Bug
232
+ }
233
+ if (msgs.filter(m => m.type === 'warning' || m.type === 'error').length > 10) {
234
+ → ❌ Excessive console errors — page refresh / JS crash loop
235
+ → Mark route ❌ skip, record as App Bug
236
+ }
237
+ ```
238
+
213
239
  **Network monitoring**: After navigating, use `browser_network_requests` to check for failed API calls. Failed requests (status ≥ 400) on a route indicate an API/backend issue — record in `app-exploration.md` for reference.
214
240
 
215
241
  **For guest routes** (no auth):
@@ -665,6 +691,8 @@ Proceed with individual Triage only for tests NOT in a batch failure group.
665
691
  | **Network/Backend** | `net::ERR`, 4xx/5xx in console/network | **App Bug** | `test.skip()` + record in `app-bug-registry.md` |
666
692
  | **JS Runtime Error** | Console error (non-network) | **App Bug** | `test.skip()` + record in `app-bug-registry.md` |
667
693
  | **Auth Expired** | Redirected to login mid-test | **Flaky** | Re-run auth.setup → re-run |
694
+ | **Redirect Loop** | `ERR_TOO_MANY_REDIRECTS`, URL keeps changing on each snapshot | **App Bug** | Check auth first (see Step 4.2 loop detection). If auth is the cause → re-run auth. Otherwise → `test.skip()` + App Bug Registry |
695
+ | **Page Refresh Loop** | Excessive console errors (>10) after navigation, page unstable | **App Bug** | `test.skip()` + record in App Bug Registry |
668
696
  | **Selector Not Found** | Element not found | **Test Bug** | → Phase 2 Healer |
669
697
  | **Assertion Mismatch** | Wrong content/value | **Ambiguous** | → Phase 2 Healer |
670
698
  | **Timeout** | waitFor/evaluate timeout | **Flaky** | Retry isolated: `openspec-pw run <name> --grep "<test-name>"` (1×, not counted in heal attempts). If it passes isolated but fails in suite → **RAFT**. If it consistently times out → check framework: React 19 / Next.js App Router: add `page.waitForLoadState('networkidle')`. Vue/Angular/React 18 / Plain JS / jQuery: use `waitForSelector(targetElement)` instead of timeout tuning. |
@@ -844,7 +872,7 @@ Report template: `.claude/skills/openspec-e2e/templates/report.md`
844
872
  | ------- | ------- |
845
873
  | No specs / app-exploration.md missing (change mode) | **STOP** |
846
874
  | JS errors or HTTP 5xx during exploration | **STOP** → user fixes app → re-run `/opsx:e2e <name>` to re-explore from Step 4 |
847
- | Sitemap fails ("all" mode) | Continue with homepage links fallback |
875
+ | Redirect loop / page refresh loop during exploration | **App Bug** — **STOP** → check auth.setup.ts first (common cause). If auth is valid app middleware/cookie bug → mark route skipped, record in App Bug Registry. Re-run exploration after fix. |
848
876
  | File already exists (app-exploration, test-plan, app-all.spec.ts, Page Objects) | Read and use — never regenerate |
849
877
  | Test fails (network/backend) | **App Bug** — `test.skip()` + record in `app-bug-registry.md` |
850
878
  | Test fails (selector/assertion) | **Test Bug/Ambiguous** — Healer Phase 1→2 (≤3 attempts) |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openspec-playwright",
3
- "version": "0.2.7",
3
+ "version": "0.2.8",
4
4
  "description": "OpenSpec + Playwright E2E verification setup tool for Claude Code",
5
5
  "type": "module",
6
6
  "bin": {