@guanlin4924/devflow-pi 0.1.93 → 0.1.95

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 (369) hide show
  1. package/README.md +10 -10
  2. package/node_modules/@playwright/test/LICENSE +202 -0
  3. package/node_modules/@playwright/test/NOTICE +5 -0
  4. package/node_modules/@playwright/test/README.md +318 -0
  5. package/node_modules/@playwright/test/cli.js +19 -0
  6. package/node_modules/@playwright/test/index.d.ts +18 -0
  7. package/node_modules/@playwright/test/index.js +17 -0
  8. package/node_modules/@playwright/test/index.mjs +18 -0
  9. package/node_modules/@playwright/test/package.json +35 -0
  10. package/node_modules/@playwright/test/reporter.d.ts +17 -0
  11. package/node_modules/@playwright/test/reporter.js +17 -0
  12. package/node_modules/@playwright/test/reporter.mjs +17 -0
  13. package/node_modules/playwright/LICENSE +202 -0
  14. package/node_modules/playwright/NOTICE +5 -0
  15. package/node_modules/playwright/README.md +318 -0
  16. package/node_modules/playwright/ThirdPartyNotices.txt +14 -0
  17. package/node_modules/playwright/cli.js +19 -0
  18. package/node_modules/playwright/index.d.ts +17 -0
  19. package/node_modules/playwright/index.js +17 -0
  20. package/node_modules/playwright/index.mjs +18 -0
  21. package/node_modules/playwright/jsx-runtime.js +42 -0
  22. package/node_modules/playwright/jsx-runtime.mjs +21 -0
  23. package/node_modules/playwright/lib/agents/agentParser.js +89 -0
  24. package/node_modules/playwright/lib/agents/copilot-setup-steps.yml +34 -0
  25. package/node_modules/playwright/lib/agents/generateAgents.js +395 -0
  26. package/node_modules/playwright/lib/agents/playwright-test-coverage.prompt.md +31 -0
  27. package/node_modules/playwright/lib/agents/playwright-test-generate.prompt.md +8 -0
  28. package/node_modules/playwright/lib/agents/playwright-test-generator.agent.md +88 -0
  29. package/node_modules/playwright/lib/agents/playwright-test-heal.prompt.md +6 -0
  30. package/node_modules/playwright/lib/agents/playwright-test-healer.agent.md +56 -0
  31. package/node_modules/playwright/lib/agents/playwright-test-plan.prompt.md +9 -0
  32. package/node_modules/playwright/lib/agents/playwright-test-planner.agent.md +74 -0
  33. package/node_modules/playwright/lib/cli/reportActions.js +78 -0
  34. package/node_modules/playwright/lib/cli/testActions.js +214 -0
  35. package/node_modules/playwright/lib/common/index.js +2923 -0
  36. package/node_modules/playwright/lib/common/index.js.txt +34 -0
  37. package/node_modules/playwright/lib/errorContext.js +129 -0
  38. package/node_modules/playwright/lib/globals.js +58 -0
  39. package/node_modules/playwright/lib/index.js +815 -0
  40. package/node_modules/playwright/lib/isomorphic.js +260 -0
  41. package/node_modules/playwright/lib/isomorphic.js.txt +9 -0
  42. package/node_modules/playwright/lib/loader/loaderProcessEntry.js +34 -0
  43. package/node_modules/playwright/lib/loader/loaderProcessEntry.js.txt +9 -0
  44. package/node_modules/playwright/lib/matchers/expect.js +13490 -0
  45. package/node_modules/playwright/lib/matchers/expect.js.LICENSE +640 -0
  46. package/node_modules/playwright/lib/matchers/expect.js.txt +67 -0
  47. package/node_modules/playwright/lib/mcp/test/browserBackend.js +135 -0
  48. package/node_modules/playwright/lib/mcp/test/generatorTools.js +122 -0
  49. package/node_modules/playwright/lib/mcp/test/plannerTools.js +150 -0
  50. package/node_modules/playwright/lib/mcp/test/seed.js +82 -0
  51. package/node_modules/playwright/lib/mcp/test/streams.js +44 -0
  52. package/node_modules/playwright/lib/mcp/test/testBackend.js +99 -0
  53. package/node_modules/playwright/lib/mcp/test/testContext.js +306 -0
  54. package/node_modules/playwright/lib/mcp/test/testTool.js +30 -0
  55. package/node_modules/playwright/lib/mcp/test/testTools.js +98 -0
  56. package/node_modules/playwright/lib/package.js +47 -0
  57. package/node_modules/playwright/lib/program.js +241 -0
  58. package/node_modules/playwright/lib/runner/index.js +8527 -0
  59. package/node_modules/playwright/lib/runner/index.js.txt +61 -0
  60. package/node_modules/playwright/lib/transform/babelBundle.js +72274 -0
  61. package/node_modules/playwright/lib/transform/babelBundle.js.LICENSE +2384 -0
  62. package/node_modules/playwright/lib/transform/babelBundle.js.txt +325 -0
  63. package/node_modules/playwright/lib/transform/esmLoader.js +8054 -0
  64. package/node_modules/playwright/lib/transform/esmLoader.js.LICENSE +355 -0
  65. package/node_modules/playwright/lib/transform/esmLoader.js.txt +60 -0
  66. package/node_modules/playwright/lib/util.js +373 -0
  67. package/node_modules/playwright/lib/worker/workerProcessEntry.js +1861 -0
  68. package/node_modules/playwright/lib/worker/workerProcessEntry.js.txt +19 -0
  69. package/node_modules/playwright/package.json +55 -0
  70. package/node_modules/playwright/test.d.ts +18 -0
  71. package/node_modules/playwright/test.js +24 -0
  72. package/node_modules/playwright/test.mjs +35 -0
  73. package/node_modules/playwright/types/test.d.ts +11074 -0
  74. package/node_modules/playwright/types/testReporter.d.ts +950 -0
  75. package/node_modules/playwright-core/LICENSE +202 -0
  76. package/node_modules/playwright-core/NOTICE +5 -0
  77. package/node_modules/playwright-core/README.md +3 -0
  78. package/node_modules/playwright-core/ThirdPartyNotices.txt +13 -0
  79. package/node_modules/playwright-core/bin/install_media_pack.ps1 +5 -0
  80. package/node_modules/playwright-core/bin/install_webkit_wsl.ps1 +33 -0
  81. package/node_modules/playwright-core/bin/reinstall_chrome_beta_linux.sh +42 -0
  82. package/node_modules/playwright-core/bin/reinstall_chrome_beta_mac.sh +13 -0
  83. package/node_modules/playwright-core/bin/reinstall_chrome_beta_win.ps1 +24 -0
  84. package/node_modules/playwright-core/bin/reinstall_chrome_stable_linux.sh +42 -0
  85. package/node_modules/playwright-core/bin/reinstall_chrome_stable_mac.sh +12 -0
  86. package/node_modules/playwright-core/bin/reinstall_chrome_stable_win.ps1 +24 -0
  87. package/node_modules/playwright-core/bin/reinstall_msedge_beta_linux.sh +48 -0
  88. package/node_modules/playwright-core/bin/reinstall_msedge_beta_mac.sh +11 -0
  89. package/node_modules/playwright-core/bin/reinstall_msedge_beta_win.ps1 +23 -0
  90. package/node_modules/playwright-core/bin/reinstall_msedge_dev_linux.sh +48 -0
  91. package/node_modules/playwright-core/bin/reinstall_msedge_dev_mac.sh +11 -0
  92. package/node_modules/playwright-core/bin/reinstall_msedge_dev_win.ps1 +23 -0
  93. package/node_modules/playwright-core/bin/reinstall_msedge_stable_linux.sh +48 -0
  94. package/node_modules/playwright-core/bin/reinstall_msedge_stable_mac.sh +11 -0
  95. package/node_modules/playwright-core/bin/reinstall_msedge_stable_win.ps1 +24 -0
  96. package/node_modules/playwright-core/browsers.json +52 -0
  97. package/node_modules/playwright-core/cli.js +21 -0
  98. package/node_modules/playwright-core/index.d.ts +17 -0
  99. package/node_modules/playwright-core/index.js +17 -0
  100. package/node_modules/playwright-core/index.mjs +28 -0
  101. package/node_modules/playwright-core/lib/bootstrap.js +88 -0
  102. package/node_modules/playwright-core/lib/coreBundle.js +75813 -0
  103. package/node_modules/playwright-core/lib/entry/cliDaemon.js +5 -0
  104. package/node_modules/playwright-core/lib/entry/dashboardApp.js +3 -0
  105. package/node_modules/playwright-core/lib/entry/mcp.js +10 -0
  106. package/node_modules/playwright-core/lib/entry/oopBrowserDownload.js +3 -0
  107. package/node_modules/playwright-core/lib/package.js +50 -0
  108. package/node_modules/playwright-core/lib/server/chromium/appIcon.png +0 -0
  109. package/node_modules/playwright-core/lib/server/electron/loader.js +116 -0
  110. package/node_modules/playwright-core/lib/serverRegistry.js +1939 -0
  111. package/node_modules/playwright-core/lib/serverRegistry.js.LICENSE +65 -0
  112. package/node_modules/playwright-core/lib/tools/cli-client/channelSessions.js +141 -0
  113. package/node_modules/playwright-core/lib/tools/cli-client/cli.js +6 -0
  114. package/node_modules/playwright-core/lib/tools/cli-client/help.json +721 -0
  115. package/node_modules/playwright-core/lib/tools/cli-client/minimist.js +128 -0
  116. package/node_modules/playwright-core/lib/tools/cli-client/output.js +351 -0
  117. package/node_modules/playwright-core/lib/tools/cli-client/program.js +418 -0
  118. package/node_modules/playwright-core/lib/tools/cli-client/registry.js +180 -0
  119. package/node_modules/playwright-core/lib/tools/cli-client/session.js +259 -0
  120. package/node_modules/playwright-core/lib/tools/dashboard/appIcon.png +0 -0
  121. package/node_modules/playwright-core/lib/tools/skills/playwright-cli/SKILL.md +425 -0
  122. package/node_modules/playwright-core/lib/tools/skills/playwright-cli/references/element-attributes.md +23 -0
  123. package/node_modules/playwright-core/lib/tools/skills/playwright-cli/references/playwright-tests.md +39 -0
  124. package/node_modules/playwright-core/lib/tools/skills/playwright-cli/references/request-mocking.md +87 -0
  125. package/node_modules/playwright-core/lib/tools/skills/playwright-cli/references/running-code.md +241 -0
  126. package/node_modules/playwright-core/lib/tools/skills/playwright-cli/references/session-management.md +225 -0
  127. package/node_modules/playwright-core/lib/tools/skills/playwright-cli/references/storage-state.md +275 -0
  128. package/node_modules/playwright-core/lib/tools/skills/playwright-cli/references/test-generation.md +433 -0
  129. package/node_modules/playwright-core/lib/tools/skills/playwright-cli/references/tracing.md +139 -0
  130. package/node_modules/playwright-core/lib/tools/skills/playwright-cli/references/video-recording.md +143 -0
  131. package/node_modules/playwright-core/lib/tools/skills/playwright-component-testing/SKILL.md +136 -0
  132. package/node_modules/playwright-core/lib/tools/skills/playwright-component-testing/references/gallery-spec.md +144 -0
  133. package/node_modules/playwright-core/lib/tools/skills/playwright-component-testing/references/migration.md +89 -0
  134. package/node_modules/playwright-core/lib/tools/skills/playwright-component-testing/references/react.md +69 -0
  135. package/node_modules/playwright-core/lib/tools/skills/playwright-component-testing/references/typing.md +173 -0
  136. package/node_modules/playwright-core/lib/tools/skills/playwright-component-testing/references/vue.md +77 -0
  137. package/node_modules/playwright-core/lib/tools/skills/playwright-trace/SKILL.md +174 -0
  138. package/node_modules/playwright-core/lib/tools/utils/extension.js +112 -0
  139. package/node_modules/playwright-core/lib/tools/utils/socketConnection.js +108 -0
  140. package/node_modules/playwright-core/lib/utilsBundle.js +85357 -0
  141. package/node_modules/playwright-core/lib/utilsBundle.js.LICENSE +1890 -0
  142. package/node_modules/playwright-core/lib/vite/dashboard/assets/codeMirrorModule--QdMvsKi.css +1 -0
  143. package/node_modules/playwright-core/lib/vite/dashboard/assets/codeMirrorModule-CQ8RZGBm.js +32 -0
  144. package/node_modules/playwright-core/lib/vite/dashboard/assets/codicon-DCmgc-ay.ttf +0 -0
  145. package/node_modules/playwright-core/lib/vite/dashboard/assets/firefox-1bWoP6pv.svg +1 -0
  146. package/node_modules/playwright-core/lib/vite/dashboard/assets/firefox-beta-k3eOH_eK.svg +1 -0
  147. package/node_modules/playwright-core/lib/vite/dashboard/assets/firefox-nightly-Cp5nfeDT.svg +1 -0
  148. package/node_modules/playwright-core/lib/vite/dashboard/assets/index-AwgwcYie.css +1 -0
  149. package/node_modules/playwright-core/lib/vite/dashboard/assets/index-hRvO4yU2.js +12 -0
  150. package/node_modules/playwright-core/lib/vite/dashboard/assets/safari-na3_-uQk.svg +1 -0
  151. package/node_modules/playwright-core/lib/vite/dashboard/index.html +29 -0
  152. package/node_modules/playwright-core/lib/vite/dashboard/playwright-logo.svg +24 -0
  153. package/node_modules/playwright-core/lib/vite/htmlReport/index.html +16 -0
  154. package/node_modules/playwright-core/lib/vite/htmlReport/report.css +2 -0
  155. package/node_modules/playwright-core/lib/vite/htmlReport/report.js +32 -0
  156. package/node_modules/playwright-core/lib/vite/recorder/assets/codeMirrorModule--QdMvsKi.css +1 -0
  157. package/node_modules/playwright-core/lib/vite/recorder/assets/codeMirrorModule-CVQWJZAA.js +32 -0
  158. package/node_modules/playwright-core/lib/vite/recorder/assets/codicon-DCmgc-ay.ttf +0 -0
  159. package/node_modules/playwright-core/lib/vite/recorder/assets/index-BZpYJZ-P.css +1 -0
  160. package/node_modules/playwright-core/lib/vite/recorder/assets/index-hrlLqLtq.js +129 -0
  161. package/node_modules/playwright-core/lib/vite/recorder/index.html +29 -0
  162. package/node_modules/playwright-core/lib/vite/recorder/playwright-logo.svg +9 -0
  163. package/node_modules/playwright-core/lib/vite/traceViewer/assets/codeMirrorModule-BbkfBe3n.js +32 -0
  164. package/node_modules/playwright-core/lib/vite/traceViewer/assets/defaultSettingsView-Ds6CBOo0.js +182 -0
  165. package/node_modules/playwright-core/lib/vite/traceViewer/assets/urlMatch-L3liM589.js +1 -0
  166. package/node_modules/playwright-core/lib/vite/traceViewer/assets/xtermModule-DywYcAf8.js +7 -0
  167. package/node_modules/playwright-core/lib/vite/traceViewer/codeMirrorModule.-QdMvsKi.css +1 -0
  168. package/node_modules/playwright-core/lib/vite/traceViewer/codicon.DCmgc-ay.ttf +0 -0
  169. package/node_modules/playwright-core/lib/vite/traceViewer/defaultSettingsView.Bqk9acqE.css +1 -0
  170. package/node_modules/playwright-core/lib/vite/traceViewer/index.B4cLoZK3.js +1 -0
  171. package/node_modules/playwright-core/lib/vite/traceViewer/index.B_TqY17P.css +1 -0
  172. package/node_modules/playwright-core/lib/vite/traceViewer/index.html +44 -0
  173. package/node_modules/playwright-core/lib/vite/traceViewer/manifest.webmanifest +16 -0
  174. package/node_modules/playwright-core/lib/vite/traceViewer/playwright-logo.svg +9 -0
  175. package/node_modules/playwright-core/lib/vite/traceViewer/snapshot.B_Jk1wbt.js +1 -0
  176. package/node_modules/playwright-core/lib/vite/traceViewer/snapshot.html +10 -0
  177. package/node_modules/playwright-core/lib/vite/traceViewer/sw.bundle.js +4 -0
  178. package/node_modules/playwright-core/lib/vite/traceViewer/uiMode.CU5KtEkS.js +5 -0
  179. package/node_modules/playwright-core/lib/vite/traceViewer/uiMode.CyMfwkXJ.css +1 -0
  180. package/node_modules/playwright-core/lib/vite/traceViewer/uiMode.html +18 -0
  181. package/node_modules/playwright-core/lib/vite/traceViewer/xtermModule.kHJ-D0s7.css +1 -0
  182. package/node_modules/playwright-core/lib/webp_codec.LICENSE +173 -0
  183. package/node_modules/playwright-core/lib/webp_codec.wasm +0 -0
  184. package/node_modules/playwright-core/lib/xdg-open +1267 -0
  185. package/node_modules/playwright-core/package.json +34 -0
  186. package/node_modules/playwright-core/types/protocol.d.ts +24645 -0
  187. package/node_modules/playwright-core/types/structs.d.ts +52 -0
  188. package/node_modules/playwright-core/types/types.d.ts +26632 -0
  189. package/package.json +12 -2
  190. package/plugins/devflow-core/extensions/devflow-core.ts +518 -40
  191. package/plugins/devflow-core/runtime/hooks/context_sync_gate.py +3 -3
  192. package/plugins/devflow-core/runtime/hooks/hook_common.py +334 -11
  193. package/plugins/devflow-core/runtime/hooks/index_gate.py +29 -16
  194. package/plugins/devflow-core/runtime/hooks/start.py +13 -13
  195. package/plugins/devflow-core/skills/wireframe-proposal/SKILL.md +2 -2
  196. package/plugins/devflow-core/skills/wireframe-validate/SKILL.md +4 -4
  197. package/plugins/devflow-core/skills/workflow-orchestrator/SKILL.md +19 -19
  198. package/plugins/devflow-core/skills/workflow-orchestrator/agents/openai.yaml +2 -2
  199. package/plugins/devflow-core/skills/workflow-orchestrator/scripts/acceptance_test_runner.py +412 -76
  200. package/plugins/devflow-core/skills/workflow-orchestrator/scripts/advance_state.rb +60 -9
  201. package/plugins/devflow-core/skills/workflow-orchestrator/scripts/api_test_matrix.py +2 -2
  202. package/plugins/devflow-core/skills/workflow-orchestrator/scripts/approval_pins.py +433 -0
  203. package/plugins/devflow-core/skills/workflow-orchestrator/scripts/approval_store.py +137 -0
  204. package/plugins/devflow-core/skills/workflow-orchestrator/scripts/architecture_assessment.rb +1 -1
  205. package/plugins/devflow-core/skills/workflow-orchestrator/scripts/architecture_brief.rb +1 -1
  206. package/plugins/devflow-core/skills/workflow-orchestrator/scripts/architecture_feasibility.rb +1 -1
  207. package/plugins/devflow-core/skills/workflow-orchestrator/scripts/business_invalidation.rb +5 -5
  208. package/plugins/devflow-core/skills/workflow-orchestrator/scripts/business_model_commit.rb +4 -4
  209. package/plugins/devflow-core/skills/workflow-orchestrator/scripts/business_model_validate.py +1 -1
  210. package/plugins/devflow-core/skills/workflow-orchestrator/scripts/business_source_resolver.rb +4 -4
  211. package/plugins/devflow-core/skills/workflow-orchestrator/scripts/checker_adapter.rb +7 -7
  212. package/plugins/devflow-core/skills/workflow-orchestrator/scripts/control_io.rb +51 -7
  213. package/plugins/devflow-core/skills/workflow-orchestrator/scripts/cross_track_consistency_check.rb +1 -1
  214. package/plugins/devflow-core/skills/workflow-orchestrator/scripts/dsl_coverage.py +87 -0
  215. package/plugins/devflow-core/skills/workflow-orchestrator/scripts/dsl_v1.py +318 -0
  216. package/plugins/devflow-core/skills/workflow-orchestrator/scripts/environment_profile.py +134 -0
  217. package/plugins/devflow-core/skills/workflow-orchestrator/scripts/execution_contract.rb +7 -6
  218. package/plugins/devflow-core/skills/workflow-orchestrator/scripts/execution_surface.py +138 -0
  219. package/plugins/devflow-core/skills/workflow-orchestrator/scripts/gate_runtime.rb +3 -3
  220. package/plugins/devflow-core/skills/workflow-orchestrator/scripts/init_state.rb +5 -5
  221. package/plugins/devflow-core/skills/workflow-orchestrator/scripts/init_workflow.rb +5 -5
  222. package/plugins/devflow-core/skills/workflow-orchestrator/scripts/inspect_state.rb +13 -13
  223. package/plugins/devflow-core/skills/workflow-orchestrator/scripts/machine_evidence.rb +3 -3
  224. package/plugins/devflow-core/skills/workflow-orchestrator/scripts/manage_lessons.rb +7 -7
  225. package/plugins/devflow-core/skills/workflow-orchestrator/scripts/parallel_recover.rb +2 -2
  226. package/plugins/devflow-core/skills/workflow-orchestrator/scripts/parallel_run.rb +3 -3
  227. package/plugins/devflow-core/skills/workflow-orchestrator/scripts/phase_ownership.rb +6 -6
  228. package/plugins/devflow-core/skills/workflow-orchestrator/scripts/playwright_adapter.py +515 -0
  229. package/plugins/devflow-core/skills/workflow-orchestrator/scripts/repair_control_plane.rb +1 -1
  230. package/plugins/devflow-core/skills/workflow-orchestrator/scripts/requirement_coverage.rb +1 -1
  231. package/plugins/devflow-core/skills/workflow-orchestrator/scripts/requirement_graph.rb +3 -3
  232. package/plugins/devflow-core/skills/workflow-orchestrator/scripts/review_preflight.py +3 -3
  233. package/plugins/devflow-core/skills/workflow-orchestrator/scripts/review_run.py +18 -18
  234. package/plugins/devflow-core/skills/workflow-orchestrator/scripts/runtime_context_collector.rb +3 -3
  235. package/plugins/devflow-core/skills/workflow-orchestrator/scripts/session_rollover.rb +4 -4
  236. package/plugins/devflow-core/skills/workflow-orchestrator/scripts/static_runtime_context_collector.rb +2 -2
  237. package/plugins/devflow-core/skills/workflow-orchestrator/scripts/sync_artifacts.rb +5 -5
  238. package/plugins/devflow-core/skills/workflow-orchestrator/scripts/tc_hash.py +132 -0
  239. package/plugins/devflow-core/skills/workflow-orchestrator/scripts/tdd_evidence.py +3 -3
  240. package/plugins/devflow-core/skills/workflow-orchestrator/scripts/test_command_policy.py +104 -10
  241. package/plugins/devflow-core/skills/workflow-orchestrator/scripts/test_task_binding_check.py +3 -3
  242. package/plugins/devflow-core/skills/workflow-orchestrator/scripts/update_triage_route.rb +3 -3
  243. package/plugins/devflow-core/skills/workflow-orchestrator/scripts/validate_state.rb +19 -6
  244. package/plugins/devflow-core/skills/workflow-orchestrator/scripts/wireframe_commit.rb +5 -5
  245. package/plugins/devflow-core/skills/workflow-orchestrator/scripts/wireframe_validate.py +1 -1
  246. package/plugins/devflow-core/skills/workflow-orchestrator/templates/acceptance-remediation.yaml +12 -12
  247. package/plugins/devflow-core/skills/workflow-orchestrator/templates/feature-development.yaml +201 -222
  248. package/plugins/devflow-core/skills/workflow-pipeline/SKILL.md +6 -4
  249. package/plugins/devflow-core/skills/workflow-pipeline/references/pipeline-flow.md +68 -140
  250. package/plugins/devflow-core/skills/workflow-project-context/SKILL.md +14 -14
  251. package/plugins/devflow-core/skills/workflow-project-context/assets/agents-md-template.md +7 -7
  252. package/plugins/devflow-core/skills/workflow-project-context/assets/codebase-backend-spec-template.md +4 -4
  253. package/plugins/devflow-core/skills/workflow-project-context/assets/codebase-frontend-spec-template.md +4 -4
  254. package/plugins/devflow-core/skills/workflow-project-context/assets/codebase-navigation-template.md +1 -1
  255. package/plugins/devflow-core/skills/workflow-project-context/assets/context-domain-index-template.md +4 -4
  256. package/plugins/devflow-core/skills/workflow-project-context/assets/context-spec-index-template.md +10 -10
  257. package/plugins/devflow-core/skills/workflow-project-context/assets/execution-contract-template.md +2 -2
  258. package/plugins/devflow-core/skills/workflow-project-context/assets/navigation-index-template.md +18 -18
  259. package/plugins/devflow-core/skills/workflow-project-context/assets/project-initialization-template.md +32 -32
  260. package/plugins/devflow-core/skills/workflow-project-context/assets/rules-index-template.md +30 -30
  261. package/plugins/devflow-core/skills/workflow-project-context/assets/state-template.md +7 -7
  262. package/plugins/devflow-core/skills/workflow-project-context/references/navigation-guide.md +37 -37
  263. package/plugins/devflow-core/skills/workflow-project-context/scripts/validate_initialization.py +16 -16
  264. package/plugins/devflow-core/skills/workflow-project-context/scripts/validate_initialization_database.py +1 -1
  265. package/plugins/devflow-design/skills/workflow-api-call-guide/SKILL.md +4 -4
  266. package/plugins/devflow-design/skills/workflow-api-contract/SKILL.md +8 -8
  267. package/plugins/devflow-design/skills/workflow-api-supplement/SKILL.md +5 -5
  268. package/plugins/devflow-design/skills/workflow-architecture-feasibility/SKILL.md +1 -1
  269. package/plugins/devflow-design/skills/workflow-backend-tech-spec/SKILL.md +39 -39
  270. package/plugins/devflow-design/skills/workflow-backend-tech-spec/assets/backend-spec-template.md +10 -10
  271. package/plugins/devflow-design/skills/workflow-backend-tech-spec/references/affected-module-exploration.md +2 -2
  272. package/plugins/devflow-design/skills/workflow-backend-tech-spec/references/code-explore-guide.md +1 -1
  273. package/plugins/devflow-design/skills/workflow-backend-tech-spec/references/project-rule-contract.md +20 -20
  274. package/plugins/devflow-design/skills/workflow-design-rule-pack/SKILL.md +8 -8
  275. package/plugins/devflow-design/skills/workflow-design-rule-pack/assets/design/index.md +3 -3
  276. package/plugins/devflow-design/skills/workflow-design-rule-pack/assets/design/recommendations/accessibility.md +2 -2
  277. package/plugins/devflow-design/skills/workflow-design-rule-pack/assets/design/recommendations/component-library.md +2 -2
  278. package/plugins/devflow-design/skills/workflow-design-rule-pack/assets/design/recommendations/design-systems.md +1 -1
  279. package/plugins/devflow-design/skills/workflow-design-rule-pack/assets/design/recommendations/responsive-grid.md +2 -2
  280. package/plugins/devflow-design/skills/workflow-design-rule-pack/assets/design/recommendations/stack-guidelines.md +6 -6
  281. package/plugins/devflow-design/skills/workflow-design-rule-pack/assets/design/recommendations/ux-patterns.md +2 -2
  282. package/plugins/devflow-design/skills/workflow-design-rule-pack/assets/design/tokens/project-tokens.md +1 -1
  283. package/plugins/devflow-design/skills/workflow-design-rule-pack/assets/design/tools/ui-ux-pro-max/SKILL.md +12 -12
  284. package/plugins/devflow-design/skills/workflow-design-rule-pack/scripts/install.py +2 -2
  285. package/plugins/devflow-design/skills/workflow-feature-breakdown/SKILL.md +30 -30
  286. package/plugins/devflow-design/skills/workflow-feature-breakdown/assets/output-template.md +2 -2
  287. package/plugins/devflow-design/skills/workflow-frontend-tech-spec/SKILL.md +41 -41
  288. package/plugins/devflow-design/skills/workflow-frontend-tech-spec/assets/frontend-spec-template.md +15 -15
  289. package/plugins/devflow-design/skills/workflow-frontend-tech-spec/references/affected-module-exploration.md +2 -2
  290. package/plugins/devflow-design/skills/workflow-frontend-tech-spec/references/project-rule-contract.md +25 -25
  291. package/plugins/devflow-design/skills/workflow-integration-verify/SKILL.md +13 -13
  292. package/plugins/devflow-design/skills/workflow-ui-spec/SKILL.md +23 -23
  293. package/plugins/devflow-design/skills/workflow-ui-spec/assets/ui-spec-template.md +3 -3
  294. package/plugins/devflow-implementation/agents/implementation-worker.md +2 -2
  295. package/plugins/devflow-implementation/skills/workflow-bug-fix/SKILL.md +9 -9
  296. package/plugins/devflow-implementation/skills/workflow-bug-fix/references/lesson-format.md +2 -2
  297. package/plugins/devflow-implementation/skills/workflow-bug-fix/references/root-cause-ladder.md +1 -1
  298. package/plugins/devflow-implementation/skills/workflow-change-plan/SKILL.md +17 -17
  299. package/plugins/devflow-implementation/skills/workflow-change-plan/references/code-conventions.md +1 -1
  300. package/plugins/devflow-implementation/skills/workflow-change-plan/references/output-template.md +3 -3
  301. package/plugins/devflow-implementation/skills/workflow-change-plan/references/project-rule-contract.md +16 -16
  302. package/plugins/devflow-implementation/skills/workflow-execute-phase/SKILL.md +38 -38
  303. package/plugins/devflow-implementation/skills/workflow-execute-phase/references/execute-phase.md +4 -2
  304. package/plugins/devflow-intel/agents/project-scout.md +1 -1
  305. package/plugins/devflow-intel/extensions/devflow-intel.ts +20 -19
  306. package/plugins/devflow-intel/skills/code-index-query/SKILL.md +6 -6
  307. package/plugins/devflow-intel/skills/workflow-code-index/SKILL.md +12 -12
  308. package/plugins/devflow-intel/skills/workflow-code-index/references/discovery.md +2 -2
  309. package/plugins/devflow-intel/skills/workflow-code-index/references/query-guide.md +1 -1
  310. package/plugins/devflow-intel/skills/workflow-code-index/scripts/code_index.py +31 -12
  311. package/plugins/devflow-intel/skills/workflow-code-index/scripts/core/discovery.py +2 -2
  312. package/plugins/devflow-intel/skills/workflow-code-index/scripts/core/scanner.py +4 -1
  313. package/plugins/devflow-intel/skills/workflow-code-index/scripts/validators/project_binding_check.py +4 -4
  314. package/plugins/devflow-intel/skills/workflow-context-sync/SKILL.md +14 -14
  315. package/plugins/devflow-intel/skills/workflow-context-sync/scripts/context_sync_cursor.py +2 -2
  316. package/plugins/devflow-intel/skills/workflow-update-navigation/SKILL.md +26 -26
  317. package/plugins/devflow-intel/skills/workflow-update-navigation/references/incremental-update-guide.md +2 -2
  318. package/plugins/devflow-quality/runtime/playwright/devflow-test-dsl-v1.schema.json +872 -0
  319. package/plugins/devflow-quality/runtime/playwright/playwright.config.mjs +46 -0
  320. package/plugins/devflow-quality/runtime/playwright/reporter.mjs +311 -0
  321. package/plugins/devflow-quality/runtime/playwright/runner.spec.mjs +1308 -0
  322. package/plugins/devflow-quality/runtime/playwright/runtime-manifest.json +11 -0
  323. package/plugins/devflow-quality/skills/code-review/SKILL.md +12 -12
  324. package/plugins/devflow-quality/skills/code-review/references/spec-checklist.md +1 -1
  325. package/plugins/devflow-quality/skills/workflow-acceptance-test-design/SKILL.md +11 -8
  326. package/plugins/devflow-quality/skills/workflow-gen-test-guide/SKILL.md +6 -6
  327. package/plugins/devflow-quality/skills/workflow-gen-test-guide/legacy/SKILL.md +14 -14
  328. package/plugins/devflow-quality/skills/workflow-generate-mainflow-cases/SKILL.md +82 -69
  329. package/plugins/devflow-quality/skills/workflow-generate-mainflow-cases/references/api-mainflow-rules.md +20 -15
  330. package/plugins/devflow-quality/skills/workflow-generate-mainflow-cases/references/codebase-discovery.md +12 -10
  331. package/plugins/devflow-quality/skills/workflow-generate-mainflow-cases/references/intermediate-format.md +115 -192
  332. package/plugins/devflow-quality/skills/workflow-generate-mainflow-cases/references/mainflow-selection.md +27 -23
  333. package/plugins/devflow-quality/skills/workflow-generate-mainflow-cases/references/project-dsl-contract.md +78 -153
  334. package/plugins/devflow-quality/skills/workflow-generate-mainflow-cases/references/ui-mainflow-rules.md +36 -83
  335. package/plugins/devflow-quality/skills/workflow-generate-mainflow-cases/scripts/compile_dsl.py +497 -556
  336. package/plugins/devflow-quality/skills/workflow-generate-mainflow-cases/scripts/discover_codebases.py +2 -2
  337. package/plugins/devflow-quality/skills/workflow-generate-mainflow-cases/scripts/export_legacy_testagent.py +647 -0
  338. package/plugins/devflow-quality/skills/workflow-generate-mainflow-cases/scripts/normalize_case_payloads.py +10 -3
  339. package/plugins/devflow-quality/skills/workflow-generate-mainflow-cases/scripts/validate_case_payloads.py +165 -275
  340. package/plugins/devflow-quality/skills/workflow-human-acceptance/SKILL.md +61 -0
  341. package/plugins/devflow-quality/skills/workflow-release-closeout/SKILL.md +18 -18
  342. package/plugins/devflow-quality/skills/workflow-run-acceptance-tests/SKILL.md +20 -14
  343. package/plugins/devflow-requirements/skills/requirement-feasibility-review/SKILL.md +1 -1
  344. package/plugins/devflow-requirements/skills/workflow-demand-clarify/SKILL.md +10 -10
  345. package/plugins/devflow-requirements/skills/workflow-domain-modeling/SKILL.md +25 -25
  346. package/plugins/devflow-requirements/skills/workflow-requirement-baseline/SKILL.md +49 -49
  347. package/plugins/devflow-requirements/skills/workflow-requirement-baseline/assets/baseline-template.md +22 -22
  348. package/plugins/devflow-requirements/skills/workflow-requirement-baseline/references/antipatterns.md +3 -3
  349. package/plugins/devflow-requirements/skills/workflow-requirement-baseline/references/challenge-review-guide.md +3 -3
  350. package/plugins/devflow-requirements/skills/workflow-requirement-baseline/references/project-context-guide.md +11 -11
  351. package/plugins/devflow-requirements/skills/workflow-requirement-baseline/references/questioning.md +1 -1
  352. package/plugins/devflow-requirements/skills/workflow-requirement-baseline/references/requirement-review-checklist.md +4 -4
  353. package/plugins/devflow-requirements/skills/workflow-requirement-triage/SKILL.md +16 -16
  354. package/plugins/devflow-requirements/skills/workflow-wayfinder/SKILL.md +6 -6
  355. package/src/approval-store.ts +340 -0
  356. package/src/cli.ts +15 -0
  357. package/src/constants.ts +1 -1
  358. package/src/doctor.ts +259 -2
  359. package/src/initialization-store.ts +51 -3
  360. package/src/paths.ts +12 -1
  361. package/src/project-context.ts +60 -15
  362. package/src/project-documents.ts +61 -61
  363. package/src/project-initializer.ts +9 -8
  364. package/src/project-layout.ts +217 -0
  365. package/src/runtime.ts +3 -3
  366. package/templates/commands/start.md +4 -4
  367. package/templates/omp/AGENTS.md +1 -1
  368. package/templates/omp/hook-config.json +13 -7
  369. package/templates/omp/index-policy.json +8 -8
