@ddwang/magnitude-core 0.3.1-ddwang.2 → 0.3.1-ddwang.21

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 (363) hide show
  1. package/dist/cli.cjs +2 -0
  2. package/dist/cli.cjs.map +1 -0
  3. package/dist/cli.d.cts +2 -0
  4. package/dist/cli.d.ts +2 -0
  5. package/dist/cli.mjs +1 -0
  6. package/dist/cli.mjs.map +1 -0
  7. package/dist/index.cjs +2704 -1522
  8. package/dist/index.cjs.map +1 -0
  9. package/dist/index.d.cts +188 -50
  10. package/dist/index.d.ts +1147 -23
  11. package/dist/index.mjs +2527 -1362
  12. package/dist/index.mjs.map +1 -0
  13. package/node_modules/patchright-core/README.md +3 -0
  14. package/node_modules/patchright-core/ThirdPartyNotices.txt +13 -0
  15. package/node_modules/patchright-core/bin/install_media_pack.ps1 +5 -0
  16. package/node_modules/patchright-core/bin/install_webkit_wsl.ps1 +33 -0
  17. package/node_modules/patchright-core/bin/reinstall_chrome_beta_linux.sh +42 -0
  18. package/node_modules/patchright-core/bin/reinstall_chrome_beta_mac.sh +13 -0
  19. package/node_modules/patchright-core/bin/reinstall_chrome_beta_win.ps1 +24 -0
  20. package/node_modules/patchright-core/bin/reinstall_chrome_stable_linux.sh +42 -0
  21. package/node_modules/patchright-core/bin/reinstall_chrome_stable_mac.sh +12 -0
  22. package/node_modules/patchright-core/bin/reinstall_chrome_stable_win.ps1 +24 -0
  23. package/node_modules/patchright-core/bin/reinstall_msedge_beta_linux.sh +48 -0
  24. package/node_modules/patchright-core/bin/reinstall_msedge_beta_mac.sh +11 -0
  25. package/node_modules/patchright-core/bin/reinstall_msedge_beta_win.ps1 +23 -0
  26. package/node_modules/patchright-core/bin/reinstall_msedge_dev_linux.sh +48 -0
  27. package/node_modules/patchright-core/bin/reinstall_msedge_dev_mac.sh +11 -0
  28. package/node_modules/patchright-core/bin/reinstall_msedge_dev_win.ps1 +23 -0
  29. package/node_modules/patchright-core/bin/reinstall_msedge_stable_linux.sh +48 -0
  30. package/node_modules/patchright-core/bin/reinstall_msedge_stable_mac.sh +11 -0
  31. package/node_modules/patchright-core/bin/reinstall_msedge_stable_win.ps1 +24 -0
  32. package/node_modules/patchright-core/browsers.json +52 -0
  33. package/node_modules/patchright-core/cli.js +22 -0
  34. package/node_modules/patchright-core/index.d.ts +17 -0
  35. package/node_modules/patchright-core/index.js +17 -0
  36. package/node_modules/patchright-core/index.mjs +28 -0
  37. package/node_modules/patchright-core/lib/bootstrap.js +149 -0
  38. package/node_modules/patchright-core/lib/coreBundle.js +80653 -0
  39. package/node_modules/patchright-core/lib/entry/cliDaemon.js +5 -0
  40. package/node_modules/patchright-core/lib/entry/dashboardApp.js +3 -0
  41. package/node_modules/patchright-core/lib/entry/mcp.js +10 -0
  42. package/node_modules/patchright-core/lib/entry/oopBrowserDownload.js +3 -0
  43. package/node_modules/patchright-core/lib/package.js +50 -0
  44. package/node_modules/patchright-core/lib/server/chromium/appIcon.png +0 -0
  45. package/node_modules/patchright-core/lib/server/electron/loader.js +112 -0
  46. package/node_modules/patchright-core/lib/serverRegistry.js +1939 -0
  47. package/node_modules/patchright-core/lib/serverRegistry.js.LICENSE +65 -0
  48. package/node_modules/patchright-core/lib/tools/cli-client/channelSessions.js +141 -0
  49. package/node_modules/patchright-core/lib/tools/cli-client/cli.js +7 -0
  50. package/node_modules/patchright-core/lib/tools/cli-client/help.json +808 -0
  51. package/node_modules/patchright-core/lib/tools/cli-client/minimist.js +128 -0
  52. package/node_modules/patchright-core/lib/tools/cli-client/output.js +352 -0
  53. package/node_modules/patchright-core/lib/tools/cli-client/program.js +422 -0
  54. package/node_modules/patchright-core/lib/tools/cli-client/registry.js +180 -0
  55. package/node_modules/patchright-core/lib/tools/cli-client/session.js +261 -0
  56. package/node_modules/patchright-core/lib/tools/dashboard/appIcon.png +0 -0
  57. package/node_modules/patchright-core/lib/tools/skills/playwright-cli/SKILL.md +493 -0
  58. package/node_modules/patchright-core/lib/tools/skills/playwright-cli/references/element-attributes.md +23 -0
  59. package/node_modules/patchright-core/lib/tools/skills/playwright-cli/references/playwright-tests.md +39 -0
  60. package/node_modules/patchright-core/lib/tools/skills/playwright-cli/references/pr-attachments.md +60 -0
  61. package/node_modules/patchright-core/lib/tools/skills/playwright-cli/references/request-mocking.md +87 -0
  62. package/node_modules/patchright-core/lib/tools/skills/playwright-cli/references/running-code.md +245 -0
  63. package/node_modules/patchright-core/lib/tools/skills/playwright-cli/references/session-management.md +227 -0
  64. package/node_modules/patchright-core/lib/tools/skills/playwright-cli/references/storage-state.md +275 -0
  65. package/node_modules/patchright-core/lib/tools/skills/playwright-cli/references/test-generation.md +433 -0
  66. package/node_modules/patchright-core/lib/tools/skills/playwright-cli/references/tracing.md +139 -0
  67. package/node_modules/patchright-core/lib/tools/skills/playwright-cli/references/video-recording.md +216 -0
  68. package/node_modules/patchright-core/lib/tools/skills/playwright-component-testing/SKILL.md +136 -0
  69. package/node_modules/patchright-core/lib/tools/skills/playwright-component-testing/references/gallery-spec.md +144 -0
  70. package/node_modules/patchright-core/lib/tools/skills/playwright-component-testing/references/migration.md +89 -0
  71. package/node_modules/patchright-core/lib/tools/skills/playwright-component-testing/references/react.md +69 -0
  72. package/node_modules/patchright-core/lib/tools/skills/playwright-component-testing/references/typing.md +173 -0
  73. package/node_modules/patchright-core/lib/tools/skills/playwright-component-testing/references/vue.md +77 -0
  74. package/node_modules/patchright-core/lib/tools/skills/playwright-trace/SKILL.md +174 -0
  75. package/node_modules/patchright-core/lib/tools/utils/extension.js +112 -0
  76. package/node_modules/patchright-core/lib/tools/utils/socketConnection.js +108 -0
  77. package/node_modules/patchright-core/lib/utilsBundle.js +86225 -0
  78. package/node_modules/patchright-core/lib/utilsBundle.js.LICENSE +1890 -0
  79. package/node_modules/patchright-core/lib/vite/dashboard/assets/codeMirrorModule--QdMvsKi.css +1 -0
  80. package/node_modules/patchright-core/lib/vite/dashboard/assets/codeMirrorModule-CQ8RZGBm.js +32 -0
  81. package/node_modules/patchright-core/lib/vite/dashboard/assets/codicon-DCmgc-ay.ttf +0 -0
  82. package/node_modules/patchright-core/lib/vite/dashboard/assets/firefox-1bWoP6pv.svg +1 -0
  83. package/node_modules/patchright-core/lib/vite/dashboard/assets/firefox-beta-k3eOH_eK.svg +1 -0
  84. package/node_modules/patchright-core/lib/vite/dashboard/assets/firefox-nightly-Cp5nfeDT.svg +1 -0
  85. package/node_modules/patchright-core/lib/vite/dashboard/assets/index-AwgwcYie.css +1 -0
  86. package/node_modules/patchright-core/lib/vite/dashboard/assets/index-hRvO4yU2.js +12 -0
  87. package/node_modules/patchright-core/lib/vite/dashboard/assets/safari-na3_-uQk.svg +1 -0
  88. package/node_modules/patchright-core/lib/vite/dashboard/index.html +29 -0
  89. package/node_modules/patchright-core/lib/vite/dashboard/playwright-logo.svg +24 -0
  90. package/node_modules/patchright-core/lib/vite/htmlReport/index.html +16 -0
  91. package/node_modules/patchright-core/lib/vite/htmlReport/report.css +2 -0
  92. package/node_modules/patchright-core/lib/vite/htmlReport/report.js +32 -0
  93. package/node_modules/patchright-core/lib/vite/recorder/assets/codeMirrorModule--QdMvsKi.css +1 -0
  94. package/node_modules/patchright-core/lib/vite/recorder/assets/codeMirrorModule-GBnsXk4c.js +32 -0
  95. package/node_modules/patchright-core/lib/vite/recorder/assets/codicon-DCmgc-ay.ttf +0 -0
  96. package/node_modules/patchright-core/lib/vite/recorder/assets/index-BZpYJZ-P.css +1 -0
  97. package/node_modules/patchright-core/lib/vite/recorder/assets/index-CVDOfo-j.js +129 -0
  98. package/node_modules/patchright-core/lib/vite/recorder/index.html +29 -0
  99. package/node_modules/patchright-core/lib/vite/recorder/playwright-logo.svg +9 -0
  100. package/node_modules/patchright-core/lib/vite/traceViewer/assets/codeMirrorModule-G79327TW.js +32 -0
  101. package/node_modules/patchright-core/lib/vite/traceViewer/assets/defaultSettingsView-D9EV0iaS.js +184 -0
  102. package/node_modules/patchright-core/lib/vite/traceViewer/assets/urlMatch-L3liM589.js +1 -0
  103. package/node_modules/patchright-core/lib/vite/traceViewer/assets/xtermModule-Al_u-Nk5.js +7 -0
  104. package/node_modules/patchright-core/lib/vite/traceViewer/codeMirrorModule.-QdMvsKi.css +1 -0
  105. package/node_modules/patchright-core/lib/vite/traceViewer/codicon.DCmgc-ay.ttf +0 -0
  106. package/node_modules/patchright-core/lib/vite/traceViewer/defaultSettingsView.C8BeHuxd.css +1 -0
  107. package/node_modules/patchright-core/lib/vite/traceViewer/index.B_TqY17P.css +1 -0
  108. package/node_modules/patchright-core/lib/vite/traceViewer/index.CMB2-c8e.js +1 -0
  109. package/node_modules/patchright-core/lib/vite/traceViewer/index.html +44 -0
  110. package/node_modules/patchright-core/lib/vite/traceViewer/manifest.webmanifest +16 -0
  111. package/node_modules/patchright-core/lib/vite/traceViewer/playwright-logo.svg +9 -0
  112. package/node_modules/patchright-core/lib/vite/traceViewer/snapshot.B_Jk1wbt.js +1 -0
  113. package/node_modules/patchright-core/lib/vite/traceViewer/snapshot.html +10 -0
  114. package/node_modules/patchright-core/lib/vite/traceViewer/sw.bundle.js +4 -0
  115. package/node_modules/patchright-core/lib/vite/traceViewer/uiMode.C3yLoy2G.js +5 -0
  116. package/node_modules/patchright-core/lib/vite/traceViewer/uiMode.CyMfwkXJ.css +1 -0
  117. package/node_modules/patchright-core/lib/vite/traceViewer/uiMode.html +18 -0
  118. package/node_modules/patchright-core/lib/vite/traceViewer/xtermModule.kHJ-D0s7.css +1 -0
  119. package/node_modules/patchright-core/lib/webp_codec.LICENSE +173 -0
  120. package/node_modules/patchright-core/lib/webp_codec.wasm +0 -0
  121. package/node_modules/patchright-core/lib/xdg-open +1267 -0
  122. package/node_modules/patchright-core/package.json +34 -0
  123. package/node_modules/patchright-core/types/protocol.d.ts +24776 -0
  124. package/node_modules/patchright-core/types/structs.d.ts +52 -0
  125. package/node_modules/patchright-core/types/types.d.ts +27167 -0
  126. package/node_modules/playwright/.bun-tag-91d746a6045e143f +0 -0
  127. package/node_modules/playwright/README.md +300 -0
  128. package/node_modules/playwright/ThirdPartyNotices.txt +14 -0
  129. package/node_modules/playwright/cli.js +19 -0
  130. package/node_modules/playwright/index.d.ts +17 -0
  131. package/node_modules/playwright/index.js +17 -0
  132. package/node_modules/playwright/index.mjs +18 -0
  133. package/node_modules/playwright/lib/agents/agentParser.js +89 -0
  134. package/node_modules/playwright/lib/agents/copilot-setup-steps.yml +34 -0
  135. package/node_modules/playwright/lib/agents/generateAgents.js +395 -0
  136. package/node_modules/playwright/lib/agents/playwright-test-coverage.prompt.md +31 -0
  137. package/node_modules/playwright/lib/agents/playwright-test-generate.prompt.md +8 -0
  138. package/node_modules/playwright/lib/agents/playwright-test-generator.agent.md +88 -0
  139. package/node_modules/playwright/lib/agents/playwright-test-heal.prompt.md +6 -0
  140. package/node_modules/playwright/lib/agents/playwright-test-healer.agent.md +56 -0
  141. package/node_modules/playwright/lib/agents/playwright-test-plan.prompt.md +9 -0
  142. package/node_modules/playwright/lib/agents/playwright-test-planner.agent.md +74 -0
  143. package/node_modules/playwright/lib/cli/reportActions.js +78 -0
  144. package/node_modules/playwright/lib/cli/testActions.js +217 -0
  145. package/node_modules/playwright/lib/common/index.js +2937 -0
  146. package/node_modules/playwright/lib/common/index.js.txt +33 -0
  147. package/node_modules/playwright/lib/errorContext.js +129 -0
  148. package/node_modules/playwright/lib/globals.js +58 -0
  149. package/node_modules/playwright/lib/index.js +827 -0
  150. package/node_modules/playwright/lib/isomorphic.js +260 -0
  151. package/node_modules/playwright/lib/isomorphic.js.txt +9 -0
  152. package/node_modules/playwright/lib/loader/loaderProcessEntry.js +34 -0
  153. package/node_modules/playwright/lib/loader/loaderProcessEntry.js.txt +9 -0
  154. package/node_modules/playwright/lib/matchers/expect.js +13496 -0
  155. package/node_modules/playwright/lib/matchers/expect.js.LICENSE +640 -0
  156. package/node_modules/playwright/lib/matchers/expect.js.txt +67 -0
  157. package/node_modules/playwright/lib/mcp/test/browserBackend.js +135 -0
  158. package/node_modules/playwright/lib/mcp/test/generatorTools.js +122 -0
  159. package/node_modules/playwright/lib/mcp/test/plannerTools.js +150 -0
  160. package/node_modules/playwright/lib/mcp/test/seed.js +82 -0
  161. package/node_modules/playwright/lib/mcp/test/streams.js +44 -0
  162. package/node_modules/playwright/lib/mcp/test/testBackend.js +99 -0
  163. package/node_modules/playwright/lib/mcp/test/testContext.js +306 -0
  164. package/node_modules/playwright/lib/mcp/test/testTool.js +30 -0
  165. package/node_modules/playwright/lib/mcp/test/testTools.js +98 -0
  166. package/node_modules/playwright/lib/package.js +47 -0
  167. package/node_modules/playwright/lib/program.js +242 -0
  168. package/node_modules/playwright/lib/runner/index.js +8721 -0
  169. package/node_modules/playwright/lib/runner/index.js.txt +62 -0
  170. package/node_modules/playwright/lib/transform/babelBundle.js +72490 -0
  171. package/node_modules/playwright/lib/transform/babelBundle.js.LICENSE +2384 -0
  172. package/node_modules/playwright/lib/transform/babelBundle.js.txt +328 -0
  173. package/node_modules/playwright/lib/transform/esmLoader.js +8213 -0
  174. package/node_modules/playwright/lib/transform/esmLoader.js.LICENSE +355 -0
  175. package/node_modules/playwright/lib/transform/esmLoader.js.txt +60 -0
  176. package/node_modules/playwright/lib/util.js +373 -0
  177. package/node_modules/playwright/lib/worker/workerProcessEntry.js +1860 -0
  178. package/node_modules/playwright/lib/worker/workerProcessEntry.js.txt +19 -0
  179. package/node_modules/playwright/package.json +50 -0
  180. package/node_modules/playwright/test.d.ts +18 -0
  181. package/node_modules/playwright/test.js +24 -0
  182. package/node_modules/playwright/test.mjs +35 -0
  183. package/node_modules/playwright/types/test.d.ts +11191 -0
  184. package/node_modules/playwright/types/testReporter.d.ts +950 -0
  185. package/package.json +21 -12
  186. package/dist/actions/desktopActions.d.ts +0 -58
  187. package/dist/actions/desktopActions.js +0 -155
  188. package/dist/actions/index.d.ts +0 -27
  189. package/dist/actions/index.js +0 -11
  190. package/dist/actions/memoryActions.d.ts +0 -9
  191. package/dist/actions/memoryActions.js +0 -34
  192. package/dist/actions/taskActions.d.ts +0 -8
  193. package/dist/actions/taskActions.js +0 -27
  194. package/dist/actions/types.d.ts +0 -35
  195. package/dist/actions/types.js +0 -5
  196. package/dist/actions/util.d.ts +0 -21
  197. package/dist/actions/util.js +0 -280
  198. package/dist/actions/webActions.d.ts +0 -87
  199. package/dist/actions/webActions.js +0 -214
  200. package/dist/actions/webActions.test.d.ts +0 -1
  201. package/dist/actions/webActions.test.js +0 -43
  202. package/dist/agent/browserAgent.d.ts +0 -31
  203. package/dist/agent/browserAgent.js +0 -136
  204. package/dist/agent/errors.d.ts +0 -22
  205. package/dist/agent/errors.js +0 -97
  206. package/dist/agent/index.d.ts +0 -64
  207. package/dist/agent/index.js +0 -505
  208. package/dist/agent/narrator.d.ts +0 -4
  209. package/dist/agent/narrator.js +0 -63
  210. package/dist/agent/pause.test.d.ts +0 -1
  211. package/dist/agent/pause.test.js +0 -194
  212. package/dist/ai/baml_client/async_client.d.ts +0 -64
  213. package/dist/ai/baml_client/async_client.js +0 -284
  214. package/dist/ai/baml_client/async_request.d.ts +0 -39
  215. package/dist/ai/baml_client/async_request.js +0 -134
  216. package/dist/ai/baml_client/config.d.ts +0 -11
  217. package/dist/ai/baml_client/config.js +0 -20
  218. package/dist/ai/baml_client/globals.d.ts +0 -16
  219. package/dist/ai/baml_client/globals.js +0 -37
  220. package/dist/ai/baml_client/index.d.ts +0 -17
  221. package/dist/ai/baml_client/index.js +0 -42
  222. package/dist/ai/baml_client/inlinedbaml.d.ts +0 -19
  223. package/dist/ai/baml_client/inlinedbaml.js +0 -31
  224. package/dist/ai/baml_client/parser.d.ts +0 -53
  225. package/dist/ai/baml_client/parser.js +0 -86
  226. package/dist/ai/baml_client/partial_types.d.ts +0 -61
  227. package/dist/ai/baml_client/partial_types.js +0 -10
  228. package/dist/ai/baml_client/sync_client.d.ts +0 -57
  229. package/dist/ai/baml_client/sync_client.js +0 -142
  230. package/dist/ai/baml_client/sync_request.d.ts +0 -37
  231. package/dist/ai/baml_client/sync_request.js +0 -134
  232. package/dist/ai/baml_client/tracing.d.ts +0 -16
  233. package/dist/ai/baml_client/tracing.js +0 -18
  234. package/dist/ai/baml_client/type_builder.d.ts +0 -40
  235. package/dist/ai/baml_client/type_builder.js +0 -120
  236. package/dist/ai/baml_client/types.d.ts +0 -69
  237. package/dist/ai/baml_client/types.js +0 -15
  238. package/dist/ai/baml_client/watchers.d.ts +0 -32
  239. package/dist/ai/baml_client/watchers.js +0 -50
  240. package/dist/ai/baseten.d.ts +0 -4
  241. package/dist/ai/baseten.js +0 -10
  242. package/dist/ai/claudeCode.d.ts +0 -1
  243. package/dist/ai/claudeCode.js +0 -186
  244. package/dist/ai/modelHarness.d.ts +0 -39
  245. package/dist/ai/modelHarness.js +0 -324
  246. package/dist/ai/modelResponseError.d.ts +0 -4
  247. package/dist/ai/modelResponseError.js +0 -8
  248. package/dist/ai/multiModelHarness.d.ts +0 -24
  249. package/dist/ai/multiModelHarness.js +0 -52
  250. package/dist/ai/plannerResponse.d.ts +0 -34
  251. package/dist/ai/plannerResponse.js +0 -96
  252. package/dist/ai/plannerResponse.test.d.ts +0 -1
  253. package/dist/ai/plannerResponse.test.js +0 -112
  254. package/dist/ai/structuredOutput.d.ts +0 -11
  255. package/dist/ai/structuredOutput.js +0 -94
  256. package/dist/ai/structuredOutput.test.d.ts +0 -1
  257. package/dist/ai/structuredOutput.test.js +0 -91
  258. package/dist/ai/types.d.ts +0 -119
  259. package/dist/ai/types.js +0 -5
  260. package/dist/ai/util.d.ts +0 -13
  261. package/dist/ai/util.js +0 -200
  262. package/dist/ai/util.test.d.ts +0 -1
  263. package/dist/ai/util.test.js +0 -95
  264. package/dist/cli.js +0 -3
  265. package/dist/common/actions.js +0 -14
  266. package/dist/common/events.d.ts +0 -17
  267. package/dist/common/events.js +0 -3
  268. package/dist/common/failure.d.ts +0 -68
  269. package/dist/common/failure.js +0 -1
  270. package/dist/common/index.d.ts +0 -3
  271. package/dist/common/index.js +0 -3
  272. package/dist/common/operation.d.ts +0 -31
  273. package/dist/common/operation.js +0 -102
  274. package/dist/common/operation.test.d.ts +0 -1
  275. package/dist/common/operation.test.js +0 -53
  276. package/dist/common/retry.d.ts +0 -16
  277. package/dist/common/retry.js +0 -35
  278. package/dist/common/util.d.ts +0 -23
  279. package/dist/common/util.js +0 -139
  280. package/dist/connectors/browserConnector.d.ts +0 -53
  281. package/dist/connectors/browserConnector.js +0 -290
  282. package/dist/connectors/desktopConnector.d.ts +0 -58
  283. package/dist/connectors/desktopConnector.js +0 -68
  284. package/dist/connectors/index.d.ts +0 -14
  285. package/dist/connectors/index.js +0 -2
  286. package/dist/index.js +0 -28
  287. package/dist/logger.d.ts +0 -3
  288. package/dist/logger.js +0 -15
  289. package/dist/memory/agentMemory.d.ts +0 -47
  290. package/dist/memory/agentMemory.js +0 -167
  291. package/dist/memory/agentMemory.test.d.ts +0 -1
  292. package/dist/memory/agentMemory.test.js +0 -150
  293. package/dist/memory/image.d.ts +0 -28
  294. package/dist/memory/image.js +0 -95
  295. package/dist/memory/image.test.d.ts +0 -1
  296. package/dist/memory/image.test.js +0 -46
  297. package/dist/memory/index.d.ts +0 -3
  298. package/dist/memory/index.js +0 -3
  299. package/dist/memory/masking.d.ts +0 -7
  300. package/dist/memory/masking.js +0 -141
  301. package/dist/memory/masking.test.d.ts +0 -1
  302. package/dist/memory/masking.test.js +0 -117
  303. package/dist/memory/notebook.d.ts +0 -58
  304. package/dist/memory/notebook.js +0 -75
  305. package/dist/memory/notebook.test.d.ts +0 -1
  306. package/dist/memory/notebook.test.js +0 -99
  307. package/dist/memory/observation.d.ts +0 -38
  308. package/dist/memory/observation.js +0 -79
  309. package/dist/memory/rendering/index.d.ts +0 -10
  310. package/dist/memory/rendering/index.js +0 -13
  311. package/dist/memory/rendering/renderJsonParts.d.ts +0 -3
  312. package/dist/memory/rendering/renderJsonParts.js +0 -115
  313. package/dist/memory/rendering/renderJsonParts.test.d.ts +0 -1
  314. package/dist/memory/rendering/renderJsonParts.test.js +0 -217
  315. package/dist/memory/rendering/renderXmlParts.d.ts +0 -7
  316. package/dist/memory/rendering/renderXmlParts.js +0 -127
  317. package/dist/memory/serde.d.ts +0 -20
  318. package/dist/memory/serde.js +0 -67
  319. package/dist/memory/serde.test.d.ts +0 -1
  320. package/dist/memory/serde.test.js +0 -64
  321. package/dist/memory/util.d.ts +0 -2
  322. package/dist/memory/util.js +0 -17
  323. package/dist/telemetry/events.d.ts +0 -9
  324. package/dist/telemetry/events.js +0 -80
  325. package/dist/telemetry/index.d.ts +0 -6
  326. package/dist/telemetry/index.js +0 -91
  327. package/dist/types.d.ts +0 -30
  328. package/dist/types.js +0 -1
  329. package/dist/util.d.ts +0 -1
  330. package/dist/util.js +0 -12
  331. package/dist/version.d.ts +0 -1
  332. package/dist/version.js +0 -3
  333. package/dist/web/browserProvider.d.ts +0 -24
  334. package/dist/web/browserProvider.js +0 -164
  335. package/dist/web/browserProvider.test.d.ts +0 -1
  336. package/dist/web/browserProvider.test.js +0 -44
  337. package/dist/web/harness.d.ts +0 -109
  338. package/dist/web/harness.js +0 -401
  339. package/dist/web/recovery.d.ts +0 -46
  340. package/dist/web/recovery.js +0 -137
  341. package/dist/web/recovery.test.d.ts +0 -1
  342. package/dist/web/recovery.test.js +0 -182
  343. package/dist/web/stability.d.ts +0 -57
  344. package/dist/web/stability.js +0 -323
  345. package/dist/web/tabs.d.ts +0 -58
  346. package/dist/web/tabs.js +0 -293
  347. package/dist/web/transformer.d.ts +0 -7
  348. package/dist/web/transformer.js +0 -41
  349. package/dist/web/types.d.ts +0 -37
  350. package/dist/web/types.js +0 -2
  351. package/dist/web/util.d.ts +0 -3
  352. package/dist/web/util.js +0 -81
  353. package/dist/web/visualizer/cursor.d.ts +0 -16
  354. package/dist/web/visualizer/cursor.js +0 -153
  355. package/dist/web/visualizer/index.d.ts +0 -22
  356. package/dist/web/visualizer/index.js +0 -47
  357. package/dist/web/visualizer/mouseEffects.d.ts +0 -18
  358. package/dist/web/visualizer/mouseEffects.js +0 -287
  359. package/dist/web/visualizer/typeEffects.d.ts +0 -10
  360. package/dist/web/visualizer/typeEffects.js +0 -190
  361. package/dist/web/zodReexport.test.d.ts +0 -1
  362. package/dist/web/zodReexport.test.js +0 -14
  363. /package/{dist/common/actions.d.ts → node_modules/patchright-core/.bun-tag-19f23bd68c84ec1f} +0 -0
