@tea-agent/loop-agent 0.25.5 → 0.26.0

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 (173) hide show
  1. package/AGENTS.md +2 -1
  2. package/CHANGELOG.md +1020 -986
  3. package/bin/loop-agent.js +21 -21
  4. package/dist/commands/cursor-prompt.js +6 -6
  5. package/dist/commands/init.js +68 -129
  6. package/dist/commands/loop-benchmark.js +11 -11
  7. package/dist/commands/pi-reuse-benchmark.js +16 -16
  8. package/dist/executors/dag-pi-executor.js +26 -20
  9. package/dist/executors/model-routing.js +34 -18
  10. package/dist/executors/shell-executor.js +1 -1
  11. package/dist/governance/manifest-types.js +33 -5
  12. package/dist/sidecars/cursor-prompt/executor.js +1 -1
  13. package/dist/task/task-demand-routing.js +3 -1
  14. package/dist/worker/console/chat/model-resolver.js +15 -3
  15. package/dist/worker/observe/static/constants.js +3 -2
  16. package/dist/worker/observe/static/copy.js +67 -67
  17. package/dist/worker/observe/static/dag-layout.d.ts +31 -31
  18. package/dist/worker/observe/static/dag-layout.js +83 -83
  19. package/dist/worker/observe/static/dag-model.js +1 -0
  20. package/dist/worker/observe/static/dom.js +220 -220
  21. package/dist/worker/observe/static/relations.js +133 -133
  22. package/dist/worker/observe/static/router.js +93 -93
  23. package/dist/worker/observe/static/run-processing.js +148 -148
  24. package/dist/worker/observe/static/styles.css +182 -42
  25. package/dist/worker/observe/static/views/batch.js +227 -227
  26. package/dist/worker/observe/static/views/dag-graph.js +172 -172
  27. package/dist/worker/observe/static/views/failures.js +143 -143
  28. package/dist/worker/observe/static/views/feature.js +492 -492
  29. package/dist/worker/observe/static/views/run.js +453 -453
  30. package/dist/worker/observe/static/views/shell.js +7 -7
  31. package/dist/worker/observe/static/views/timeline.js +163 -163
  32. package/dist/workflows/dag/backend-test-case-coverage-analysis.js +362 -45
  33. package/dist/workflows/dag/backend-test-case-manifest.js +20 -0
  34. package/dist/workflows/dag/backend-test-markdown-workflow.js +17 -0
  35. package/dist/workflows/dag/canvas-observer.js +275 -275
  36. package/dist/workflows/dag/init-hybrid.js +18 -15
  37. package/dist/workflows/dag/lifecycle.js +40 -30
  38. package/dist/workflows/dag/node-execution.js +13 -0
  39. package/dist/workflows/dag/types.js +59 -19
  40. package/docs/init-surface.manifest.json +3 -1
  41. package/docs/skills/README.md +7 -7
  42. package/docs/templates/README.md +1 -0
  43. package/docs/templates/adr.md +60 -60
  44. package/docs/templates/agent-dag-authority-surface-audit.prompt.md +94 -94
  45. package/docs/templates/agent-dag-decision-envelope.schema.json +213 -213
  46. package/docs/templates/agent-dag-decision-gate.prompt.md +246 -246
  47. package/docs/templates/agent-dag-process-supervisor.prompt.md +98 -98
  48. package/docs/templates/agent-dag-report.schema.json +473 -473
  49. package/docs/templates/agent-dag-review-verdict.prompt.md +68 -68
  50. package/docs/templates/backend-test-dag.json +9 -9
  51. package/docs/templates/backend-test-result.schema.json +99 -99
  52. package/docs/templates/feature-spec.md +53 -53
  53. package/docs/templates/frontend-design-contract.md +42 -42
  54. package/docs/templates/frontend-eval/fixtures/failures/01-type-build-error.md +17 -17
  55. package/docs/templates/frontend-eval/fixtures/failures/02-unit-component-test-fail.md +16 -16
  56. package/docs/templates/frontend-eval/fixtures/failures/03-fixture-schema-drift.md +16 -16
  57. package/docs/templates/frontend-eval/fixtures/failures/04-missing-loading-empty-error-state.md +16 -16
  58. package/docs/templates/frontend-eval/fixtures/failures/05-forbidden-write-writeset-expansion.md +16 -16
  59. package/docs/templates/frontend-eval/fixtures/failures/06-unapproved-dependency-add.md +16 -16
  60. package/docs/templates/frontend-eval/fixtures/failures/07-mock-production-on.md +21 -21
  61. package/docs/templates/frontend-eval/fixtures/functional/01-simple-component-style.md +29 -29
  62. package/docs/templates/frontend-eval/fixtures/functional/02-form-validation.md +28 -28
  63. package/docs/templates/frontend-eval/fixtures/functional/03-list-detail-page.md +28 -28
  64. package/docs/templates/frontend-eval/fixtures/functional/04-api-mock.md +29 -29
  65. package/docs/templates/frontend-eval/fixtures/functional/05-permission-auth-gated-ui.md +27 -27
  66. package/docs/templates/frontend-eval/fixtures/functional/06-ssr-server-client-boundary.md +28 -28
  67. package/docs/templates/frontend-eval/fixtures/functional/07-shared-public-component-api.md +28 -28
  68. package/docs/templates/frontend-eval/fixtures/functional/08-pure-local-no-remote.md +27 -27
  69. package/docs/templates/frontend-eval/metrics.md +138 -138
  70. package/docs/templates/frontend-eval/smoke-targets.md +53 -53
  71. package/docs/templates/frontend-task-constraints.md +35 -35
  72. package/docs/templates/frontend-task-requirement.md +70 -70
  73. package/docs/templates/harness.schema.json +29 -7
  74. package/docs/templates/init-evolution-review.md +35 -35
  75. package/docs/templates/init-managed-agents.md +137 -0
  76. package/docs/templates/interactive-ui-round2-experiment.md +66 -66
  77. package/docs/templates/knowledge-graph-bootstrap-dag.json +118 -118
  78. package/docs/templates/knowledge-sync-dag.json +178 -178
  79. package/docs/templates/knowledge-sync-draft.schema.json +71 -71
  80. package/docs/templates/product-line/closeout.yaml +9 -9
  81. package/docs/templates/product-line/design.md +13 -13
  82. package/docs/templates/product-line/links.md +10 -10
  83. package/docs/templates/product-line/requirement.md +17 -17
  84. package/docs/templates/product-line/test-plan.md +7 -7
  85. package/docs/templates/production-readiness-checklist.md +57 -57
  86. package/docs/templates/project-start-checklist.md +9 -9
  87. package/docs/templates/qa-report.md +48 -48
  88. package/docs/templates/sprint-contract.md +29 -29
  89. package/docs/templates/worker-dogfood-evidence.md +80 -80
  90. package/docs/templates/worker-dogfood-setup.md +68 -68
  91. package/harness.json +1 -2
  92. package/package.json +1 -1
  93. package/scripts/kb-bootstrap-init-skeleton.sh +0 -0
  94. package/scripts/kb-graph-incremental-prepare.mjs +386 -386
  95. package/scripts/kb-graph-materialize.mjs +105 -105
  96. package/scripts/kb-graph-promote.mjs +164 -164
  97. package/scripts/kb-query.mjs +554 -554
  98. package/skills/ai-engineering-context/SKILL.md +48 -48
  99. package/skills/analyze-product-dependencies/SKILL.md +67 -67
  100. package/skills/analyze-product-dependencies/agents/openai.yaml +4 -4
  101. package/skills/analyze-product-dependencies/references/api-documentation-schema.md +30 -30
  102. package/skills/analyze-product-dependencies/references/dependency-analysis-schema.md +28 -28
  103. package/skills/analyze-product-dependencies/references/example.md +76 -76
  104. package/skills/analyze-product-dependencies/references/forward-test-cases.md +35 -35
  105. package/skills/analyze-product-dependencies/references/input-contract.md +11 -11
  106. package/skills/analyze-product-dependencies/references/scouting-rules.md +61 -61
  107. package/skills/analyze-product-dependencies/scripts/test-validators.mjs +267 -267
  108. package/skills/analyze-product-dependencies/scripts/validate-api-documentation.mjs +101 -101
  109. package/skills/analyze-product-dependencies/scripts/validate-dependency-analysis.mjs +142 -142
  110. package/skills/analyze-product-dependencies/scripts/validate-product-requirement-input.mjs +76 -76
  111. package/skills/analyze-product-dependencies/scripts/validation-helpers.mjs +146 -146
  112. package/skills/analyze-product-requirements/SKILL.md +90 -90
  113. package/skills/analyze-product-requirements/agents/openai.yaml +4 -4
  114. package/skills/analyze-product-requirements/references/acceptance-criteria.md +91 -91
  115. package/skills/analyze-product-requirements/references/clarification-and-knowledge.md +56 -56
  116. package/skills/analyze-product-requirements/references/example.md +86 -86
  117. package/skills/analyze-product-requirements/references/forward-test-cases.md +66 -66
  118. package/skills/analyze-product-requirements/references/product-analysis-schema.md +32 -32
  119. package/skills/analyze-product-requirements/references/product-requirement-schema.md +33 -33
  120. package/skills/analyze-product-requirements/references/requirement-clarification-schema.md +35 -35
  121. package/skills/analyze-product-requirements/scripts/test-validators.mjs +193 -193
  122. package/skills/analyze-product-requirements/scripts/validate-product-analysis.mjs +69 -69
  123. package/skills/analyze-product-requirements/scripts/validate-product-requirement.mjs +97 -97
  124. package/skills/analyze-product-requirements/scripts/validate-requirement-clarification.mjs +98 -98
  125. package/skills/analyze-product-requirements/scripts/validation-helpers.mjs +156 -156
  126. package/skills/browser-tools/browser-content.js +103 -103
  127. package/skills/browser-tools/browser-cookies.js +35 -35
  128. package/skills/browser-tools/browser-eval.js +53 -53
  129. package/skills/browser-tools/browser-hn-scraper.js +108 -108
  130. package/skills/browser-tools/browser-nav.js +44 -44
  131. package/skills/browser-tools/browser-pick.js +162 -162
  132. package/skills/browser-tools/browser-screenshot.js +34 -34
  133. package/skills/browser-tools/browser-start.js +86 -86
  134. package/skills/browser-tools/package-lock.json +2556 -2556
  135. package/skills/browser-tools/package.json +19 -19
  136. package/skills/code-review-core/SKILL.md +20 -20
  137. package/skills/codebase-scout/SKILL.md +19 -19
  138. package/skills/grill-me/SKILL.md +10 -10
  139. package/skills/loop-agent/references/README.md +67 -67
  140. package/skills/loop-agent/references/command-reference.md +5 -4
  141. package/skills/loop-agent/references/docs-converge.md +126 -126
  142. package/skills/loop-agent/references/hybrid-dag.md +2 -2
  143. package/skills/loop-agent/references/learned/README.md +21 -21
  144. package/skills/loop-agent/references/long-running-loop.md +57 -57
  145. package/skills/loop-agent/references/model-routing.md +2 -0
  146. package/skills/loop-agent/references/one-shot-runs.md +85 -85
  147. package/skills/loop-agent/references/pi-prompt.md +23 -23
  148. package/skills/loop-agent/references/pi-subagent-assisted-mode.md +84 -84
  149. package/skills/playwright-cli/SKILL.md +420 -420
  150. package/skills/playwright-cli/references/element-attributes.md +23 -23
  151. package/skills/playwright-cli/references/playwright-tests.md +39 -39
  152. package/skills/playwright-cli/references/request-mocking.md +87 -87
  153. package/skills/playwright-cli/references/running-code.md +241 -241
  154. package/skills/playwright-cli/references/session-management.md +225 -225
  155. package/skills/playwright-cli/references/storage-state.md +275 -275
  156. package/skills/playwright-cli/references/test-generation.md +433 -433
  157. package/skills/playwright-cli/references/tracing.md +139 -139
  158. package/skills/playwright-cli/references/video-recording.md +143 -143
  159. package/skills/requesting-code-review/SKILL.md +101 -101
  160. package/skills/requesting-code-review/code-reviewer.md +168 -168
  161. package/skills/systematic-debugging/CREATION-LOG.md +119 -119
  162. package/skills/systematic-debugging/condition-based-waiting-example.ts +158 -158
  163. package/skills/systematic-debugging/condition-based-waiting.md +115 -115
  164. package/skills/systematic-debugging/defense-in-depth.md +122 -122
  165. package/skills/systematic-debugging/find-polluter.sh +63 -63
  166. package/skills/systematic-debugging/root-cause-tracing.md +169 -169
  167. package/skills/systematic-debugging/test-academic.md +14 -14
  168. package/skills/systematic-debugging/test-pressure-1.md +58 -58
  169. package/skills/systematic-debugging/test-pressure-2.md +68 -68
  170. package/skills/systematic-debugging/test-pressure-3.md +69 -69
  171. package/skills/using-git-worktrees/SKILL.md +215 -215
  172. package/skills/verification-before-completion/SKILL.md +154 -154
  173. package/skills/webapp-testing/SKILL.md +19 -19