@@ -0,0 +1,815 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var index_exports = {};
30
+ __export(index_exports, {
31
+ _baseTest: () => _baseTest,
32
+ _utilityTest: () => _utilityTest,
33
+ defineConfig: () => import_common2.defineConfig,
34
+ expect: () => import_expect.expect,
35
+ mergeExpects: () => import_expect2.mergeExpects,
36
+ mergeTests: () => import_common2.mergeTests,
37
+ test: () => test
38
+ });
39
+ module.exports = __toCommonJS(index_exports);
40
+ var import_fs = __toESM(require("fs"));
41
+ var import_path = __toESM(require("path"));
42
+ var playwrightLibrary = __toESM(require("playwright-core"));
43
+ var import_errorContext = require("./errorContext");
44
+ var import_common = require("./common");
45
+ var globals = __toESM(require("./globals"));
46
+ var import_browserBackend = require("./mcp/test/browserBackend");
47
+ var import_expect = require("./matchers/expect");
48
+ var import_common2 = require("./common");
49
+ var import_expect2 = require("./matchers/expect");
50
+ const { getActionGroup, renderParamsForCall, renderSubtitleForCall, renderTitleForCall, truncateParam } = require("playwright-core/lib/coreBundle").iso;
51
+ const { escapeHTML } = require("playwright-core/lib/coreBundle").iso;
52
+ const { jsonStringifyForceASCII } = require("playwright-core/lib/coreBundle").utils;
53
+ const { createGuid } = require("playwright-core/lib/coreBundle").utils;
54
+ const { debugMode } = require("playwright-core/lib/coreBundle").utils;
55
+ const { debugLogger } = require("playwright-core/lib/coreBundle").utils;
56
+ const { currentZone } = require("playwright-core/lib/coreBundle").utils;
57
+ const _baseTest = import_common.testType.rootTestType.test;
58
+ if (process["__pw_initiator__"]) {
59
+ const originalStackTraceLimit = Error.stackTraceLimit;
60
+ Error.stackTraceLimit = 200;
61
+ try {
62
+ throw new Error("Requiring @playwright/test second time, \nFirst:\n" + process["__pw_initiator__"] + "\n\nSecond: ");
63
+ } finally {
64
+ Error.stackTraceLimit = originalStackTraceLimit;
65
+ }
66
+ } else {
67
+ process["__pw_initiator__"] = new Error().stack;
68
+ }
69
+ const utilityFixtures = {
70
+ playwright: [async ({}, use) => {
71
+ await use(require("playwright-core"));
72
+ }, { scope: "worker", box: true }],
73
+ screenshot: ["off", { scope: "worker", option: true, box: true }],
74
+ trace: ["off", { scope: "worker", option: true, box: true }],
75
+ testIdAttribute: ["data-testid", { option: true, box: true }],
76
+ _combinedContextOptions: [{}, { box: true }],
77
+ _setupArtifacts: [async ({ playwright, screenshot, _combinedContextOptions }, use, testInfo) => {
78
+ testInfo.setTimeout(testInfo.project.timeout);
79
+ const artifactsRecorder = new ArtifactsRecorder(playwright, tracing().artifactsDir(), screenshot);
80
+ await artifactsRecorder.willStartTest(testInfo);
81
+ const tracingGroupSteps = [];
82
+ const pausedContexts = /* @__PURE__ */ new Set();
83
+ const csiListener = {
84
+ onApiCallBegin: (data, channel) => {
85
+ const testInfo2 = globals.currentTestInfo();
86
+ if (!testInfo2)
87
+ return;
88
+ if (channel.type === "Tracing" && channel.method === "tracingGroupEnd") {
89
+ data.userData = (error) => tracingGroupSteps.pop()?.complete({ error });
90
+ return;
91
+ }
92
+ const zone = currentZone().data("stepZone");
93
+ const isExpectCall = channel.type === "Frame" && channel.method === "expect" || channel.type === "Page" && channel.method === "expectScreenshot";
94
+ if (zone && zone.category === "expect" && isExpectCall) {
95
+ data.stepId = zone.stepId;
96
+ return;
97
+ }
98
+ const params = renderParamsForCall({ type: channel.type, method: channel.method, params: channel.params });
99
+ const step = testInfo2._addStep({
100
+ location: data.frames[0],
101
+ category: "pw:api",
102
+ title: renderTitle(channel.type, channel.method, channel.params, data.title),
103
+ subtitle: renderSubtitle(channel.type, channel.method, channel.params),
104
+ params,
105
+ group: getActionGroup({ type: channel.type, method: channel.method })
106
+ }, tracingGroupSteps[tracingGroupSteps.length - 1]);
107
+ data.stepId = step.stepId;
108
+ if (channel.type === "Tracing" && channel.method === "tracingGroup") {
109
+ tracingGroupSteps.push(step);
110
+ } else {
111
+ data.userData = (error) => step.complete({ error });
112
+ }
113
+ },
114
+ onApiCallEnd: (data) => {
115
+ const completeStep = data.userData;
116
+ completeStep?.(data.error);
117
+ },
118
+ onWillPause: ({ keepTestTimeout }) => {
119
+ if (!keepTestTimeout)
120
+ globals.currentTestInfo()?._setIgnoreTimeouts(true);
121
+ },
122
+ runBeforeCreateBrowserContext: async (options) => {
123
+ for (const [key, value] of Object.entries(_combinedContextOptions)) {
124
+ if (!(key in options))
125
+ options[key] = value;
126
+ }
127
+ },
128
+ runBeforeCreateRequestContext: async (options) => {
129
+ for (const [key, value] of Object.entries(_combinedContextOptions)) {
130
+ if (!(key in options))
131
+ options[key] = value;
132
+ }
133
+ },
134
+ runAfterCreateBrowserContext: async (context) => {
135
+ context.debugger.on("pausedstatechanged", () => {
136
+ const paused = !!context.debugger.pausedDetails();
137
+ if (pausedContexts.has(context) && !paused) {
138
+ pausedContexts.delete(context);
139
+ testInfo._setIgnoreTimeouts(false);
140
+ } else if (!pausedContexts.has(context) && paused) {
141
+ pausedContexts.add(context);
142
+ testInfo._setIgnoreTimeouts(true);
143
+ }
144
+ });
145
+ await artifactsRecorder.didCreateBrowserContext(context);
146
+ const currentTestInfo = globals.currentTestInfo();
147
+ if (currentTestInfo) {
148
+ attachConnectedHeaderIfNeeded(currentTestInfo, context.browser());
149
+ currentTestInfo._onCustomMessageCallback = (0, import_browserBackend.createCustomMessageHandler)(currentTestInfo, context);
150
+ await (0, import_browserBackend.runDaemonForContext)(currentTestInfo, context);
151
+ }
152
+ },
153
+ runAfterCreateRequestContext: async (context) => {
154
+ await artifactsRecorder.didCreateRequestContext(context);
155
+ },
156
+ runBeforeCloseBrowserContext: async (context) => {
157
+ await artifactsRecorder.willCloseBrowserContext(context);
158
+ },
159
+ runBeforeCloseRequestContext: async (context) => {
160
+ await artifactsRecorder.willCloseRequestContext(context);
161
+ }
162
+ };
163
+ const clientInstrumentation = playwright._instrumentation;
164
+ clientInstrumentation.addListener(csiListener);
165
+ await use();
166
+ clientInstrumentation.removeListener(csiListener);
167
+ await artifactsRecorder.didFinishTest();
168
+ }, { auto: "all-hooks-included", title: "trace recording", box: true, timeout: 0 }],
169
+ request: async ({ playwright }, use) => {
170
+ const request = await playwright.request.newContext();
171
+ await use(request);
172
+ const hook = test.info()._currentHookType();
173
+ if (hook === "beforeAll") {
174
+ await request.dispose({ reason: [
175
+ `Fixture { request } from beforeAll cannot be reused in a test.`,
176
+ ` - Recommended fix: use a separate { request } in the test.`,
177
+ ` - Alternatively, manually create APIRequestContext in beforeAll and dispose it in afterAll.`,
178
+ `See https://playwright.dev/docs/api-testing#sending-api-requests-from-ui-tests for more details.`
179
+ ].join("\n") });
180
+ } else {
181
+ await request.dispose();
182
+ }
183
+ }
184
+ };
185
+ const _utilityTest = _baseTest.extend(utilityFixtures);
186
+ const playwrightFixtures = {
187
+ defaultBrowserType: ["chromium", { scope: "worker", option: true, box: true }],
188
+ browserName: [({ defaultBrowserType }, use) => use(defaultBrowserType), { scope: "worker", option: true, box: true }],
189
+ headless: [({ launchOptions }, use) => use(launchOptions.headless ?? true), { scope: "worker", option: true, box: true }],
190
+ channel: [({ launchOptions }, use) => use(launchOptions.channel), { scope: "worker", option: true, box: true }],
191
+ launchOptions: [{}, { scope: "worker", option: true, box: true }],
192
+ connectOptions: [async ({ _optionConnectOptions }, use) => {
193
+ await use(connectOptionsFromEnv() || _optionConnectOptions);
194
+ }, { scope: "worker", option: true, box: true }],
195
+ video: ["off", { scope: "worker", option: true, box: true }],
196
+ _browserOptions: [async ({ playwright, headless, channel, launchOptions }, use) => {
197
+ const options = {
198
+ handleSIGINT: false,
199
+ ...launchOptions,
200
+ tracesDir: tracing().tracesDir(),
201
+ artifactsDir: tracing().artifactsDir()
202
+ };
203
+ if (headless !== void 0)
204
+ options.headless = headless;
205
+ if (channel !== void 0)
206
+ options.channel = channel;
207
+ playwright._defaultLaunchOptions = options;
208
+ await use(options);
209
+ playwright._defaultLaunchOptions = void 0;
210
+ }, { scope: "worker", auto: true, box: true }],
211
+ browser: [async ({ playwright, browserName, _browserOptions, connectOptions }, use, workerInfo) => {
212
+ if (!["chromium", "firefox", "webkit"].includes(browserName))
213
+ throw new Error(`Unexpected browserName "${browserName}", must be one of "chromium", "firefox" or "webkit"`);
214
+ if (connectOptions) {
215
+ const browser2 = await playwright[browserName].connect(connectOptions.wsEndpoint, {
216
+ ...connectOptions,
217
+ exposeNetwork: connectOptions.exposeNetwork,
218
+ headers: {
219
+ // HTTP headers are ASCII only (not UTF-8).
220
+ "x-playwright-launch-options": jsonStringifyForceASCII(_browserOptions),
221
+ ...connectOptions.headers
222
+ }
223
+ });
224
+ await use(browser2);
225
+ await browser2.close({ reason: "Test ended." });
226
+ return;
227
+ }
228
+ const browser = await playwright[browserName].launch();
229
+ if (process.env.PLAYWRIGHT_DASHBOARD)
230
+ await browser.bind(`worker-${workerInfo.parallelIndex}`);
231
+ await use(browser);
232
+ await browser.close({ reason: "Test ended." });
233
+ }, { scope: "worker", timeout: 0 }],
234
+ acceptDownloads: [({ contextOptions }, use) => use(contextOptions.acceptDownloads ?? true), { option: true, box: true }],
235
+ bypassCSP: [({ contextOptions }, use) => use(contextOptions.bypassCSP ?? false), { option: true, box: true }],
236
+ colorScheme: [({ contextOptions }, use) => use(contextOptions.colorScheme === void 0 ? "light" : contextOptions.colorScheme), { option: true, box: true }],
237
+ contrast: [({ contextOptions }, use) => use(contextOptions.contrast === void 0 ? "no-preference" : contextOptions.contrast), { option: true, box: true }],
238
+ deviceScaleFactor: [({ contextOptions }, use) => use(contextOptions.deviceScaleFactor), { option: true, box: true }],
239
+ extraHTTPHeaders: [({ contextOptions }, use) => use(contextOptions.extraHTTPHeaders), { option: true, box: true }],
240
+ forcedColors: [({ contextOptions }, use) => use(contextOptions.forcedColors === void 0 ? "none" : contextOptions.forcedColors), { option: true, box: true }],
241
+ geolocation: [({ contextOptions }, use) => use(contextOptions.geolocation), { option: true, box: true }],
242
+ hasTouch: [({ contextOptions }, use) => use(contextOptions.hasTouch ?? false), { option: true, box: true }],
243
+ httpCredentials: [({ contextOptions }, use) => use(contextOptions.httpCredentials), { option: true, box: true }],
244
+ ignoreHTTPSErrors: [({ contextOptions }, use) => use(contextOptions.ignoreHTTPSErrors ?? false), { option: true, box: true }],
245
+ isMobile: [({ contextOptions }, use) => use(contextOptions.isMobile ?? false), { option: true, box: true }],
246
+ javaScriptEnabled: [({ contextOptions }, use) => use(contextOptions.javaScriptEnabled ?? true), { option: true, box: true }],
247
+ locale: [({ contextOptions }, use) => use(contextOptions.locale ?? "en-US"), { option: true, box: true }],
248
+ offline: [({ contextOptions }, use) => use(contextOptions.offline ?? false), { option: true, box: true }],
249
+ permissions: [({ contextOptions }, use) => use(contextOptions.permissions), { option: true, box: true }],
250
+ proxy: [({ contextOptions }, use) => use(contextOptions.proxy), { option: true, box: true }],
251
+ reducedMotion: [({ contextOptions }, use) => use(contextOptions.reducedMotion === void 0 ? "no-preference" : contextOptions.reducedMotion), { option: true, box: true }],
252
+ storageState: [({ contextOptions }, use) => use(contextOptions.storageState), { option: true, box: true }],
253
+ clientCertificates: [({ contextOptions }, use) => use(contextOptions.clientCertificates), { option: true, box: true }],
254
+ timezoneId: [({ contextOptions }, use) => use(contextOptions.timezoneId), { option: true, box: true }],
255
+ userAgent: [({ contextOptions }, use) => use(contextOptions.userAgent), { option: true, box: true }],
256
+ viewport: [({ contextOptions }, use) => use(contextOptions.viewport === void 0 ? { width: 1280, height: 720 } : contextOptions.viewport), { option: true, box: true }],
257
+ actionTimeout: [0, { option: true, box: true }],
258
+ navigationTimeout: [0, { option: true, box: true }],
259
+ baseURL: [async ({}, use) => {
260
+ await use(process.env.PLAYWRIGHT_TEST_BASE_URL);
261
+ }, { option: true, box: true }],
262
+ serviceWorkers: [({ contextOptions }, use) => use(contextOptions.serviceWorkers ?? "allow"), { option: true, box: true }],
263
+ contextOptions: [{}, { option: true, box: true }],
264
+ _combinedContextOptions: [async ({
265
+ acceptDownloads,
266
+ bypassCSP,
267
+ clientCertificates,
268
+ colorScheme,
269
+ contrast,
270
+ deviceScaleFactor,
271
+ extraHTTPHeaders,
272
+ forcedColors,
273
+ hasTouch,
274
+ geolocation,
275
+ httpCredentials,
276
+ ignoreHTTPSErrors,
277
+ isMobile,
278
+ javaScriptEnabled,
279
+ locale,
280
+ offline,
281
+ permissions,
282
+ proxy,
283
+ reducedMotion,
284
+ storageState,
285
+ viewport,
286
+ timezoneId,
287
+ userAgent,
288
+ baseURL,
289
+ contextOptions,
290
+ serviceWorkers
291
+ }, use, testInfo) => {
292
+ const options = {};
293
+ if (acceptDownloads !== void 0)
294
+ options.acceptDownloads = acceptDownloads;
295
+ if (bypassCSP !== void 0)
296
+ options.bypassCSP = bypassCSP;
297
+ if (colorScheme !== void 0)
298
+ options.colorScheme = colorScheme;
299
+ if (contrast !== void 0)
300
+ options.contrast = contrast;
301
+ if (deviceScaleFactor !== void 0)
302
+ options.deviceScaleFactor = deviceScaleFactor;
303
+ if (extraHTTPHeaders !== void 0)
304
+ options.extraHTTPHeaders = extraHTTPHeaders;
305
+ if (forcedColors !== void 0)
306
+ options.forcedColors = forcedColors;
307
+ if (geolocation !== void 0)
308
+ options.geolocation = geolocation;
309
+ if (hasTouch !== void 0)
310
+ options.hasTouch = hasTouch;
311
+ if (httpCredentials !== void 0)
312
+ options.httpCredentials = httpCredentials;
313
+ if (ignoreHTTPSErrors !== void 0)
314
+ options.ignoreHTTPSErrors = ignoreHTTPSErrors;
315
+ if (isMobile !== void 0)
316
+ options.isMobile = isMobile;
317
+ if (javaScriptEnabled !== void 0)
318
+ options.javaScriptEnabled = javaScriptEnabled;
319
+ if (locale !== void 0)
320
+ options.locale = locale;
321
+ if (offline !== void 0)
322
+ options.offline = offline;
323
+ if (permissions !== void 0)
324
+ options.permissions = permissions;
325
+ if (proxy !== void 0)
326
+ options.proxy = proxy;
327
+ if (reducedMotion !== void 0)
328
+ options.reducedMotion = reducedMotion;
329
+ if (storageState !== void 0)
330
+ options.storageState = storageState;
331
+ if (clientCertificates?.length)
332
+ options.clientCertificates = resolveClientCerticates(clientCertificates);
333
+ if (timezoneId !== void 0)
334
+ options.timezoneId = timezoneId;
335
+ if (userAgent !== void 0)
336
+ options.userAgent = userAgent;
337
+ if (viewport !== void 0)
338
+ options.viewport = viewport;
339
+ if (baseURL !== void 0)
340
+ options.baseURL = baseURL;
341
+ if (serviceWorkers !== void 0)
342
+ options.serviceWorkers = serviceWorkers;
343
+ await use({
344
+ ...contextOptions,
345
+ ...options
346
+ });
347
+ }, { scope: "test", box: true }],
348
+ _setupContextOptions: [async ({ playwright, actionTimeout, navigationTimeout, testIdAttribute }, use, _testInfo) => {
349
+ const testInfo = _testInfo;
350
+ if (testIdAttribute)
351
+ playwrightLibrary.selectors.setTestIdAttribute(testIdAttribute);
352
+ testInfo.snapshotSuffix = process.platform;
353
+ testInfo._onCustomMessageCallback = () => Promise.reject(new Error("Only tests that use default Playwright context or page fixture support test_debug"));
354
+ if (debugMode() === "inspector")
355
+ testInfo._setIgnoreTimeouts(true);
356
+ playwright._defaultContextTimeout = actionTimeout || 0;
357
+ playwright._defaultContextNavigationTimeout = navigationTimeout || 0;
358
+ await use();
359
+ playwright._defaultContextTimeout = void 0;
360
+ playwright._defaultContextNavigationTimeout = void 0;
361
+ }, { auto: "all-hooks-included", title: "context configuration", box: true }],
362
+ _contextFactory: [async ({
363
+ browser,
364
+ video,
365
+ _reuseContext,
366
+ _combinedContextOptions
367
+ /** mitigate dep-via-auto lack of traceability */
368
+ }, use, testInfo) => {
369
+ const testInfoImpl = testInfo;
370
+ const videoMode = normalizeVideoMode(video);
371
+ const captureVideo = shouldCaptureVideo(videoMode, testInfo) && !_reuseContext;
372
+ const contexts = /* @__PURE__ */ new Map();
373
+ let counter = 0;
374
+ await use(async (options) => {
375
+ const hook = testInfoImpl._currentHookType();
376
+ if (hook === "beforeAll" || hook === "afterAll") {
377
+ throw new Error([
378
+ `"context" and "page" fixtures are not supported in "${hook}" since they are created on a per-test basis.`,
379
+ `If you would like to reuse a single page between tests, create context manually with browser.newContext(). See https://aka.ms/playwright/reuse-page for details.`,
380
+ `If you would like to configure your page before each test, do that in beforeEach hook instead.`
381
+ ].join("\n"));
382
+ }
383
+ const show = typeof video === "string" ? void 0 : video.show;
384
+ const videoOptions = captureVideo ? {
385
+ recordVideo: {
386
+ dir: tracing().artifactsDir(),
387
+ size: typeof video === "string" ? void 0 : video.size,
388
+ showActions: show?.actions
389
+ }
390
+ } : {};
391
+ const context = await browser.newContext({ ...videoOptions, ...options });
392
+ let closed = false;
393
+ const close = async () => {
394
+ if (closed)
395
+ return;
396
+ closed = true;
397
+ const closeReason = testInfo.status === "timedOut" ? "Test timeout of " + testInfo.timeout + "ms exceeded." : "Test ended.";
398
+ await context.close({ reason: closeReason });
399
+ const preserveVideo = captureVideo && shouldPreserveVideo(videoMode, testInfo);
400
+ if (preserveVideo) {
401
+ const { pagesWithVideo: pagesForVideo } = contexts.get(context);
402
+ const videos = pagesForVideo.map((p) => p.video()).filter((video2) => !!video2);
403
+ await Promise.all(videos.map(async (v) => {
404
+ try {
405
+ const savedPath = testInfo.outputPath(`video${counter ? "-" + counter : ""}.webm`);
406
+ ++counter;
407
+ await v.saveAs(savedPath);
408
+ testInfo.attachments.push({ name: "video", path: savedPath, contentType: "video/webm" });
409
+ } catch (e) {
410
+ }
411
+ }));
412
+ }
413
+ };
414
+ const contextData = { close, pagesWithVideo: [] };
415
+ if (captureVideo)
416
+ context.on("page", (page) => contextData.pagesWithVideo.push(page));
417
+ contexts.set(context, contextData);
418
+ return { context, close };
419
+ });
420
+ await Promise.all([...contexts.values()].map((data) => data.close()));
421
+ }, { scope: "test", title: "context", box: true }],
422
+ _optionContextReuseMode: ["none", { scope: "worker", option: true, box: true }],
423
+ _optionConnectOptions: [void 0, { scope: "worker", option: true, box: true }],
424
+ reuseContext: [false, { scope: "worker", option: true, box: true }],
425
+ _reuseContext: [async ({ video, _optionContextReuseMode, reuseContext }, use) => {
426
+ let mode = _optionContextReuseMode;
427
+ if (process.env.PW_TEST_REUSE_CONTEXT || reuseContext)
428
+ mode = "when-possible";
429
+ const reuse = mode === "when-possible" && normalizeVideoMode(video) === "off";
430
+ await use(reuse);
431
+ }, { scope: "worker", title: "context", box: true }],
432
+ context: async ({ browser, video, _reuseContext, _contextFactory }, use, testInfoPublic) => {
433
+ const browserImpl = browser;
434
+ const testInfo = testInfoPublic;
435
+ const show = typeof video === "string" ? void 0 : video.show;
436
+ attachConnectedHeaderIfNeeded(testInfo, browserImpl);
437
+ if (!_reuseContext) {
438
+ const { context: context2, close } = await _contextFactory();
439
+ await installScreencastTitleUpdater(testInfo, context2, show?.test);
440
+ await use(context2);
441
+ await close();
442
+ return;
443
+ }
444
+ const context = await browserImpl._wrapApiCall(() => browserImpl._newContextForReuse(), { internal: true });
445
+ await installScreencastTitleUpdater(testInfo, context, show?.test);
446
+ await use(context);
447
+ const closeReason = testInfo.status === "timedOut" ? "Test timeout of " + testInfo.timeout + "ms exceeded." : "Test ended.";
448
+ await browserImpl._wrapApiCall(() => browserImpl._disconnectFromReusedContext(closeReason), { internal: true });
449
+ },
450
+ page: async ({ context, _reuseContext }, use) => {
451
+ if (!_reuseContext) {
452
+ await use(await context.newPage());
453
+ return;
454
+ }
455
+ let [page] = context.pages();
456
+ if (!page)
457
+ page = await context.newPage();
458
+ await use(page);
459
+ },
460
+ mount: async ({ page, baseURL }, use) => {
461
+ const callMount = (params) => page.evaluate(async (p) => {
462
+ const w = window;
463
+ if (typeof w.mount !== "function")
464
+ throw new Error("The gallery page does not define window.mount().");
465
+ await w.mount(p);
466
+ }, params, { exposeFunctions: true });
467
+ await use(async (storyId, props) => {
468
+ if (!baseURL)
469
+ throw new Error("mount() requires `baseURL` to point at the component gallery. Set it in your Playwright config.");
470
+ await page.goto(baseURL);
471
+ await callMount({ story: storyId, props });
472
+ return Object.assign(page.locator("#root"), {
473
+ // update() re-renders the same story with new props without navigating; if the gallery
474
+ // reuses its root/instance, the framework reconciles and component state is preserved.
475
+ update: (newProps) => callMount({ story: storyId, props: newProps }),
476
+ unmount: () => page.evaluate(async () => {
477
+ await window.unmount?.();
478
+ })
479
+ });
480
+ });
481
+ }
482
+ };
483
+ function normalizeVideoMode(video) {
484
+ if (!video)
485
+ return "off";
486
+ let videoMode = typeof video === "string" ? video : video.mode;
487
+ if (videoMode === "retry-with-video")
488
+ videoMode = "on-first-retry";
489
+ return videoMode;
490
+ }
491
+ function shouldCaptureVideo(videoMode, testInfo) {
492
+ return videoMode === "on" || videoMode === "retain-on-failure" || videoMode === "retain-on-failure-and-retries" || videoMode === "on-first-retry" && testInfo.retry === 1 || videoMode === "on-all-retries" && testInfo.retry > 0 || videoMode === "retain-on-first-failure" && testInfo.retry === 0;
493
+ }
494
+ function shouldPreserveVideo(videoMode, testInfo) {
495
+ const testFailed = testInfo.status !== testInfo.expectedStatus;
496
+ switch (videoMode) {
497
+ case "on":
498
+ case "on-first-retry":
499
+ case "on-all-retries":
500
+ return true;
501
+ case "retain-on-failure":
502
+ case "retain-on-first-failure":
503
+ return testFailed;
504
+ case "retain-on-failure-and-retries":
505
+ return testFailed || testInfo.retry > 0;
506
+ default:
507
+ return false;
508
+ }
509
+ }
510
+ function normalizeScreenshotMode(screenshot) {
511
+ if (!screenshot)
512
+ return "off";
513
+ return typeof screenshot === "string" ? screenshot : screenshot.mode;
514
+ }
515
+ function attachConnectedHeaderIfNeeded(testInfo, browser) {
516
+ const connectHeaders = browser?._connection.headers;
517
+ if (!connectHeaders)
518
+ return;
519
+ for (const header of connectHeaders) {
520
+ if (header.name !== "x-playwright-attachment")
521
+ continue;
522
+ const [name, value] = header.value.split("=");
523
+ if (!name || !value)
524
+ continue;
525
+ if (testInfo.attachments.some((attachment) => attachment.name === name))
526
+ continue;
527
+ testInfo.attachments.push({ name, contentType: "text/plain", body: Buffer.from(value) });
528
+ }
529
+ }
530
+ function resolveFileToConfig(file) {
531
+ const config2 = test.info().config.configFile;
532
+ if (!config2 || !file)
533
+ return file;
534
+ if (import_path.default.isAbsolute(file))
535
+ return file;
536
+ return import_path.default.resolve(import_path.default.dirname(config2), file);
537
+ }
538
+ function resolveClientCerticates(clientCertificates) {
539
+ for (const cert of clientCertificates) {
540
+ cert.certPath = resolveFileToConfig(cert.certPath);
541
+ cert.keyPath = resolveFileToConfig(cert.keyPath);
542
+ cert.pfxPath = resolveFileToConfig(cert.pfxPath);
543
+ }
544
+ return clientCertificates;
545
+ }
546
+ const kTracingStarted = /* @__PURE__ */ Symbol("kTracingStarted");
547
+ function connectOptionsFromEnv() {
548
+ const wsEndpoint = process.env.PW_TEST_CONNECT_WS_ENDPOINT;
549
+ if (!wsEndpoint)
550
+ return void 0;
551
+ const headers = process.env.PW_TEST_CONNECT_HEADERS ? JSON.parse(process.env.PW_TEST_CONNECT_HEADERS) : void 0;
552
+ return {
553
+ wsEndpoint,
554
+ headers,
555
+ exposeNetwork: process.env.PW_TEST_CONNECT_EXPOSE_NETWORK
556
+ };
557
+ }
558
+ class SnapshotRecorder {
559
+ constructor(_artifactsRecorder, _mode, _name, _contentType, _extension, _doSnapshot) {
560
+ this._artifactsRecorder = _artifactsRecorder;
561
+ this._mode = _mode;
562
+ this._name = _name;
563
+ this._contentType = _contentType;
564
+ this._extension = _extension;
565
+ this._doSnapshot = _doSnapshot;
566
+ this._ordinal = 0;
567
+ this._temporary = [];
568
+ }
569
+ fixOrdinal() {
570
+ this._ordinal = this.testInfo.attachments.filter((a) => a.name === this._name).length;
571
+ }
572
+ shouldCaptureUponFinish() {
573
+ return this._mode === "on" || this._mode === "only-on-failure" && this.testInfo._isFailure() || this._mode === "on-first-failure" && this.testInfo._isFailure() && this.testInfo.retry === 0;
574
+ }
575
+ async maybeCapture() {
576
+ if (!this.shouldCaptureUponFinish())
577
+ return;
578
+ await Promise.all(this._artifactsRecorder._playwright._allPages().map((page) => this._snapshotPage(page, false)));
579
+ }
580
+ async persistTemporary() {
581
+ if (this.shouldCaptureUponFinish()) {
582
+ await Promise.all(this._temporary.map(async (file) => {
583
+ try {
584
+ const path2 = this._createAttachmentPath();
585
+ await import_fs.default.promises.rename(file, path2);
586
+ this._attach(path2);
587
+ } catch {
588
+ }
589
+ }));
590
+ }
591
+ }
592
+ async captureTemporary(context) {
593
+ if (this._mode === "on" || this._mode === "only-on-failure" || this._mode === "on-first-failure" && this.testInfo.retry === 0)
594
+ await Promise.all(context.pages().map((page) => this._snapshotPage(page, true)));
595
+ }
596
+ _attach(screenshotPath) {
597
+ this.testInfo.attachments.push({ name: this._name, path: screenshotPath, contentType: this._contentType });
598
+ }
599
+ _createAttachmentPath() {
600
+ const testFailed = this.testInfo._isFailure();
601
+ const index = this._ordinal + 1;
602
+ ++this._ordinal;
603
+ const path2 = this.testInfo.outputPath(`test-${testFailed ? "failed" : "finished"}-${index}${this._extension}`);
604
+ return path2;
605
+ }
606
+ _createTemporaryArtifact(...name) {
607
+ const file = import_path.default.join(this._artifactsRecorder._artifactsDir, ...name);
608
+ return file;
609
+ }
610
+ async _snapshotPage(page, temporary) {
611
+ if (page[this.testInfo._uniqueSymbol])
612
+ return;
613
+ page[this.testInfo._uniqueSymbol] = true;
614
+ try {
615
+ const path2 = temporary ? this._createTemporaryArtifact(createGuid() + this._extension) : this._createAttachmentPath();
616
+ await this._doSnapshot(page, path2);
617
+ if (temporary)
618
+ this._temporary.push(path2);
619
+ else
620
+ this._attach(path2);
621
+ } catch {
622
+ }
623
+ }
624
+ get testInfo() {
625
+ return this._artifactsRecorder._testInfo;
626
+ }
627
+ }
628
+ class ArtifactsRecorder {
629
+ constructor(playwright, artifactsDir, screenshot) {
630
+ this._playwright = playwright;
631
+ this._artifactsDir = artifactsDir;
632
+ const screenshotOptions = typeof screenshot === "string" ? void 0 : screenshot;
633
+ this._startedCollectingArtifacts = /* @__PURE__ */ Symbol("startedCollectingArtifacts");
634
+ this._screenshotRecorder = new SnapshotRecorder(this, normalizeScreenshotMode(screenshot), "screenshot", "image/png", ".png", async (page, path2) => {
635
+ await page._wrapApiCall(async () => {
636
+ await page.screenshot({ ...screenshotOptions, timeout: 5e3, path: path2, caret: "initial" });
637
+ }, { internal: true });
638
+ });
639
+ }
640
+ async willStartTest(testInfo) {
641
+ this._testInfo = testInfo;
642
+ testInfo._onDidFinishTestFunctionCallbacks.add(() => this.didFinishTestFunction());
643
+ this._screenshotRecorder.fixOrdinal();
644
+ await Promise.all(this._playwright._allContexts().map((context) => this.didCreateBrowserContext(context)));
645
+ const existingApiRequests = Array.from(this._playwright.request._contexts);
646
+ await Promise.all(existingApiRequests.map((c) => this.didCreateRequestContext(c)));
647
+ }
648
+ async didCreateBrowserContext(context) {
649
+ await this._startTraceChunkOnContextCreation(context, context.tracing);
650
+ await this._startTraceChunkOnContextCreation(context.request, context.request.tracing);
651
+ }
652
+ async willCloseBrowserContext(context) {
653
+ await this._stopTracing(context, context.tracing);
654
+ await this._screenshotRecorder.captureTemporary(context);
655
+ await this._takePageSnapshot(context);
656
+ }
657
+ async _takePageSnapshot(context) {
658
+ if (process.env.PLAYWRIGHT_NO_COPY_PROMPT)
659
+ return;
660
+ if (this._testInfo.errors.length === 0)
661
+ return;
662
+ if (this._testInfo.errors.some((e) => e.errorContext))
663
+ return;
664
+ if (this._pageSnapshot)
665
+ return;
666
+ const page = context.pages()[0];
667
+ if (!page)
668
+ return;
669
+ try {
670
+ await page._wrapApiCall(async () => {
671
+ this._pageSnapshot = await page.ariaSnapshot({ mode: "ai", timeout: 5e3 });
672
+ }, { internal: true });
673
+ } catch (error) {
674
+ debugLogger.log("error", `failed to capture aria snapshot: ${error}`);
675
+ }
676
+ }
677
+ async didCreateRequestContext(context) {
678
+ await this._startTraceChunkOnContextCreation(context, context.tracing);
679
+ }
680
+ async willCloseRequestContext(context) {
681
+ await this._stopTracing(context, context.tracing);
682
+ }
683
+ async didFinishTestFunction() {
684
+ await this._screenshotRecorder.maybeCapture();
685
+ }
686
+ async didFinishTest() {
687
+ await this.didFinishTestFunction();
688
+ const leftoverContexts = this._playwright._allContexts();
689
+ const leftoverApiRequests = Array.from(this._playwright.request._contexts);
690
+ await Promise.all(leftoverContexts.map(async (context2) => {
691
+ await this._stopTracing(context2.request, context2.request.tracing);
692
+ await this._stopTracing(context2, context2.tracing);
693
+ }).concat(leftoverApiRequests.map(async (context2) => {
694
+ await this._stopTracing(context2, context2.tracing);
695
+ })));
696
+ await this._screenshotRecorder.persistTemporary();
697
+ const context = leftoverContexts[0];
698
+ if (context)
699
+ await this._takePageSnapshot(context);
700
+ if (this._testInfo.errors.length > 0) {
701
+ const hasMatcherAriaSnapshot = this._testInfo.errors.some((e) => e.errorContext);
702
+ const errorContextContent = (0, import_errorContext.buildErrorContext)({
703
+ titlePath: this._testInfo.titlePath,
704
+ location: { file: this._testInfo.file, line: this._testInfo.line, column: this._testInfo.column },
705
+ errors: this._testInfo.errors,
706
+ pageSnapshot: hasMatcherAriaSnapshot ? void 0 : this._pageSnapshot
707
+ });
708
+ if (errorContextContent) {
709
+ const filePath = this._testInfo.outputPath("error-context.md");
710
+ await import_fs.default.promises.writeFile(filePath, errorContextContent, "utf8");
711
+ this._testInfo._attach({
712
+ name: "error-context",
713
+ contentType: "text/markdown",
714
+ path: filePath
715
+ }, void 0);
716
+ }
717
+ }
718
+ }
719
+ async _startTraceChunkOnContextCreation(channelOwner, tracing2) {
720
+ await channelOwner._wrapApiCall(async () => {
721
+ const options = this._testInfo._tracing.traceOptions();
722
+ if (options) {
723
+ const title = this._testInfo._tracing.traceTitle();
724
+ const name = this._testInfo._tracing.generateNextTraceRecordingName();
725
+ if (!tracing2[kTracingStarted]) {
726
+ await tracing2.start({ ...options, title, name });
727
+ tracing2[kTracingStarted] = true;
728
+ } else {
729
+ await tracing2.startChunk({ title, name });
730
+ }
731
+ } else {
732
+ if (tracing2[kTracingStarted]) {
733
+ tracing2[kTracingStarted] = false;
734
+ await tracing2.stop();
735
+ }
736
+ }
737
+ }, { internal: true });
738
+ }
739
+ async _stopTracing(channelOwner, tracing2) {
740
+ await channelOwner._wrapApiCall(async () => {
741
+ if (tracing2[this._startedCollectingArtifacts])
742
+ return;
743
+ tracing2[this._startedCollectingArtifacts] = true;
744
+ if (this._testInfo._tracing.traceOptions() && tracing2[kTracingStarted])
745
+ await tracing2.stopChunk({ path: this._testInfo._tracing.maybeGenerateNextTraceRecordingPath() });
746
+ }, { internal: true });
747
+ }
748
+ }
749
+ async function installScreencastTitleUpdater(testInfo, context, testAnnotate) {
750
+ if (!testAnnotate)
751
+ return;
752
+ const testTitle = testAnnotate.level === "file" ? [testInfo.titlePath[0]] : testInfo.titlePath;
753
+ const stepStack = [];
754
+ const overlays = /* @__PURE__ */ new Map();
755
+ const position = testAnnotate.position ?? "top-left";
756
+ const fontSize = testAnnotate.fontSize ?? 14;
757
+ const level = testAnnotate.level ?? "step";
758
+ const updateOverlay = async () => {
759
+ const parts = level === "step" ? [...testTitle, ...stepStack] : testTitle;
760
+ const html = createTestOverlay(parts, position, fontSize);
761
+ for (const page of context.pages()) {
762
+ await overlays.get(page)?.dispose();
763
+ overlays.delete(page);
764
+ const disposable = await page.screencast.showOverlay(html);
765
+ overlays.set(page, disposable);
766
+ }
767
+ };
768
+ testInfo._onUserStepBegin = async (title) => {
769
+ stepStack.push(title);
770
+ await updateOverlay();
771
+ };
772
+ testInfo._onUserStepEnd = async () => {
773
+ stepStack.pop();
774
+ await updateOverlay();
775
+ };
776
+ context.on("page", async () => {
777
+ void updateOverlay();
778
+ });
779
+ await updateOverlay();
780
+ }
781
+ function createTestOverlay(parts, position, fontSize) {
782
+ const positionStyles = {
783
+ "top-left": "top: 6px; left: 6px;",
784
+ "top": "top: 6px; left: 50%; transform: translateX(-50%);",
785
+ "top-right": "top: 6px; right: 6px;",
786
+ "bottom-left": "bottom: 6px; left: 6px;",
787
+ "bottom": "bottom: 6px; left: 50%; transform: translateX(-50%);",
788
+ "bottom-right": "bottom: 6px; right: 6px;"
789
+ };
790
+ const posStyle = positionStyles[position] ?? positionStyles["top-left"];
791
+ return `<div style="white-space: nowrap; font-size: ${fontSize}px; padding: 3px 6px; background: rgba(0,0,0,0.5); color: white; border-radius: 4px; position: absolute; ${posStyle}">
792
+ ${parts.map((p) => `<div>${escapeHTML(p)}</div>`).join("")}
793
+ </div>`;
794
+ }
795
+ function renderTitle(type, method, params, title) {
796
+ return renderTitleForCall({ title, type, method, params });
797
+ }
798
+ function renderSubtitle(type, method, params) {
799
+ const subtitle = renderSubtitleForCall({ type, method, params });
800
+ return subtitle === void 0 ? void 0 : truncateParam(subtitle);
801
+ }
802
+ function tracing() {
803
+ return test.info()._tracing;
804
+ }
805
+ const test = _utilityTest.extend(playwrightFixtures);
806
+ // Annotate the CommonJS export names for ESM import in node:
807
+ 0 && (module.exports = {
808
+ _baseTest,
809
+ _utilityTest,
810
+ defineConfig,
811
+ expect,
812
+ mergeExpects,
813
+ mergeTests,
814
+ test
815
+ });