@@ -0,0 +1,89 @@
1
+ # Migrating from @playwright/experimental-ct-react / -vue
2
+
3
+ The CT packages compiled JSX in the test file and marshalled it into the browser. The gallery
4
+ pattern moves the scenario into a story export that runs natively in the browser: structure (which
5
+ component, its children, providers) plus behavior (state and callbacks, recorded into a hidden
6
+ form for the test to assert on). Plain data props travel through `mount(storyId, props)`;
7
+ `update()` and `unmount()` work as before.
8
+
9
+ ## Concept mapping
10
+
11
+ | `@playwright/experimental-ct-*` | Gallery pattern |
12
+ |---|---|
13
+ | `mount(<Button title="…" onClick={spy} />)` | Stateful story: the story provides `onClick`, records the effect into a hidden form input; the test asserts `toHaveValue()` |
14
+ | Plain data props from the test | Unchanged in spirit: `mount(id, props)` |
15
+ | JSX children / slots from the test | Cannot cross — bake each composition into its own story export (Vue: `.story.vue` for slot-heavy scenarios) |
16
+ | `component.update(<Button count={2} />)` | `component.update({ count: 2 })` — state-preserving, needs the gallery to reuse its root (`gallery-spec.md`) |
17
+ | `component.unmount()` | `component.unmount()` — backed by the gallery's `window.unmount()` |
18
+ | `beforeMount`/`afterMount` in `playwright/index.ts` | The body of the gallery's `window.mount` (global), or story decorators (per-story) |
19
+ | `hooksConfig` per-test variation | Props: `mount('App/Routing', { route: '/dashboard' })` — the story/decorator interprets them |
20
+ | `router` fixture / MSW handlers in Node | `page.route()` in the test, or MSW `setupWorker` inside a story/decorator |
21
+ | `playwright/index.html` (styles, fonts, theme) | The gallery's `index.html` / entry module imports |
22
+ | `ctViteConfig`, `ctPort`, `ctTemplateDir`, `ctCacheDir` | Gone — the gallery runs through the app's own dev server; port lives in `webServer` + `baseURL`; location is `playwright/gallery/` |
23
+ | `defineConfig` from `@playwright/experimental-ct-react` | Plain `defineConfig` from `@playwright/test`, with `baseURL` = gallery URL, `serviceWorkers: 'block'`, `reuseContext: true` (see `SKILL.md`) |
24
+
25
+ The CT packages were removed in Playwright 1.63 and are no longer published, so migrate while
26
+ pinned to Playwright 1.62 and upgrade once the last spec is ported.
27
+
28
+ ## Steps
29
+
30
+ 1. Set up the gallery and config per `SKILL.md`. Keep the old CT project running until the last
31
+ spec is migrated.
32
+ 2. For each CT spec, split every `mount(<…/>)` call: JSX structure becomes a story export next to
33
+ the component; plain data props stay in the test as `mount`'s second argument. Callback spies
34
+ become story state recorded into a hidden form. A call site that only varies data props usually
35
+ needs just one generic story that spreads them:
36
+ `export const Default = (props: ButtonProps) => <Button title="Submit" {...props} />`.
37
+ 3. Rewrite the spec: import `test`/`expect` from `@playwright/test`; `mount(<X a={1}/>)`
38
+ → `mount('X/Default', { a: 1 })`; `update(<X a={2}/>)` → `update({ a: 2 })`;
39
+ `unmount()` unchanged. `mount` returns a locator for the gallery root — scope the queries:
40
+ `component.getByRole('button').click()`. Spy assertions become `toHaveValue()` on the story's
41
+ recorded state.
42
+ 4. Port `beforeMount` hooks: app-wide setup into the gallery's `window.mount`; per-test
43
+ `hooksConfig` branches into props interpreted by a story or decorator.
44
+ 5. When all specs are green, delete the CT project from the config, drop the
45
+ `@playwright/experimental-ct-*` dependency, remove `playwright/index.html`,
46
+ `playwright/index.ts*` and `playwright/.cache`, and lift the Playwright version pin.
47
+
48
+ ## Gotchas
49
+
50
+ - **Story ids are strings.** Renaming or moving a story breaks specs at runtime, not compile time
51
+ — and the suffix-matching resolution can silently match a different story after a rename.
52
+ Gallery types (`typing.md`) turn registered ids into a compile-time check.
53
+ - **Per-test JSX is gone.** Any test that built a different JSX tree per test (children matrices,
54
+ inline wrappers) becomes one story export per composition.
55
+
56
+ ## Before / after
57
+
58
+ ```tsx
59
+ // Before (CT)
60
+ import { test, expect } from '@playwright/experimental-ct-react';
61
+ import Button from '../src/components/Button';
62
+
63
+ test('click', async ({ mount }) => {
64
+ const messages: string[] = [];
65
+ const component = await mount(<Button title="Submit" onClick={data => messages.push(data)} />);
66
+ await component.click();
67
+ expect(messages).toEqual(['hello']);
68
+ });
69
+ ```
70
+
71
+ ```tsx
72
+ // After: src/components/Button.story.tsx
73
+ import Button from './Button';
74
+
75
+ export const Default = (props: { onClick?: (data: string) => void }) =>
76
+ <Button title="Submit" {...props} />;
77
+ ```
78
+
79
+ ```ts
80
+ // After: src/components/Button.spec.ts
81
+ import { test, expect } from '@playwright/test';
82
+
83
+ test('click', async ({ mount }) => {
84
+ const messages: string[] = [];
85
+ const component = await mount('components/Button/Default', { onClick: (data: string) => messages.push(data) });
86
+ await component.click();
87
+ expect(messages).toEqual(['hello']);
88
+ });
89
+ ```
@@ -0,0 +1,69 @@
1
+ # React setup
2
+
3
+ Follow the setup workflow in `SKILL.md`. Implement the gallery per `references/gallery-spec.md` (which has a React worked example); this page covers React-specific details.
4
+
5
+ ## Files
6
+
7
+ - `playwright/gallery/` — the gallery you implement to `references/gallery-spec.md` (an `index.html` + a `main.tsx` module). Requires `react` and `react-dom` 18+ (`createRoot`).
8
+ - Stories: `src/**/*.story.tsx` (the glob also picks up `.story.jsx`); example in `templates/react/Button.story.tsx`.
9
+
10
+ ## StrictMode
11
+
12
+ Wrap the rendered story in `<React.StrictMode>` in your gallery to match how most apps render. In development builds StrictMode intentionally double-invokes render functions and effects. This matters for stories that record events with counters set in effects — recording via state updates from event handlers (like the `CountsClicks` example story) is unaffected. If a story misbehaves under StrictMode, that is usually a real finding about the component; drop the wrapper only if the app itself does not use StrictMode.
13
+
14
+ ## Global providers
15
+
16
+ If components require context (theme, store, i18n, router), create one shared decorator and use it in stories, so each story states its scenario and nothing more:
17
+
18
+ ```tsx
19
+ // src/stories/decorators.tsx
20
+ import { ThemeProvider } from '../theme';
21
+ import { MemoryRouter } from 'react-router-dom';
22
+
23
+ export function AppScaffold({ children, route = '/' }: { children: React.ReactNode, route?: string }) {
24
+ return (
25
+ <ThemeProvider theme="light">
26
+ <MemoryRouter initialEntries={[route]}>{children}</MemoryRouter>
27
+ </ThemeProvider>
28
+ );
29
+ }
30
+ ```
31
+
32
+ ```tsx
33
+ // src/components/ProfilePage.story.tsx
34
+ export const LoggedIn = () => (
35
+ <AppScaffold route="/profile/42">
36
+ <ProfilePage user={{ id: 42, name: 'Test User' }} />
37
+ </AppScaffold>
38
+ );
39
+ ```
40
+
41
+ Do not build the decorator into the gallery — keeping it in story files makes the wrapping visible and lets stories opt out.
42
+
43
+ ## Typed props
44
+
45
+ `mount` is generic over the story: pass the story type as a template argument to type-check per-test props (and `update()`). Props are inferred from the component signature; function and class components both work.
46
+
47
+ ```tsx
48
+ // src/components/Button.story.tsx
49
+ export const WithTitle = ({ title = 'Default' }: { title?: string }) =>
50
+ <Button title={title} />;
51
+ ```
52
+
53
+ ```ts
54
+ // src/components/button.spec.ts
55
+ import type { WithTitle } from './Button.story';
56
+
57
+ const component = await mount<typeof WithTitle>('components/Button/WithTitle', { title: 'Hello' });
58
+ ```
59
+
60
+ Alternatively, generate gallery types so the id itself is typed and no type import is needed: `mount('acme-ui/components/Button/WithTitle', { title: 'Hello' })` — see `references/typing.md`.
61
+
62
+ ## CSS
63
+
64
+ - Global stylesheets: import them in your gallery entry (`playwright/gallery/main.tsx`, e.g. `import '../../src/index.css'`), mirroring the app's own entry point.
65
+ - Tailwind: if content scanning is path-based, make sure `*.story.tsx` files are covered.
66
+
67
+ ## Data fetching
68
+
69
+ For libraries with client objects (React Query, Apollo), create the client inside the story or decorator so each navigation starts fresh.
@@ -0,0 +1,173 @@
1
+ # Typing `mount()`
2
+
3
+ `mount(storyId, props?)` accepts any string id and any serializable props. Two optional layers
4
+ add type checking on top; both are supported and can be mixed in one project.
5
+
6
+ | | Explicit story type | Gallery types |
7
+ |---|---|---|
8
+ | Call | `mount<typeof WithTitle>('components/Button/WithTitle', { title })` | `mount('acme-ui/components/Button/WithTitle', { title })` |
9
+ | Checks | props and `update()` | props, `update()`, and the id itself (autocomplete, rename safety) |
10
+ | Needs | `import type { WithTitle } from './Button.story'` in the spec | a generated `stories.d.ts` kept in sync by a gallery plugin |
11
+ | Id grammar | any suffix the gallery resolves | full id, prefixed with the package name |
12
+
13
+ ## Explicit story type
14
+
15
+ Pass the story type as a template argument. Nothing to set up; works in every project.
16
+
17
+ ```ts
18
+ import type { WithTitle } from './Button.story';
19
+
20
+ const component = await mount<typeof WithTitle>('components/Button/WithTitle', { title: 'Hello' });
21
+ await component.update({ title: 'Again' });
22
+ ```
23
+
24
+ Use `import type` so the story (and with it React/Vue and CSS imports) is never loaded into the
25
+ Node test process. Function components, class components and `defineComponent` stories all infer
26
+ their props; see the `Typed props` sections in `react.md` / `vue.md` for framework details.
27
+
28
+ ## Gallery types
29
+
30
+ `@playwright/test` exports an empty `interface Stories {}`. When a story id is a key of `Stories`,
31
+ `mount` types the props from that entry; any other string keeps untyped props, so adoption can be
32
+ partial. A tiny Vite plugin next to the gallery generates `stories.d.ts`, which fills `Stories` in
33
+ via module augmentation:
34
+
35
+ ```ts
36
+ // playwright/gallery/stories.d.ts (generated)
37
+ type StoriesOf<Prefix extends string, Mod> = { [K in keyof Mod & string as `${Prefix}/${K}`]: Mod[K] };
38
+
39
+ declare module '@playwright/test' {
40
+ interface Stories extends
41
+ StoriesOf<'acme-ui/components/Button', typeof import('../../src/components/Button.story')>,
42
+ StoriesOf<'acme-ui/components/Expandable', typeof import('../../src/components/Expandable.story')> {}
43
+ }
44
+
45
+ export {};
46
+ ```
47
+
48
+ One line per story file; export names and prop types come from the story module itself, so the
49
+ file only changes when a story file is added, removed or moved. Specs then need no type imports:
50
+
51
+ ```ts
52
+ const component = await mount('acme-ui/components/Button/WithTitle', { title: 'Hello' });
53
+ // ^ autocompletes registered ids ^ checked against WithTitle's props
54
+ ```
55
+
56
+ ### Namespace ids with the package name
57
+
58
+ `Stories` is merged per TypeScript program. In a monorepo whose packages share one `tsconfig`,
59
+ two packages both registering `components/Button/Default` with different props fail with
60
+ `TS2320: Interface 'Stories' cannot simultaneously extend types ...` at the `Stories` declaration,
61
+ and even distinct ids leak into each other's autocomplete. Prefix every id with the package name,
62
+ `<package>/<path under src>/<Export>`, from the start, so the convention holds when a project
63
+ becomes a package. Read the name from `package.json` in both places that derive ids, so they
64
+ cannot drift:
65
+
66
+ ```ts
67
+ // playwright/gallery/main.tsx
68
+ import packageJSON from '../../package.json';
69
+
70
+ const id = (f: string) => packageJSON.name + '/' + f.replace(/^(\.\.\/)+src\//, '').replace(/\.story\.\w+$/, '');
71
+ ```
72
+
73
+ Suffix resolution keeps working at runtime, so `mount('Button/Primary')` still renders; only the
74
+ full prefixed id is typed.
75
+
76
+ ### The plugin
77
+
78
+ Framework-agnostic: it only lists story files. Adjust `storyFile` to match the gallery's glob.
79
+
80
+ ```ts
81
+ // playwright/gallery/storyTypes.ts
82
+ import fs from 'fs';
83
+ import path from 'path';
84
+ import type { Plugin } from 'vite';
85
+
86
+ const storyFile = /\.story\.(tsx|jsx)$/;
87
+
88
+ export function storyTypes(options: { prefix: string, src: string, outFile: string }): Plugin {
89
+ const generate = () => {
90
+ const content = render(listStoryFiles(options.src), options);
91
+ if (fs.existsSync(options.outFile) && fs.readFileSync(options.outFile, 'utf8') === content)
92
+ return;
93
+ fs.writeFileSync(options.outFile, content);
94
+ };
95
+ return {
96
+ name: 'story-types',
97
+ buildStart() {
98
+ this.addWatchFile(options.src);
99
+ generate();
100
+ },
101
+ configureServer(server) {
102
+ const onFile = (file: string) => {
103
+ if (storyFile.test(file))
104
+ generate();
105
+ };
106
+ server.watcher.on('add', onFile);
107
+ server.watcher.on('unlink', onFile);
108
+ },
109
+ };
110
+ }
111
+
112
+ function listStoryFiles(dir: string): string[] {
113
+ const result: string[] = [];
114
+ for (const entry of fs.readdirSync(dir, { withFileTypes: true })) {
115
+ const file = path.join(dir, entry.name);
116
+ if (entry.isDirectory())
117
+ result.push(...listStoryFiles(file));
118
+ else if (storyFile.test(entry.name))
119
+ result.push(file);
120
+ }
121
+ return result.sort();
122
+ }
123
+
124
+ function render(files: string[], { prefix, src, outFile }: { prefix: string, src: string, outFile: string }): string {
125
+ const outDir = path.dirname(outFile);
126
+ const posix = (p: string) => p.split(path.sep).join('/');
127
+ const entries = files.map(file => {
128
+ const id = prefix + '/' + posix(path.relative(src, file)).replace(storyFile, '');
129
+ const specifier = posix(path.relative(outDir, file)).replace(/\.\w+$/, '');
130
+ return ` StoriesOf<'${id}', typeof import('${specifier.startsWith('.') ? specifier : './' + specifier}')>`;
131
+ });
132
+ const stories = entries.length ? `interface Stories extends\n${entries.join(',\n')} {}` : 'interface Stories {}';
133
+ return `// Generated by storyTypes.ts, do not edit.
134
+
135
+ type StoriesOf<Prefix extends string, Mod> = { [K in keyof Mod & string as \`\${Prefix}/\${K}\`]: Mod[K] };
136
+
137
+ declare module '@playwright/test' {
138
+ ${stories}
139
+ }
140
+
141
+ export {};
142
+ `;
143
+ }
144
+ ```
145
+
146
+ Register it on whichever Vite server serves the gallery (the app's `vite.config.ts`, or the
147
+ standalone `playwright/vite.config.ts`):
148
+
149
+ ```ts
150
+ import packageJSON from './package.json';
151
+ import { storyTypes } from './playwright/gallery/storyTypes';
152
+
153
+ export default defineConfig({
154
+ plugins: [
155
+ react(),
156
+ storyTypes({
157
+ prefix: packageJSON.name,
158
+ src: path.resolve(__dirname, 'src'),
159
+ outFile: path.resolve(__dirname, 'playwright/gallery/stories.d.ts'),
160
+ }),
161
+ ],
162
+ });
163
+ ```
164
+
165
+ The file is regenerated on every dev-server start and build, and while the server runs, whenever
166
+ a story file appears or disappears. Its content is deterministic, so **commit it**: type-checking
167
+ in CI or an editor must not depend on a running dev server. Nothing imports the file, so list it
168
+ explicitly in the project's `tsconfig` (`"files": ["playwright/gallery/stories.d.ts"]`) so that
169
+ `tsc` and editors load it.
170
+
171
+ For `.story.vue` single-file components, map the `default` export to the bare path in
172
+ `StoriesOf` (`K extends 'default' ? Prefix : \`${Prefix}/${K}\``) and rely on `vue-tsc` for the
173
+ SFC's types; a story without inferable props types as `unknown` props, which accepts anything.
@@ -0,0 +1,77 @@
1
+ # Vue setup
2
+
3
+ Follow the setup workflow in `SKILL.md`. Implement the gallery per `references/gallery-spec.md`, exposing `window.mount`/`window.unmount` — in Vue, mount with `app = createApp(h(story, props)); app.mount('#root')` and unmount with `app.unmount()`; this page covers Vue-specific details.
4
+
5
+ ## Files
6
+
7
+ - `playwright/gallery/` — the gallery you implement to `references/gallery-spec.md` (an `index.html` + a `main.ts` module). Requires Vue 3.
8
+ - Stories: `src/**/*.story.{ts,js,vue}`; example in `templates/vue/Button.story.ts`.
9
+
10
+ ## Two ways to write stories
11
+
12
+ **Render-function stories** (`Button.story.ts`) — several scenarios per file, one named export each; see `templates/vue/Button.story.ts`. Uses `defineComponent` + `h()`, no SFC compilation involved.
13
+
14
+ **Single-file-component stories** (`Button.primary.story.vue`) — one story per file, full template syntax:
15
+
16
+ ```vue
17
+ <script setup lang="ts">
18
+ import { ref } from 'vue';
19
+ import Button from './Button.vue';
20
+ const clicks = ref(0);
21
+ </script>
22
+
23
+ <template>
24
+ <Button title="Submit" @click="clicks++" />
25
+ <form hidden><input data-testid="click-count" readonly :value="String(clicks)" /></form>
26
+ </template>
27
+ ```
28
+
29
+ An SFC story is addressed by its path without the extension: `mount('components/Button.primary')`. Prefer SFC stories when the scenario needs slots or non-trivial templates.
30
+
31
+ ## Global plugins
32
+
33
+ Apps that rely on plugins (Pinia, vue-router, i18n) should wrap components with a decorator story helper that creates a fresh instance per story:
34
+
35
+ ```ts
36
+ // src/stories/decorators.ts
37
+ import { defineComponent, h, type Component } from 'vue';
38
+ import { createPinia } from 'pinia';
39
+
40
+ export function withStore(story: Component) {
41
+ return defineComponent(() => {
42
+ const pinia = createPinia();
43
+ return () => h(story, { pinia });
44
+ });
45
+ }
46
+ ```
47
+
48
+ For plugins that must be installed on the app instance (`app.use(...)`), add them in your gallery right after `createApp(...)` — that is the equivalent of the app's own bootstrap.
49
+
50
+ ## Typed props
51
+
52
+ A story that takes per-test props declares them twice: in the setup signature (for the type) and in the `props` option (so Vue delivers them as props rather than `attrs`):
53
+
54
+ ```ts
55
+ // src/components/Button.story.ts
56
+ export const WithTitle = defineComponent(
57
+ (props: { title?: string }) => () => h(Button, { title: props.title ?? 'Default' }),
58
+ { props: ['title'] },
59
+ );
60
+ ```
61
+
62
+ `mount` is generic over the story: pass the story type as a template argument to type-check the props (and `update()`):
63
+
64
+ ```ts
65
+ // src/components/button.spec.ts
66
+ import type { WithTitle } from './Button.story';
67
+
68
+ const component = await mount<typeof WithTitle>('components/Button/WithTitle', { title: 'Hello' });
69
+ ```
70
+
71
+ Alternatively, generate gallery types so the id itself is typed and no type import is needed: `mount('acme-ui/components/Button/WithTitle', { title: 'Hello' })` — see `references/typing.md`.
72
+
73
+ Options-API stories (`defineComponent({ props: { ... } })`) infer props the same way. For `.story.vue` SFC stories, prop types are only inferable when the setup generates SFC types (Volar/vue-tsc); otherwise pass the props type directly: `mount<{ title?: string }>('components/Button.primary', { title: 'Hello' })`.
74
+
75
+ ## CSS
76
+
77
+ Import global stylesheets in your gallery entry (`playwright/gallery/main.ts`, e.g. `import '../../src/assets/main.css'`), mirroring the app's entry point.
@@ -0,0 +1,174 @@
1
+ ---
2
+ name: playwright-trace
3
+ description: Inspect Playwright trace files from the command line — list actions, view requests, console, errors, snapshots and screenshots.
4
+ allowed-tools: Bash(npx playwright trace:*)
5
+ ---
6
+
7
+ # Playwright Trace CLI
8
+
9
+ Inspect `.zip` trace files produced by Playwright tests without opening a browser.
10
+
11
+ ## Workflow
12
+
13
+ 1. Start with `trace open <trace.zip>` to extract the trace and see its metadata.
14
+ 2. Use `trace actions` to see all actions with their action IDs.
15
+ 3. Use `trace action <action-id>` to drill into a specific action — see parameters, logs, source location, and available snapshots.
16
+ 4. Use `trace requests`, `trace console`, or `trace errors` for cross-cutting views.
17
+ 5. Use `trace snapshot <action-id>` to get the DOM snapshot, or run a browser command against it.
18
+ 6. Use `trace close` to remove the extracted trace data when done.
19
+
20
+ All commands after `open` operate on the currently opened trace — no need to pass the trace file again. Opening a new trace replaces the previous one.
21
+
22
+ ## Commands
23
+
24
+ ### Open a trace
25
+
26
+ ```bash
27
+ # Extract trace and show metadata: browser, viewport, duration, action/error counts
28
+ npx playwright trace open <trace.zip>
29
+ ```
30
+
31
+ ### Close a trace
32
+
33
+ ```bash
34
+ # Remove extracted trace data
35
+ npx playwright trace close
36
+ ```
37
+
38
+ ### Actions
39
+
40
+ ```bash
41
+ # List all actions as a tree with action IDs and timing
42
+ npx playwright trace actions
43
+
44
+ # Filter by action title (regex, case-insensitive)
45
+ npx playwright trace actions --grep "click"
46
+
47
+ # Only failed actions
48
+ npx playwright trace actions --errors-only
49
+ ```
50
+
51
+ ### Action details
52
+
53
+ ```bash
54
+ # Show full details for one action: params, result, logs, source, snapshots
55
+ npx playwright trace action <action-id>
56
+ ```
57
+
58
+ The `action` command displays available snapshot phases (before, action, after) and the exact command to extract them.
59
+
60
+ ### Requests
61
+
62
+ ```bash
63
+ # All network requests: start time (on the `trace actions` clock), method, status, URL, duration, size
64
+ npx playwright trace requests
65
+
66
+ # Filter by URL pattern
67
+ npx playwright trace requests --grep "api"
68
+
69
+ # Filter by HTTP method
70
+ npx playwright trace requests --method POST
71
+
72
+ # Only failed requests (status >= 400)
73
+ npx playwright trace requests --failed
74
+ ```
75
+
76
+ ### Request details
77
+
78
+ ```bash
79
+ # Show full details for one request: headers, body, security
80
+ npx playwright trace request <request-id>
81
+ ```
82
+
83
+ ### Console
84
+
85
+ ```bash
86
+ # All console messages and stdout/stderr
87
+ npx playwright trace console
88
+
89
+ # Only errors
90
+ npx playwright trace console --errors-only
91
+
92
+ # Only browser console (no stdout/stderr)
93
+ npx playwright trace console --browser
94
+
95
+ # Only stdout/stderr (no browser console)
96
+ npx playwright trace console --stdio
97
+
98
+ # Filter by message text pattern
99
+ npx playwright trace console --grep "failed to fetch"
100
+ ```
101
+
102
+ ### Errors
103
+
104
+ ```bash
105
+ # All errors with stack traces and associated actions
106
+ npx playwright trace errors
107
+ ```
108
+
109
+ ### Snapshots
110
+
111
+ The `snapshot` command loads the DOM snapshot for an action into a headless browser and runs a single browser command against it. Without a browser command, it returns the accessibility snapshot.
112
+
113
+ ```bash
114
+ # Get the accessibility snapshot (default)
115
+ npx playwright trace snapshot <action-id>
116
+
117
+ # Use a specific phase
118
+ npx playwright trace snapshot <action-id> --phase before
119
+
120
+ # Run eval to query the DOM
121
+ npx playwright trace snapshot <action-id> -- eval "document.title"
122
+ npx playwright trace snapshot <action-id> -- eval "document.querySelector('#error').textContent"
123
+
124
+ # Eval on a specific element ref (from the snapshot)
125
+ npx playwright trace snapshot <action-id> -- eval "el => el.getAttribute('data-testid')" e5
126
+
127
+ # Take a screenshot of the snapshot
128
+ npx playwright trace snapshot <action-id> -- screenshot
129
+
130
+ # Redirect output to a file
131
+ npx playwright trace snapshot <action-id> -- eval "document.body.outerHTML" --filename=page.html
132
+ npx playwright trace snapshot <action-id> -- screenshot --filename=screenshot.png
133
+ ```
134
+
135
+ Only three browser commands are useful on a frozen snapshot: `snapshot`, `eval`, and `screenshot`.
136
+
137
+ ### Attachments
138
+
139
+ ```bash
140
+ # List all trace attachments
141
+ npx playwright trace attachments
142
+
143
+ # Extract an attachment by its number
144
+ npx playwright trace attachment 1
145
+ npx playwright trace attachment 1 -o out.png
146
+ ```
147
+
148
+ ## Typical investigation
149
+
150
+ ```bash
151
+ # 1. Open the trace and see what's inside
152
+ npx playwright trace open test-results/my-test/trace.zip
153
+
154
+ # 2. What actions ran?
155
+ npx playwright trace actions
156
+
157
+ # 3. Which action failed?
158
+ npx playwright trace actions --errors-only
159
+
160
+ # 4. What went wrong?
161
+ npx playwright trace action 12
162
+
163
+ # 5. What did the page look like at that moment?
164
+ npx playwright trace snapshot 12
165
+
166
+ # 6. Query the DOM for more detail
167
+ npx playwright trace snapshot 12 -- eval "document.querySelector('.error-message').textContent"
168
+
169
+ # 7. Any relevant network failures?
170
+ npx playwright trace requests --failed
171
+
172
+ # 8. Any console errors?
173
+ npx playwright trace console --errors-only
174
+ ```