@@ -1,433 +1,433 @@
1
- # Test generation (plan → generate → heal)
2
-
3
- End-to-end workflow for authoring and maintaining Playwright tests with `playwright-cli`. Every `playwright-cli` action emits the equivalent Playwright TypeScript, and that generated code is the raw material for every test. The sections below can be used independently:
4
-
5
- - **How generation works** — the core mechanic everything else relies on: actions become TypeScript, plus how to add assertions.
6
- - **Plan** — explore the app, produce a spec file describing what to test.
7
- - **Generate** — turn a spec into Playwright test files. Update the spec if it's vague or stale.
8
- - **Heal** — diagnose failing tests, fix the code, reconcile the spec with reality.
9
-
10
- Plan / generate / heal lean on the same mechanic: run `npx playwright test --debug=cli` in the background, then `playwright-cli attach tw-XXXX` to drive the paused page interactively. See [playwright-tests.md](playwright-tests.md) for the debug/attach mechanics.
11
-
12
- ---
13
-
14
- ## 0. How generation works
15
-
16
- Every action you perform with `playwright-cli` generates corresponding Playwright TypeScript code. This code appears in the output and can be copied directly into your test files.
17
-
18
- ```bash
19
- # Start a session
20
- playwright-cli open https://example.com/login
21
-
22
- # Take a snapshot to see elements
23
- playwright-cli snapshot
24
- # Output shows: e1 [textbox "Email"], e2 [textbox "Password"], e3 [button "Sign In"]
25
-
26
- # Fill form fields - generates code automatically
27
- playwright-cli fill e1 "user@example.com"
28
- # Ran Playwright code:
29
- # await page.getByRole('textbox', { name: 'Email' }).fill('user@example.com');
30
-
31
- playwright-cli fill e2 "password123"
32
- # Ran Playwright code:
33
- # await page.getByRole('textbox', { name: 'Password' }).fill('password123');
34
-
35
- playwright-cli click e3
36
- # Ran Playwright code:
37
- # await page.getByRole('button', { name: 'Sign In' }).click();
38
- ```
39
-
40
- ### Building a test file
41
-
42
- Collect the generated code into a Playwright test:
43
-
44
- ```typescript
45
- import { test, expect } from '@playwright/test';
46
-
47
- test('login flow', async ({ page }) => {
48
- // Generated code from playwright-cli session:
49
- await page.goto('https://example.com/login');
50
- await page.getByRole('textbox', { name: 'Email' }).fill('user@example.com');
51
- await page.getByRole('textbox', { name: 'Password' }).fill('password123');
52
- await page.getByRole('button', { name: 'Sign In' }).click();
53
-
54
- // Add assertions
55
- await expect(page).toHaveURL(/.*dashboard/);
56
- });
57
- ```
58
-
59
- ### Use semantic locators
60
-
61
- The generated code uses role-based locators when possible, which are more resilient:
62
-
63
- ```typescript
64
- // Generated (good - semantic)
65
- await page.getByRole('button', { name: 'Submit' }).click();
66
-
67
- // Avoid (fragile - CSS selectors)
68
- await page.locator('#submit-btn').click();
69
- ```
70
-
71
- ### Explore before recording
72
-
73
- Take snapshots to understand the page structure before recording actions:
74
-
75
- ```bash
76
- playwright-cli open https://example.com
77
- playwright-cli snapshot
78
- # Review the element structure
79
- playwright-cli click e5
80
- ```
81
-
82
- ### Add assertions manually
83
-
84
- Generated code captures actions but not assertions. Add expectations in your test using one of the recommended matchers:
85
-
86
- - `toBeVisible()` — element is rendered and visible
87
- - `toHaveText(text)` — element text content matches
88
- - `toHaveValue(value) / toBeEmpty()` — input/select value matches
89
- - `toBeChecked() / toBeUnchecked()` — checkbox state matches
90
- - `toMatchAriaSnapshot(snapshot)` — page (or locator) matches a partial accessibility snapshot
91
-
92
- Use `playwright-cli generate-locator <target>` to produce the locator expression for the assertion, and the snapshot/eval commands to capture the expected value.
93
-
94
- When asserting text content, make sure that generated locator does not contain text from the element itself. `getByTestId()` or `getByLabel()` usually work well with asserting text. When locator is text-based, prefer `toBeVisible()` instead.
95
-
96
- Snapshot to be matched does not have to contain all the information - only capture what's necessary for the assertion. You can use regular expressions for unstable values.
97
-
98
- ```bash
99
- # Get a stable locator for an element ref to use in the assertion
100
- playwright-cli --raw generate-locator e5
101
- # getByRole('button', { name: 'Submit' })
102
-
103
- # Capture expected text content for toHaveText
104
- playwright-cli --raw eval "el => el.textContent" e5
105
-
106
- # Capture expected input value for toHaveValue/toBeEmpty
107
- playwright-cli --raw eval "el => el.value" e5
108
-
109
- # Capture expected aria snapshot for toMatchAriaSnapshot/toBeChecked
110
- # (whole page, or use a ref to scope to a region)
111
- playwright-cli --raw snapshot
112
- playwright-cli --raw snapshot e5
113
- ```
114
-
115
- ```typescript
116
- // Generated action
117
- await page.getByRole('button', { name: 'Submit' }).click();
118
-
119
- // Manual assertions using the outputs above:
120
- await expect(page.getByRole('alert', { name: 'Success' })).toBeVisible();
121
- await expect(page.getByTestId('main-header')).toHaveText('Welcome, user');
122
- await expect(page.getByRole('textbox', { name: 'Email' })).toHaveValue('user@example.com');
123
- await expect(page.getByRole('checkbox', { name: 'Enable notifications' })).toBeChecked();
124
-
125
- // toMatchAriaSnapshot on the whole page, finds a matching region
126
- await expect(page).toMatchAriaSnapshot(`
127
- - heading "Welcome, user"
128
- - link /\\d+ new messages?/
129
- - button "Sign out"
130
- `);
131
-
132
- // toMatchAriaSnapshot scoped to a region
133
- await expect(page.getByRole('navigation')).toMatchAriaSnapshot(`
134
- - link "Home"
135
- - link /\\d+ new messages?/
136
- - link "Profile"
137
- `);
138
- ```
139
-
140
- ---
141
-
142
- ## 1. Planning
143
-
144
- Goal: produce a spec file (e.g. `specs/<feature>.plan.md`) that enumerates the scenarios to test. **Always** write the spec to a file.
145
-
146
- ### 1.1 Prerequisite: workspace
147
-
148
- Check the workspace has Playwright installed before anything else:
149
-
150
- ```bash
151
- # Either of these confirms a workspace:
152
- test -f playwright.config.ts || test -f playwright.config.js
153
- npx --no-install playwright --version
154
- ```
155
-
156
- If there is no Playwright install, bootstrap one and let the user pick the defaults:
157
-
158
- ```bash
159
- npm init playwright@latest
160
- ```
161
-
162
- ### 1.2 Prerequisite: seed test
163
-
164
- A **seed test** is a minimal test that lands the page in the state every scenario starts from: navigation to the app, any required login, feature flags, etc. Scenarios assume a fresh start *after* the seed. `--debug=cli` pauses *inside* this test, so the seed is where every planning and generation session begins.
165
-
166
- Minimum viable seed:
167
-
168
- ```ts
169
- // tests/seed.spec.ts
170
- import { test } from '@playwright/test';
171
-
172
- test('seed', async ({ page }) => {
173
- await page.goto('https://example.com/');
174
- });
175
- ```
176
-
177
- Preferred — push navigation into a fixture so scenario tests reuse it:
178
-
179
- ```ts
180
- // tests/fixtures.ts
181
- import { test as baseTest } from '@playwright/test';
182
- export { expect } from '@playwright/test';
183
-
184
- export const test = baseTest.extend({
185
- page: async ({ page }, use) => {
186
- await page.goto('https://example.com/');
187
- await use(page);
188
- },
189
- });
190
- ```
191
-
192
- ```ts
193
- // tests/seed.spec.ts
194
- import { test } from './fixtures';
195
-
196
- test('seed', async ({ page }) => {
197
- // Fixture already navigates. This empty body tells agents where to start.
198
- });
199
- ```
200
-
201
- If no seed exists, create one that at least navigates to the app.
202
-
203
- ### 1.3 Explore the app
204
-
205
- Launch the app via the seed in the background and attach:
206
-
207
- ```bash
208
- PLAYWRIGHT_HTML_OPEN=never npx playwright test tests/seed.spec.ts --debug=cli
209
- # wait for "Debugging Instructions" and the session name tw-XXXX
210
- playwright-cli attach tw-XXXX
211
- ```
212
-
213
- Resume so the seed runs, then probe the app:
214
-
215
- ```bash
216
- playwright-cli resume # resume so that seed test runs fully
217
- playwright-cli snapshot # inventory of interactive elements
218
- playwright-cli click e5 # follow a flow
219
- playwright-cli eval "location.href" # read URL / state
220
- playwright-cli show --annotate # ask the user to point at something
221
- ```
222
-
223
- Map out:
224
-
225
- - Interactive surfaces (forms, buttons, lists, filters, modals).
226
- - Primary user journeys end-to-end.
227
- - Edge cases: empty states, validation errors, very long input, boundary values.
228
- - Persistence: reload, local/session storage, URL fragments.
229
- - Navigation: which controls change the URL, back/forward behaviour.
230
-
231
- **Important**: Do not just open the app url with playwright-cli, always go through the test to capture any custom setup done there.
232
- **Important**: Stop the background test when done exploring.
233
-
234
- ### 1.4 Write the spec file
235
-
236
- Save under `specs/<feature>.plan.md`. Use this structure:
237
-
238
- ```markdown
239
- # <Feature> Test Plan
240
-
241
- ## Application Overview
242
-
243
- <One paragraph describing what the feature does and why it matters.>
244
-
245
- ## Test Scenarios
246
-
247
- ### 1. <Group Name>
248
-
249
- **Seed:** `tests/seed.spec.ts`
250
-
251
- #### 1.1. <kebab-case-scenario-name>
252
-
253
- **File:** `tests/<group>/<kebab-case-scenario-name>.spec.ts`
254
-
255
- **Steps:**
256
- 1. <Concrete user step>
257
- - expect: <observable outcome>
258
- - expect: <another observable outcome>
259
- 2. <Next step>
260
- - expect: <outcome>
261
-
262
- #### 1.2. <next-scenario>
263
- ...
264
-
265
- ### 2. <Next Group>
266
-
267
- **Seed:** `tests/seed.spec.ts`
268
- ...
269
- ```
270
-
271
- Guidelines:
272
-
273
- - Each scenario is independent and starts from the seed's fresh state — never chain scenarios.
274
- - Scenario names are kebab-case and match the test file name (`should-add-single-todo` → `should-add-single-todo.spec.ts`).
275
- - Cover happy path, edge cases, validation, negative flows, persistence.
276
- - Write steps at the user level ("Type 'Buy milk' into the input"), not the API level ("call `fill`").
277
- - Put observable outcomes in `- expect:` bullets; each becomes an assertion during generation.
278
-
279
- ---
280
-
281
- ## 2. Generate
282
-
283
- Goal: take a spec file and produce Playwright test files. Optionally update the spec if it has drifted.
284
-
285
- ### 2.1 Inputs
286
-
287
- - **Spec file**, e.g. `specs/basic-operations.plan.md`.
288
- - **Target**: either a single scenario (e.g. `1.2`), a whole group (`1`), or all.
289
- - **Seed file**, read from the `**Seed:**` line of the scenario's group.
290
-
291
- ### 2.2 Generate one scenario
292
-
293
- For each target scenario, in sequence (never in parallel — scenarios share the seed session):
294
-
295
- ```bash
296
- PLAYWRIGHT_HTML_OPEN=never npx playwright test <seed-file> --debug=cli # background
297
- playwright-cli attach tw-XXXX
298
- # resume
299
- ```
300
-
301
- **Do not** just open the app url with playwright-cli, always go through the test to capture any custom setup done there.
302
-
303
- Walk the scenario's `Steps:` one by one with `playwright-cli`, treating the spec as the plan and the live app as the source of truth. If a step is vague ("click the button" — which button?), references an element that no longer exists, or contradicts the app's actual behaviour, use your judgement: update the spec to match what the app really does, then keep going. Editing the spec mid-generation is expected.
304
-
305
- Every action prints the equivalent Playwright TypeScript (see [How generation works](#0-how-generation-works)):
306
-
307
- ```bash
308
- playwright-cli snapshot # find refs
309
- playwright-cli fill e3 "John Doe" # -> page.getByRole('textbox', {...}).fill(...)
310
- playwright-cli press Enter
311
- playwright-cli click e7
312
- ```
313
-
314
- For each `- expect:` bullet, add an explicit assertion. See [How generation works](#0-how-generation-works) for details.
315
-
316
- Collect the generated code and write the test file at the path given in the spec:
317
-
318
- ```ts
319
- // spec: specs/basic-operations.plan.md
320
- // seed: tests/seed.spec.ts
321
- import { test, expect } from './fixtures'; // or '@playwright/test' if no fixtures file
322
-
323
- test.describe('Signing in and out', () => {
324
- test('should sign in', async ({ page }) => {
325
- // 1. Navigate to the application
326
- // (handled by the seed fixture)
327
-
328
- // 2. Type 'John Doe' into the username field
329
- await page.getByRole('textbox', { name: 'username' }).fill('John Doe');
330
-
331
- // 3. Type password
332
- await page.getByRole('textbox', { name: 'password' }).fill('TestPassword');
333
-
334
- // 4. Press Enter to submit
335
- await page.getByRole('textbox', { name: 'password' }).press('Enter');
336
-
337
- await expect(page.getByRole('heading')).toContainText('Welcome, John Doe!');
338
- });
339
- });
340
- ```
341
-
342
- Rules:
343
-
344
- - **One test per file.** File path, describe name, and test name come verbatim from the spec (minus the ordinal).
345
- - Prefix each numbered step with a `// N. <step text>` comment before its actions.
346
- - Use the describe group name verbatim from the spec (no `1.` ordinal).
347
- - Import from `./fixtures` if the project has one; otherwise `@playwright/test`.
348
- - **Important**: close the CLI session and stop the background test before moving to the next scenario.
349
-
350
- ### 2.3 Generate multiple scenarios
351
-
352
- Loop 2.2 over the targeted scenarios one at a time, restarting the seed between each so every test starts from a clean page. This is safe to parallelise due to unique generated session names - just make sure each test run is stopped.
353
-
354
- ### 2.4 Run generated tests
355
-
356
- After generation, run the new tests once:
357
-
358
- ```bash
359
- PLAYWRIGHT_HTML_OPEN=never npx playwright test tests/<group>/<scenario>.spec.ts
360
- ```
361
-
362
- Any failure goes to Section 3.
363
-
364
- ---
365
-
366
- ## 3. Heal
367
-
368
- Goal: fix failing tests, and update the spec if the app's intended behaviour changed.
369
-
370
- ### 3.1 Find failing tests
371
-
372
- ```bash
373
- PLAYWRIGHT_HTML_OPEN=never npx playwright test
374
- ```
375
-
376
- Record the list of failing `<file>:<line>` entries and process them one at a time. Do not attempt parallel fixes — shared state and the single CLI session make that fragile.
377
-
378
- ### 3.2 Debug one failure
379
-
380
- Run the single failing test in debug mode in the background, then attach:
381
-
382
- ```bash
383
- PLAYWRIGHT_HTML_OPEN=never npx playwright test tests/<group>/<scenario>.spec.ts:<line> --debug=cli
384
- # wait for "Debugging Instructions" and the tw-XXXX session name
385
- playwright-cli attach tw-XXXX
386
- ```
387
-
388
- The test is paused at the start. Step forward or run to until just before the failing action or assertion, then diagnose:
389
-
390
- ```bash
391
- playwright-cli snapshot # did the element change / move / rename?
392
- playwright-cli console # app-side errors?
393
- playwright-cli requests # failed request? wrong payload?
394
- playwright-cli show --annotate # ask the user to point somewhere
395
- ```
396
-
397
- Common causes: selector drift, new wrapper element, label/ARIA rename, timing (transition, async load), assertion text updated in the app, test data leaking between runs.
398
-
399
- Rehearse the corrected interaction with `playwright-cli` — the generated code in the output is what you paste back into the test.
400
-
401
- ### 3.3 Apply the fix
402
-
403
- Edit the test file: update the locator, assertion, step order, or inputs to match the corrected behaviour. Stop the background debug run. Rerun the single test to confirm green.
404
-
405
- Never skip hooks or add sleeps as a fix. Never use `networkidle`.
406
-
407
- ### 3.4 Reconcile with the spec
408
-
409
- Open the spec referenced by the `// spec:` header in the test file and locate the scenario that matches the test.
410
-
411
- - **Fix was purely technical** (locator drift, better assertion shape) and the spec's user-level behaviour still matches the app → leave the spec alone.
412
- - **Fix changed user-visible steps, inputs, order, or expected outcomes** that the spec describes → update the spec to match reality. Keep the scenario id and file path stable; only the step / expect lines change.
413
- - **Unclear whether the app change is intentional** (spec is stale) **or a regression** (test was right, app is wrong) → **stop and ask the user**. Provide:
414
- - the scenario id (e.g. `2.3`),
415
- - the spec lines that no longer match,
416
- - the observed app behaviour (quote a snapshot excerpt or a concrete outcome).
417
-
418
- Only after the user answers, either update the spec (intentional change) or file/flag the test as covering a bug (regression).
419
-
420
- ### 3.5 Iteration and giving up
421
-
422
- - Fix failures one at a time; rerun after each.
423
- - If after thorough investigation you are confident the test is correct but the app is wrong *and* the user has confirmed it's a bug: mark the test `test.fixme(...)` with a comment pointing at the user's decision or issue link. Never silently skip.
424
-
425
- ---
426
-
427
- ## Cross-references
428
-
429
- | For... | See |
430
- |---|---|
431
- | `--debug=cli` / attach mechanics | [playwright-tests.md](playwright-tests.md) |
432
- | Mocking requests during exploration/generation | [request-mocking.md](request-mocking.md) |
433
- | Managing the CLI browser session | [session-management.md](session-management.md) |
1
+ # Test generation (plan → generate → heal)
2
+
3
+ End-to-end workflow for authoring and maintaining Playwright tests with `playwright-cli`. Every `playwright-cli` action emits the equivalent Playwright TypeScript, and that generated code is the raw material for every test. The sections below can be used independently:
4
+
5
+ - **How generation works** — the core mechanic everything else relies on: actions become TypeScript, plus how to add assertions.
6
+ - **Plan** — explore the app, produce a spec file describing what to test.
7
+ - **Generate** — turn a spec into Playwright test files. Update the spec if it's vague or stale.
8
+ - **Heal** — diagnose failing tests, fix the code, reconcile the spec with reality.
9
+
10
+ Plan / generate / heal lean on the same mechanic: run `npx playwright test --debug=cli` in the background, then `playwright-cli attach tw-XXXX` to drive the paused page interactively. See [playwright-tests.md](playwright-tests.md) for the debug/attach mechanics.
11
+
12
+ ---
13
+
14
+ ## 0. How generation works
15
+
16
+ Every action you perform with `playwright-cli` generates corresponding Playwright TypeScript code. This code appears in the output and can be copied directly into your test files.
17
+
18
+ ```bash
19
+ # Start a session
20
+ playwright-cli open https://example.com/login
21
+
22
+ # Take a snapshot to see elements
23
+ playwright-cli snapshot
24
+ # Output shows: e1 [textbox "Email"], e2 [textbox "Password"], e3 [button "Sign In"]
25
+
26
+ # Fill form fields - generates code automatically
27
+ playwright-cli fill e1 "user@example.com"
28
+ # Ran Playwright code:
29
+ # await page.getByRole('textbox', { name: 'Email' }).fill('user@example.com');
30
+
31
+ playwright-cli fill e2 "password123"
32
+ # Ran Playwright code:
33
+ # await page.getByRole('textbox', { name: 'Password' }).fill('password123');
34
+
35
+ playwright-cli click e3
36
+ # Ran Playwright code:
37
+ # await page.getByRole('button', { name: 'Sign In' }).click();
38
+ ```
39
+
40
+ ### Building a test file
41
+
42
+ Collect the generated code into a Playwright test:
43
+
44
+ ```typescript
45
+ import { test, expect } from '@playwright/test';
46
+
47
+ test('login flow', async ({ page }) => {
48
+ // Generated code from playwright-cli session:
49
+ await page.goto('https://example.com/login');
50
+ await page.getByRole('textbox', { name: 'Email' }).fill('user@example.com');
51
+ await page.getByRole('textbox', { name: 'Password' }).fill('password123');
52
+ await page.getByRole('button', { name: 'Sign In' }).click();
53
+
54
+ // Add assertions
55
+ await expect(page).toHaveURL(/.*dashboard/);
56
+ });
57
+ ```
58
+
59
+ ### Use semantic locators
60
+
61
+ The generated code uses role-based locators when possible, which are more resilient:
62
+
63
+ ```typescript
64
+ // Generated (good - semantic)
65
+ await page.getByRole('button', { name: 'Submit' }).click();
66
+
67
+ // Avoid (fragile - CSS selectors)
68
+ await page.locator('#submit-btn').click();
69
+ ```
70
+
71
+ ### Explore before recording
72
+
73
+ Take snapshots to understand the page structure before recording actions:
74
+
75
+ ```bash
76
+ playwright-cli open https://example.com
77
+ playwright-cli snapshot
78
+ # Review the element structure
79
+ playwright-cli click e5
80
+ ```
81
+
82
+ ### Add assertions manually
83
+
84
+ Generated code captures actions but not assertions. Add expectations in your test using one of the recommended matchers:
85
+
86
+ - `toBeVisible()` — element is rendered and visible
87
+ - `toHaveText(text)` — element text content matches
88
+ - `toHaveValue(value) / toBeEmpty()` — input/select value matches
89
+ - `toBeChecked() / toBeUnchecked()` — checkbox state matches
90
+ - `toMatchAriaSnapshot(snapshot)` — page (or locator) matches a partial accessibility snapshot
91
+
92
+ Use `playwright-cli generate-locator <target>` to produce the locator expression for the assertion, and the snapshot/eval commands to capture the expected value.
93
+
94
+ When asserting text content, make sure that generated locator does not contain text from the element itself. `getByTestId()` or `getByLabel()` usually work well with asserting text. When locator is text-based, prefer `toBeVisible()` instead.
95
+
96
+ Snapshot to be matched does not have to contain all the information - only capture what's necessary for the assertion. You can use regular expressions for unstable values.
97
+
98
+ ```bash
99
+ # Get a stable locator for an element ref to use in the assertion
100
+ playwright-cli --raw generate-locator e5
101
+ # getByRole('button', { name: 'Submit' })
102
+
103
+ # Capture expected text content for toHaveText
104
+ playwright-cli --raw eval "el => el.textContent" e5
105
+
106
+ # Capture expected input value for toHaveValue/toBeEmpty
107
+ playwright-cli --raw eval "el => el.value" e5
108
+
109
+ # Capture expected aria snapshot for toMatchAriaSnapshot/toBeChecked
110
+ # (whole page, or use a ref to scope to a region)
111
+ playwright-cli --raw snapshot
112
+ playwright-cli --raw snapshot e5
113
+ ```
114
+
115
+ ```typescript
116
+ // Generated action
117
+ await page.getByRole('button', { name: 'Submit' }).click();
118
+
119
+ // Manual assertions using the outputs above:
120
+ await expect(page.getByRole('alert', { name: 'Success' })).toBeVisible();
121
+ await expect(page.getByTestId('main-header')).toHaveText('Welcome, user');
122
+ await expect(page.getByRole('textbox', { name: 'Email' })).toHaveValue('user@example.com');
123
+ await expect(page.getByRole('checkbox', { name: 'Enable notifications' })).toBeChecked();
124
+
125
+ // toMatchAriaSnapshot on the whole page, finds a matching region
126
+ await expect(page).toMatchAriaSnapshot(`
127
+ - heading "Welcome, user"
128
+ - link /\\d+ new messages?/
129
+ - button "Sign out"
130
+ `);
131
+
132
+ // toMatchAriaSnapshot scoped to a region
133
+ await expect(page.getByRole('navigation')).toMatchAriaSnapshot(`
134
+ - link "Home"
135
+ - link /\\d+ new messages?/
136
+ - link "Profile"
137
+ `);
138
+ ```
139
+
140
+ ---
141
+
142
+ ## 1. Planning
143
+
144
+ Goal: produce a spec file (e.g. `specs/<feature>.plan.md`) that enumerates the scenarios to test. **Always** write the spec to a file.
145
+
146
+ ### 1.1 Prerequisite: workspace
147
+
148
+ Check the workspace has Playwright installed before anything else:
149
+
150
+ ```bash
151
+ # Either of these confirms a workspace:
152
+ test -f playwright.config.ts || test -f playwright.config.js
153
+ npx --no-install playwright --version
154
+ ```
155
+
156
+ If there is no Playwright install, bootstrap one and let the user pick the defaults:
157
+
158
+ ```bash
159
+ npm init playwright@latest
160
+ ```
161
+
162
+ ### 1.2 Prerequisite: seed test
163
+
164
+ A **seed test** is a minimal test that lands the page in the state every scenario starts from: navigation to the app, any required login, feature flags, etc. Scenarios assume a fresh start *after* the seed. `--debug=cli` pauses *inside* this test, so the seed is where every planning and generation session begins.
165
+
166
+ Minimum viable seed:
167
+
168
+ ```ts
169
+ // tests/seed.spec.ts
170
+ import { test } from '@playwright/test';
171
+
172
+ test('seed', async ({ page }) => {
173
+ await page.goto('https://example.com/');
174
+ });
175
+ ```
176
+
177
+ Preferred — push navigation into a fixture so scenario tests reuse it:
178
+
179
+ ```ts
180
+ // tests/fixtures.ts
181
+ import { test as baseTest } from '@playwright/test';
182
+ export { expect } from '@playwright/test';
183
+
184
+ export const test = baseTest.extend({
185
+ page: async ({ page }, use) => {
186
+ await page.goto('https://example.com/');
187
+ await use(page);
188
+ },
189
+ });
190
+ ```
191
+
192
+ ```ts
193
+ // tests/seed.spec.ts
194
+ import { test } from './fixtures';
195
+
196
+ test('seed', async ({ page }) => {
197
+ // Fixture already navigates. This empty body tells agents where to start.
198
+ });
199
+ ```
200
+
201
+ If no seed exists, create one that at least navigates to the app.
202
+
203
+ ### 1.3 Explore the app
204
+
205
+ Launch the app via the seed in the background and attach:
206
+
207
+ ```bash
208
+ PLAYWRIGHT_HTML_OPEN=never npx playwright test tests/seed.spec.ts --debug=cli
209
+ # wait for "Debugging Instructions" and the session name tw-XXXX
210
+ playwright-cli attach tw-XXXX
211
+ ```
212
+
213
+ Resume so the seed runs, then probe the app:
214
+
215
+ ```bash
216
+ playwright-cli resume # resume so that seed test runs fully
217
+ playwright-cli snapshot # inventory of interactive elements
218
+ playwright-cli click e5 # follow a flow
219
+ playwright-cli eval "location.href" # read URL / state
220
+ playwright-cli show --annotate # ask the user to point at something
221
+ ```
222
+
223
+ Map out:
224
+
225
+ - Interactive surfaces (forms, buttons, lists, filters, modals).
226
+ - Primary user journeys end-to-end.
227
+ - Edge cases: empty states, validation errors, very long input, boundary values.
228
+ - Persistence: reload, local/session storage, URL fragments.
229
+ - Navigation: which controls change the URL, back/forward behaviour.
230
+
231
+ **Important**: Do not just open the app url with playwright-cli, always go through the test to capture any custom setup done there.
232
+ **Important**: Stop the background test when done exploring.
233
+
234
+ ### 1.4 Write the spec file
235
+
236
+ Save under `specs/<feature>.plan.md`. Use this structure:
237
+
238
+ ```markdown
239
+ # <Feature> Test Plan
240
+
241
+ ## Application Overview
242
+
243
+ <One paragraph describing what the feature does and why it matters.>
244
+
245
+ ## Test Scenarios
246
+
247
+ ### 1. <Group Name>
248
+
249
+ **Seed:** `tests/seed.spec.ts`
250
+
251
+ #### 1.1. <kebab-case-scenario-name>
252
+
253
+ **File:** `tests/<group>/<kebab-case-scenario-name>.spec.ts`
254
+
255
+ **Steps:**
256
+ 1. <Concrete user step>
257
+ - expect: <observable outcome>
258
+ - expect: <another observable outcome>
259
+ 2. <Next step>
260
+ - expect: <outcome>
261
+
262
+ #### 1.2. <next-scenario>
263
+ ...
264
+
265
+ ### 2. <Next Group>
266
+
267
+ **Seed:** `tests/seed.spec.ts`
268
+ ...
269
+ ```
270
+
271
+ Guidelines:
272
+
273
+ - Each scenario is independent and starts from the seed's fresh state — never chain scenarios.
274
+ - Scenario names are kebab-case and match the test file name (`should-add-single-todo` → `should-add-single-todo.spec.ts`).
275
+ - Cover happy path, edge cases, validation, negative flows, persistence.
276
+ - Write steps at the user level ("Type 'Buy milk' into the input"), not the API level ("call `fill`").
277
+ - Put observable outcomes in `- expect:` bullets; each becomes an assertion during generation.
278
+
279
+ ---
280
+
281
+ ## 2. Generate
282
+
283
+ Goal: take a spec file and produce Playwright test files. Optionally update the spec if it has drifted.
284
+
285
+ ### 2.1 Inputs
286
+
287
+ - **Spec file**, e.g. `specs/basic-operations.plan.md`.
288
+ - **Target**: either a single scenario (e.g. `1.2`), a whole group (`1`), or all.
289
+ - **Seed file**, read from the `**Seed:**` line of the scenario's group.
290
+
291
+ ### 2.2 Generate one scenario
292
+
293
+ For each target scenario, in sequence (never in parallel — scenarios share the seed session):
294
+
295
+ ```bash
296
+ PLAYWRIGHT_HTML_OPEN=never npx playwright test <seed-file> --debug=cli # background
297
+ playwright-cli attach tw-XXXX
298
+ # resume
299
+ ```
300
+
301
+ **Do not** just open the app url with playwright-cli, always go through the test to capture any custom setup done there.
302
+
303
+ Walk the scenario's `Steps:` one by one with `playwright-cli`, treating the spec as the plan and the live app as the source of truth. If a step is vague ("click the button" — which button?), references an element that no longer exists, or contradicts the app's actual behaviour, use your judgement: update the spec to match what the app really does, then keep going. Editing the spec mid-generation is expected.
304
+
305
+ Every action prints the equivalent Playwright TypeScript (see [How generation works](#0-how-generation-works)):
306
+
307
+ ```bash
308
+ playwright-cli snapshot # find refs
309
+ playwright-cli fill e3 "John Doe" # -> page.getByRole('textbox', {...}).fill(...)
310
+ playwright-cli press Enter
311
+ playwright-cli click e7
312
+ ```
313
+
314
+ For each `- expect:` bullet, add an explicit assertion. See [How generation works](#0-how-generation-works) for details.
315
+
316
+ Collect the generated code and write the test file at the path given in the spec:
317
+
318
+ ```ts
319
+ // spec: specs/basic-operations.plan.md
320
+ // seed: tests/seed.spec.ts
321
+ import { test, expect } from './fixtures'; // or '@playwright/test' if no fixtures file
322
+
323
+ test.describe('Signing in and out', () => {
324
+ test('should sign in', async ({ page }) => {
325
+ // 1. Navigate to the application
326
+ // (handled by the seed fixture)
327
+
328
+ // 2. Type 'John Doe' into the username field
329
+ await page.getByRole('textbox', { name: 'username' }).fill('John Doe');
330
+
331
+ // 3. Type password
332
+ await page.getByRole('textbox', { name: 'password' }).fill('TestPassword');
333
+
334
+ // 4. Press Enter to submit
335
+ await page.getByRole('textbox', { name: 'password' }).press('Enter');
336
+
337
+ await expect(page.getByRole('heading')).toContainText('Welcome, John Doe!');
338
+ });
339
+ });
340
+ ```
341
+
342
+ Rules:
343
+
344
+ - **One test per file.** File path, describe name, and test name come verbatim from the spec (minus the ordinal).
345
+ - Prefix each numbered step with a `// N. <step text>` comment before its actions.
346
+ - Use the describe group name verbatim from the spec (no `1.` ordinal).
347
+ - Import from `./fixtures` if the project has one; otherwise `@playwright/test`.
348
+ - **Important**: close the CLI session and stop the background test before moving to the next scenario.
349
+
350
+ ### 2.3 Generate multiple scenarios
351
+
352
+ Loop 2.2 over the targeted scenarios one at a time, restarting the seed between each so every test starts from a clean page. This is safe to parallelise due to unique generated session names - just make sure each test run is stopped.
353
+
354
+ ### 2.4 Run generated tests
355
+
356
+ After generation, run the new tests once:
357
+
358
+ ```bash
359
+ PLAYWRIGHT_HTML_OPEN=never npx playwright test tests/<group>/<scenario>.spec.ts
360
+ ```
361
+
362
+ Any failure goes to Section 3.
363
+
364
+ ---
365
+
366
+ ## 3. Heal
367
+
368
+ Goal: fix failing tests, and update the spec if the app's intended behaviour changed.
369
+
370
+ ### 3.1 Find failing tests
371
+
372
+ ```bash
373
+ PLAYWRIGHT_HTML_OPEN=never npx playwright test
374
+ ```
375
+
376
+ Record the list of failing `<file>:<line>` entries and process them one at a time. Do not attempt parallel fixes — shared state and the single CLI session make that fragile.
377
+
378
+ ### 3.2 Debug one failure
379
+
380
+ Run the single failing test in debug mode in the background, then attach:
381
+
382
+ ```bash
383
+ PLAYWRIGHT_HTML_OPEN=never npx playwright test tests/<group>/<scenario>.spec.ts:<line> --debug=cli
384
+ # wait for "Debugging Instructions" and the tw-XXXX session name
385
+ playwright-cli attach tw-XXXX
386
+ ```
387
+
388
+ The test is paused at the start. Step forward or run to until just before the failing action or assertion, then diagnose:
389
+
390
+ ```bash
391
+ playwright-cli snapshot # did the element change / move / rename?
392
+ playwright-cli console # app-side errors?
393
+ playwright-cli requests # failed request? wrong payload?
394
+ playwright-cli show --annotate # ask the user to point somewhere
395
+ ```
396
+
397
+ Common causes: selector drift, new wrapper element, label/ARIA rename, timing (transition, async load), assertion text updated in the app, test data leaking between runs.
398
+
399
+ Rehearse the corrected interaction with `playwright-cli` — the generated code in the output is what you paste back into the test.
400
+
401
+ ### 3.3 Apply the fix
402
+
403
+ Edit the test file: update the locator, assertion, step order, or inputs to match the corrected behaviour. Stop the background debug run. Rerun the single test to confirm green.
404
+
405
+ Never skip hooks or add sleeps as a fix. Never use `networkidle`.
406
+
407
+ ### 3.4 Reconcile with the spec
408
+
409
+ Open the spec referenced by the `// spec:` header in the test file and locate the scenario that matches the test.
410
+
411
+ - **Fix was purely technical** (locator drift, better assertion shape) and the spec's user-level behaviour still matches the app → leave the spec alone.
412
+ - **Fix changed user-visible steps, inputs, order, or expected outcomes** that the spec describes → update the spec to match reality. Keep the scenario id and file path stable; only the step / expect lines change.
413
+ - **Unclear whether the app change is intentional** (spec is stale) **or a regression** (test was right, app is wrong) → **stop and ask the user**. Provide:
414
+ - the scenario id (e.g. `2.3`),
415
+ - the spec lines that no longer match,
416
+ - the observed app behaviour (quote a snapshot excerpt or a concrete outcome).
417
+
418
+ Only after the user answers, either update the spec (intentional change) or file/flag the test as covering a bug (regression).
419
+
420
+ ### 3.5 Iteration and giving up
421
+
422
+ - Fix failures one at a time; rerun after each.
423
+ - If after thorough investigation you are confident the test is correct but the app is wrong *and* the user has confirmed it's a bug: mark the test `test.fixme(...)` with a comment pointing at the user's decision or issue link. Never silently skip.
424
+
425
+ ---
426
+
427
+ ## Cross-references
428
+
429
+ | For... | See |
430
+ |---|---|
431
+ | `--debug=cli` / attach mechanics | [playwright-tests.md](playwright-tests.md) |
432
+ | Mocking requests during exploration/generation | [request-mocking.md](request-mocking.md) |
433
+ | Managing the CLI browser session | [session-management.md](session-management.md) |