@stablyai/internal-playwright 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (297) hide show
  1. package/LICENSE +202 -0
  2. package/NOTICE +5 -0
  3. package/README.md +168 -0
  4. package/ThirdPartyNotices.txt +6277 -0
  5. package/cli.js +19 -0
  6. package/index.d.ts +17 -0
  7. package/index.js +17 -0
  8. package/index.mjs +18 -0
  9. package/jsx-runtime.js +42 -0
  10. package/jsx-runtime.mjs +21 -0
  11. package/lib/agents/generateAgents.js +265 -0
  12. package/lib/agents/generator.md +102 -0
  13. package/lib/agents/healer.md +78 -0
  14. package/lib/agents/planner.md +135 -0
  15. package/lib/cli.js +274 -0
  16. package/lib/common/config.js +274 -0
  17. package/lib/common/config.js.map +7 -0
  18. package/lib/common/configLoader.js +377 -0
  19. package/lib/common/configLoader.js.map +7 -0
  20. package/lib/common/esmLoaderHost.js +102 -0
  21. package/lib/common/esmLoaderHost.js.map +7 -0
  22. package/lib/common/expectBundle.js +52 -0
  23. package/lib/common/expectBundle.js.map +7 -0
  24. package/lib/common/expectBundleImpl.js +389 -0
  25. package/lib/common/expectBundleImpl.js.map +7 -0
  26. package/lib/common/fixtures.js +302 -0
  27. package/lib/common/fixtures.js.map +7 -0
  28. package/lib/common/globals.js +58 -0
  29. package/lib/common/globals.js.map +7 -0
  30. package/lib/common/ipc.js +60 -0
  31. package/lib/common/ipc.js.map +7 -0
  32. package/lib/common/poolBuilder.js +85 -0
  33. package/lib/common/poolBuilder.js.map +7 -0
  34. package/lib/common/process.js +104 -0
  35. package/lib/common/process.js.map +7 -0
  36. package/lib/common/suiteUtils.js +140 -0
  37. package/lib/common/suiteUtils.js.map +7 -0
  38. package/lib/common/test.js +321 -0
  39. package/lib/common/test.js.map +7 -0
  40. package/lib/common/testLoader.js +100 -0
  41. package/lib/common/testLoader.js.map +7 -0
  42. package/lib/common/testType.js +310 -0
  43. package/lib/common/testType.js.map +7 -0
  44. package/lib/fsWatcher.js +67 -0
  45. package/lib/fsWatcher.js.map +7 -0
  46. package/lib/index.js +696 -0
  47. package/lib/index.js.map +7 -0
  48. package/lib/internalsForTest.js +42 -0
  49. package/lib/internalsForTest.js.map +7 -0
  50. package/lib/isomorphic/events.js +77 -0
  51. package/lib/isomorphic/events.js.map +7 -0
  52. package/lib/isomorphic/folders.js +30 -0
  53. package/lib/isomorphic/folders.js.map +7 -0
  54. package/lib/isomorphic/stringInternPool.js +69 -0
  55. package/lib/isomorphic/stringInternPool.js.map +7 -0
  56. package/lib/isomorphic/teleReceiver.js +507 -0
  57. package/lib/isomorphic/teleReceiver.js.map +7 -0
  58. package/lib/isomorphic/teleSuiteUpdater.js +137 -0
  59. package/lib/isomorphic/teleSuiteUpdater.js.map +7 -0
  60. package/lib/isomorphic/testServerConnection.js +211 -0
  61. package/lib/isomorphic/testServerConnection.js.map +7 -0
  62. package/lib/isomorphic/testServerInterface.js +16 -0
  63. package/lib/isomorphic/testServerInterface.js.map +7 -0
  64. package/lib/isomorphic/testTree.js +334 -0
  65. package/lib/isomorphic/testTree.js.map +7 -0
  66. package/lib/isomorphic/types.d.js +16 -0
  67. package/lib/isomorphic/types.d.js.map +7 -0
  68. package/lib/loader/loaderMain.js +59 -0
  69. package/lib/loader/loaderMain.js.map +7 -0
  70. package/lib/matchers/expect.js +325 -0
  71. package/lib/matchers/expect.js.map +7 -0
  72. package/lib/matchers/matcherHint.js +87 -0
  73. package/lib/matchers/matcherHint.js.map +7 -0
  74. package/lib/matchers/matchers.js +366 -0
  75. package/lib/matchers/matchers.js.map +7 -0
  76. package/lib/matchers/toBeTruthy.js +73 -0
  77. package/lib/matchers/toBeTruthy.js.map +7 -0
  78. package/lib/matchers/toEqual.js +99 -0
  79. package/lib/matchers/toEqual.js.map +7 -0
  80. package/lib/matchers/toHaveURL.js +102 -0
  81. package/lib/matchers/toHaveURL.js.map +7 -0
  82. package/lib/matchers/toMatchAriaSnapshot.js +159 -0
  83. package/lib/matchers/toMatchAriaSnapshot.js.map +7 -0
  84. package/lib/matchers/toMatchSnapshot.js +359 -0
  85. package/lib/matchers/toMatchSnapshot.js.map +7 -0
  86. package/lib/matchers/toMatchText.js +99 -0
  87. package/lib/matchers/toMatchText.js.map +7 -0
  88. package/lib/mcp/browser/actions.d.js +16 -0
  89. package/lib/mcp/browser/backend.js +93 -0
  90. package/lib/mcp/browser/backend.js.map +7 -0
  91. package/lib/mcp/browser/browserContextFactory.js +296 -0
  92. package/lib/mcp/browser/browserServerBackend.js +76 -0
  93. package/lib/mcp/browser/codegen.js +66 -0
  94. package/lib/mcp/browser/config.js +385 -0
  95. package/lib/mcp/browser/context.js +287 -0
  96. package/lib/mcp/browser/response.js +228 -0
  97. package/lib/mcp/browser/sessionLog.js +160 -0
  98. package/lib/mcp/browser/tab.js +277 -0
  99. package/lib/mcp/browser/tool.js +30 -0
  100. package/lib/mcp/browser/tool.js.map +7 -0
  101. package/lib/mcp/browser/tools/common.js +63 -0
  102. package/lib/mcp/browser/tools/console.js +44 -0
  103. package/lib/mcp/browser/tools/dialogs.js +60 -0
  104. package/lib/mcp/browser/tools/evaluate.js +70 -0
  105. package/lib/mcp/browser/tools/files.js +58 -0
  106. package/lib/mcp/browser/tools/form.js +74 -0
  107. package/lib/mcp/browser/tools/install.js +69 -0
  108. package/lib/mcp/browser/tools/keyboard.js +85 -0
  109. package/lib/mcp/browser/tools/mouse.js +107 -0
  110. package/lib/mcp/browser/tools/navigate.js +62 -0
  111. package/lib/mcp/browser/tools/network.js +54 -0
  112. package/lib/mcp/browser/tools/pdf.js +59 -0
  113. package/lib/mcp/browser/tools/screenshot.js +88 -0
  114. package/lib/mcp/browser/tools/snapshot.js +182 -0
  115. package/lib/mcp/browser/tools/tabs.js +67 -0
  116. package/lib/mcp/browser/tools/tool.js +49 -0
  117. package/lib/mcp/browser/tools/tracing.js +74 -0
  118. package/lib/mcp/browser/tools/utils.js +100 -0
  119. package/lib/mcp/browser/tools/verify.js +154 -0
  120. package/lib/mcp/browser/tools/wait.js +63 -0
  121. package/lib/mcp/browser/tools.js +80 -0
  122. package/lib/mcp/browser/tools.js.map +7 -0
  123. package/lib/mcp/browser/watchdog.js +44 -0
  124. package/lib/mcp/config.d.js +16 -0
  125. package/lib/mcp/extension/cdpRelay.js +351 -0
  126. package/lib/mcp/extension/extensionContextFactory.js +75 -0
  127. package/lib/mcp/extension/protocol.js +28 -0
  128. package/lib/mcp/index.js +61 -0
  129. package/lib/mcp/log.js +35 -0
  130. package/lib/mcp/program.js +96 -0
  131. package/lib/mcp/sdk/bundle.js +81 -0
  132. package/lib/mcp/sdk/bundle.js.map +7 -0
  133. package/lib/mcp/sdk/call.js +49 -0
  134. package/lib/mcp/sdk/call.js.map +7 -0
  135. package/lib/mcp/sdk/exports.js +32 -0
  136. package/lib/mcp/sdk/exports.js.map +7 -0
  137. package/lib/mcp/sdk/http.js +187 -0
  138. package/lib/mcp/sdk/http.js.map +7 -0
  139. package/lib/mcp/sdk/inProcessTransport.js +71 -0
  140. package/lib/mcp/sdk/inProcessTransport.js.map +7 -0
  141. package/lib/mcp/sdk/mdb.js +206 -0
  142. package/lib/mcp/sdk/mdb.js.map +7 -0
  143. package/lib/mcp/sdk/proxyBackend.js +128 -0
  144. package/lib/mcp/sdk/proxyBackend.js.map +7 -0
  145. package/lib/mcp/sdk/server.js +189 -0
  146. package/lib/mcp/sdk/server.js.map +7 -0
  147. package/lib/mcp/sdk/tool.js +51 -0
  148. package/lib/mcp/sdk/tool.js.map +7 -0
  149. package/lib/mcp/test/backend.js +67 -0
  150. package/lib/mcp/test/backend.js.map +7 -0
  151. package/lib/mcp/test/browserBackend.js +98 -0
  152. package/lib/mcp/test/context.js +48 -0
  153. package/lib/mcp/test/context.js.map +7 -0
  154. package/lib/mcp/test/generatorTools.js +122 -0
  155. package/lib/mcp/test/plannerTools.js +46 -0
  156. package/lib/mcp/test/seed.js +72 -0
  157. package/lib/mcp/test/streams.js +39 -0
  158. package/lib/mcp/test/streams.js.map +7 -0
  159. package/lib/mcp/test/testBackend.js +97 -0
  160. package/lib/mcp/test/testContext.js +176 -0
  161. package/lib/mcp/test/testTool.js +30 -0
  162. package/lib/mcp/test/testTools.js +115 -0
  163. package/lib/mcp/test/tool.js +30 -0
  164. package/lib/mcp/test/tool.js.map +7 -0
  165. package/lib/mcp/test/tools.js +150 -0
  166. package/lib/mcp/test/tools.js.map +7 -0
  167. package/lib/mcp/vscode/host.js +187 -0
  168. package/lib/mcp/vscode/main.js +77 -0
  169. package/lib/mcpBundleImpl.js +41 -0
  170. package/lib/mcpBundleImpl.js.map +7 -0
  171. package/lib/plugins/gitCommitInfoPlugin.js +198 -0
  172. package/lib/plugins/gitCommitInfoPlugin.js.map +7 -0
  173. package/lib/plugins/index.js +28 -0
  174. package/lib/plugins/index.js.map +7 -0
  175. package/lib/plugins/webServerPlugin.js +209 -0
  176. package/lib/plugins/webServerPlugin.js.map +7 -0
  177. package/lib/program.js +412 -0
  178. package/lib/program.js.map +7 -0
  179. package/lib/reporters/base.js +609 -0
  180. package/lib/reporters/base.js.map +7 -0
  181. package/lib/reporters/blob.js +135 -0
  182. package/lib/reporters/blob.js.map +7 -0
  183. package/lib/reporters/dot.js +82 -0
  184. package/lib/reporters/dot.js.map +7 -0
  185. package/lib/reporters/empty.js +32 -0
  186. package/lib/reporters/empty.js.map +7 -0
  187. package/lib/reporters/github.js +128 -0
  188. package/lib/reporters/github.js.map +7 -0
  189. package/lib/reporters/html.js +644 -0
  190. package/lib/reporters/html.js.map +7 -0
  191. package/lib/reporters/internalReporter.js +130 -0
  192. package/lib/reporters/internalReporter.js.map +7 -0
  193. package/lib/reporters/json.js +254 -0
  194. package/lib/reporters/json.js.map +7 -0
  195. package/lib/reporters/junit.js +230 -0
  196. package/lib/reporters/junit.js.map +7 -0
  197. package/lib/reporters/line.js +113 -0
  198. package/lib/reporters/line.js.map +7 -0
  199. package/lib/reporters/list.js +235 -0
  200. package/lib/reporters/list.js.map +7 -0
  201. package/lib/reporters/listModeReporter.js +69 -0
  202. package/lib/reporters/listModeReporter.js.map +7 -0
  203. package/lib/reporters/markdown.js +144 -0
  204. package/lib/reporters/markdown.js.map +7 -0
  205. package/lib/reporters/merge.js +535 -0
  206. package/lib/reporters/merge.js.map +7 -0
  207. package/lib/reporters/multiplexer.js +104 -0
  208. package/lib/reporters/multiplexer.js.map +7 -0
  209. package/lib/reporters/reporterV2.js +102 -0
  210. package/lib/reporters/reporterV2.js.map +7 -0
  211. package/lib/reporters/teleEmitter.js +297 -0
  212. package/lib/reporters/teleEmitter.js.map +7 -0
  213. package/lib/reporters/versions/blobV1.js +16 -0
  214. package/lib/reporters/versions/blobV1.js.map +7 -0
  215. package/lib/runner/dispatcher.js +491 -0
  216. package/lib/runner/dispatcher.js.map +7 -0
  217. package/lib/runner/failureTracker.js +72 -0
  218. package/lib/runner/failureTracker.js.map +7 -0
  219. package/lib/runner/lastRun.js +77 -0
  220. package/lib/runner/lastRun.js.map +7 -0
  221. package/lib/runner/loadUtils.js +333 -0
  222. package/lib/runner/loadUtils.js.map +7 -0
  223. package/lib/runner/loaderHost.js +89 -0
  224. package/lib/runner/loaderHost.js.map +7 -0
  225. package/lib/runner/processHost.js +161 -0
  226. package/lib/runner/processHost.js.map +7 -0
  227. package/lib/runner/projectUtils.js +241 -0
  228. package/lib/runner/projectUtils.js.map +7 -0
  229. package/lib/runner/rebase.js +189 -0
  230. package/lib/runner/rebase.js.map +7 -0
  231. package/lib/runner/reporters.js +137 -0
  232. package/lib/runner/reporters.js.map +7 -0
  233. package/lib/runner/runner.js +173 -0
  234. package/lib/runner/sigIntWatcher.js +96 -0
  235. package/lib/runner/sigIntWatcher.js.map +7 -0
  236. package/lib/runner/taskRunner.js +127 -0
  237. package/lib/runner/taskRunner.js.map +7 -0
  238. package/lib/runner/tasks.js +410 -0
  239. package/lib/runner/tasks.js.map +7 -0
  240. package/lib/runner/testGroups.js +117 -0
  241. package/lib/runner/testGroups.js.map +7 -0
  242. package/lib/runner/testRunner.js +390 -0
  243. package/lib/runner/testRunner.js.map +7 -0
  244. package/lib/runner/testServer.js +264 -0
  245. package/lib/runner/testServer.js.map +7 -0
  246. package/lib/runner/uiMode.js +271 -0
  247. package/lib/runner/uiModeReporter.js +30 -0
  248. package/lib/runner/uiModeReporter.js.map +7 -0
  249. package/lib/runner/vcs.js +72 -0
  250. package/lib/runner/vcs.js.map +7 -0
  251. package/lib/runner/watchMode.js +395 -0
  252. package/lib/runner/watchMode.js.map +7 -0
  253. package/lib/runner/workerHost.js +95 -0
  254. package/lib/runner/workerHost.js.map +7 -0
  255. package/lib/store.js +98 -0
  256. package/lib/third_party/pirates.js +62 -0
  257. package/lib/third_party/pirates.js.map +7 -0
  258. package/lib/third_party/tsconfig-loader.js +103 -0
  259. package/lib/third_party/tsconfig-loader.js.map +7 -0
  260. package/lib/transform/babelBundle.js +43 -0
  261. package/lib/transform/babelBundle.js.map +7 -0
  262. package/lib/transform/babelBundleImpl.js +461 -0
  263. package/lib/transform/babelBundleImpl.js.map +7 -0
  264. package/lib/transform/compilationCache.js +272 -0
  265. package/lib/transform/compilationCache.js.map +7 -0
  266. package/lib/transform/esmLoader.js +104 -0
  267. package/lib/transform/esmLoader.js.map +7 -0
  268. package/lib/transform/esmUtils.js +32 -0
  269. package/lib/transform/portTransport.js +67 -0
  270. package/lib/transform/portTransport.js.map +7 -0
  271. package/lib/transform/transform.js +293 -0
  272. package/lib/transform/transform.js.map +7 -0
  273. package/lib/util.js +403 -0
  274. package/lib/util.js.map +7 -0
  275. package/lib/utilsBundle.js +43 -0
  276. package/lib/utilsBundle.js.map +7 -0
  277. package/lib/utilsBundleImpl.js +100 -0
  278. package/lib/utilsBundleImpl.js.map +7 -0
  279. package/lib/worker/fixtureRunner.js +258 -0
  280. package/lib/worker/fixtureRunner.js.map +7 -0
  281. package/lib/worker/stepContext.js +34 -0
  282. package/lib/worker/testInfo.js +508 -0
  283. package/lib/worker/testInfo.js.map +7 -0
  284. package/lib/worker/testTracing.js +344 -0
  285. package/lib/worker/testTracing.js.map +7 -0
  286. package/lib/worker/timeoutManager.js +174 -0
  287. package/lib/worker/timeoutManager.js.map +7 -0
  288. package/lib/worker/util.js +31 -0
  289. package/lib/worker/util.js.map +7 -0
  290. package/lib/worker/workerMain.js +520 -0
  291. package/lib/worker/workerMain.js.map +7 -0
  292. package/package.json +74 -0
  293. package/test.d.ts +18 -0
  294. package/test.js +24 -0
  295. package/test.mjs +33 -0
  296. package/types/test.d.ts +10217 -0
  297. package/types/testReporter.d.ts +816 -0
@@ -0,0 +1,104 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var multiplexer_exports = {};
20
+ __export(multiplexer_exports, {
21
+ Multiplexer: () => Multiplexer
22
+ });
23
+ module.exports = __toCommonJS(multiplexer_exports);
24
+ class Multiplexer {
25
+ constructor(reporters) {
26
+ this._reporters = reporters;
27
+ }
28
+ version() {
29
+ return "v2";
30
+ }
31
+ onConfigure(config) {
32
+ for (const reporter of this._reporters)
33
+ wrap(() => reporter.onConfigure?.(config));
34
+ }
35
+ onBegin(suite) {
36
+ for (const reporter of this._reporters)
37
+ wrap(() => reporter.onBegin?.(suite));
38
+ }
39
+ onTestBegin(test, result) {
40
+ for (const reporter of this._reporters)
41
+ wrap(() => reporter.onTestBegin?.(test, result));
42
+ }
43
+ onStdOut(chunk, test, result) {
44
+ for (const reporter of this._reporters)
45
+ wrap(() => reporter.onStdOut?.(chunk, test, result));
46
+ }
47
+ onStdErr(chunk, test, result) {
48
+ for (const reporter of this._reporters)
49
+ wrap(() => reporter.onStdErr?.(chunk, test, result));
50
+ }
51
+ onTestEnd(test, result) {
52
+ for (const reporter of this._reporters)
53
+ wrap(() => reporter.onTestEnd?.(test, result));
54
+ }
55
+ async onEnd(result) {
56
+ for (const reporter of this._reporters) {
57
+ const outResult = await wrapAsync(() => reporter.onEnd?.(result));
58
+ if (outResult?.status)
59
+ result.status = outResult.status;
60
+ }
61
+ return result;
62
+ }
63
+ async onExit() {
64
+ for (const reporter of this._reporters)
65
+ await wrapAsync(() => reporter.onExit?.());
66
+ }
67
+ onError(error) {
68
+ for (const reporter of this._reporters)
69
+ wrap(() => reporter.onError?.(error));
70
+ }
71
+ onStepBegin(test, result, step) {
72
+ for (const reporter of this._reporters)
73
+ wrap(() => reporter.onStepBegin?.(test, result, step));
74
+ }
75
+ onStepEnd(test, result, step) {
76
+ for (const reporter of this._reporters)
77
+ wrap(() => reporter.onStepEnd?.(test, result, step));
78
+ }
79
+ printsToStdio() {
80
+ return this._reporters.some((r) => {
81
+ let prints = false;
82
+ wrap(() => prints = r.printsToStdio ? r.printsToStdio() : true);
83
+ return prints;
84
+ });
85
+ }
86
+ }
87
+ async function wrapAsync(callback) {
88
+ try {
89
+ return await callback();
90
+ } catch (e) {
91
+ console.error("Error in reporter", e);
92
+ }
93
+ }
94
+ function wrap(callback) {
95
+ try {
96
+ callback();
97
+ } catch (e) {
98
+ console.error("Error in reporter", e);
99
+ }
100
+ }
101
+ // Annotate the CommonJS export names for ESM import in node:
102
+ 0 && (module.exports = {
103
+ Multiplexer
104
+ });
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/reporters/multiplexer.ts"],
4
+ "sourcesContent": ["/**\n * Copyright (c) Microsoft Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { ReporterV2 } from './reporterV2';\nimport type { FullConfig, FullResult, TestCase, TestError, TestResult, TestStep } from '../../types/testReporter';\nimport type { Suite } from '../common/test';\n\nexport class Multiplexer implements ReporterV2 {\n private _reporters: ReporterV2[];\n\n constructor(reporters: ReporterV2[]) {\n this._reporters = reporters;\n }\n\n version(): 'v2' {\n return 'v2';\n }\n\n onConfigure(config: FullConfig) {\n for (const reporter of this._reporters)\n wrap(() => reporter.onConfigure?.(config));\n }\n\n onBegin(suite: Suite) {\n for (const reporter of this._reporters)\n wrap(() => reporter.onBegin?.(suite));\n }\n\n onTestBegin(test: TestCase, result: TestResult) {\n for (const reporter of this._reporters)\n wrap(() => reporter.onTestBegin?.(test, result));\n }\n\n onStdOut(chunk: string | Buffer, test?: TestCase, result?: TestResult) {\n for (const reporter of this._reporters)\n wrap(() => reporter.onStdOut?.(chunk, test, result));\n }\n\n onStdErr(chunk: string | Buffer, test?: TestCase, result?: TestResult) {\n for (const reporter of this._reporters)\n wrap(() => reporter.onStdErr?.(chunk, test, result));\n }\n\n onTestEnd(test: TestCase, result: TestResult) {\n for (const reporter of this._reporters)\n wrap(() => reporter.onTestEnd?.(test, result));\n }\n\n async onEnd(result: FullResult) {\n for (const reporter of this._reporters) {\n const outResult = await wrapAsync(() => reporter.onEnd?.(result));\n if (outResult?.status)\n result.status = outResult.status;\n }\n return result;\n }\n\n async onExit() {\n for (const reporter of this._reporters)\n await wrapAsync(() => reporter.onExit?.());\n }\n\n onError(error: TestError) {\n for (const reporter of this._reporters)\n wrap(() => reporter.onError?.(error));\n }\n\n onStepBegin(test: TestCase, result: TestResult, step: TestStep) {\n for (const reporter of this._reporters)\n wrap(() => reporter.onStepBegin?.(test, result, step));\n }\n\n onStepEnd(test: TestCase, result: TestResult, step: TestStep) {\n for (const reporter of this._reporters)\n wrap(() => reporter.onStepEnd?.(test, result, step));\n }\n\n printsToStdio(): boolean {\n return this._reporters.some(r => {\n let prints = false;\n wrap(() => prints = r.printsToStdio ? r.printsToStdio() : true);\n return prints;\n });\n }\n}\n\nasync function wrapAsync<T>(callback: () => T | Promise<T>) {\n try {\n return await callback();\n } catch (e) {\n // eslint-disable-next-line no-console\n console.error('Error in reporter', e);\n }\n}\n\nfunction wrap(callback: () => void) {\n try {\n callback();\n } catch (e) {\n // eslint-disable-next-line no-console\n console.error('Error in reporter', e);\n }\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAoBO,MAAM,YAAkC;AAAA,EAG7C,YAAY,WAAyB;AACnC,SAAK,aAAa;AAAA,EACpB;AAAA,EAEA,UAAgB;AACd,WAAO;AAAA,EACT;AAAA,EAEA,YAAY,QAAoB;AAC9B,eAAW,YAAY,KAAK;AAC1B,WAAK,MAAM,SAAS,cAAc,MAAM,CAAC;AAAA,EAC7C;AAAA,EAEA,QAAQ,OAAc;AACpB,eAAW,YAAY,KAAK;AAC1B,WAAK,MAAM,SAAS,UAAU,KAAK,CAAC;AAAA,EACxC;AAAA,EAEA,YAAY,MAAgB,QAAoB;AAC9C,eAAW,YAAY,KAAK;AAC1B,WAAK,MAAM,SAAS,cAAc,MAAM,MAAM,CAAC;AAAA,EACnD;AAAA,EAEA,SAAS,OAAwB,MAAiB,QAAqB;AACrE,eAAW,YAAY,KAAK;AAC1B,WAAK,MAAM,SAAS,WAAW,OAAO,MAAM,MAAM,CAAC;AAAA,EACvD;AAAA,EAEA,SAAS,OAAwB,MAAiB,QAAqB;AACrE,eAAW,YAAY,KAAK;AAC1B,WAAK,MAAM,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;AAEV,YAAQ,MAAM,qBAAqB,CAAC;AAAA,EACtC;AACF;",
6
+ "names": []
7
+ }
@@ -0,0 +1,102 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var reporterV2_exports = {};
20
+ __export(reporterV2_exports, {
21
+ wrapReporterAsV2: () => wrapReporterAsV2
22
+ });
23
+ module.exports = __toCommonJS(reporterV2_exports);
24
+ function wrapReporterAsV2(reporter) {
25
+ try {
26
+ if ("version" in reporter && reporter.version() === "v2")
27
+ return reporter;
28
+ } catch (e) {
29
+ }
30
+ return new ReporterV2Wrapper(reporter);
31
+ }
32
+ class ReporterV2Wrapper {
33
+ constructor(reporter) {
34
+ this._deferred = [];
35
+ this._reporter = reporter;
36
+ }
37
+ version() {
38
+ return "v2";
39
+ }
40
+ onConfigure(config) {
41
+ this._config = config;
42
+ }
43
+ onBegin(suite) {
44
+ this._reporter.onBegin?.(this._config, suite);
45
+ const deferred = this._deferred;
46
+ this._deferred = null;
47
+ for (const item of deferred) {
48
+ if (item.error)
49
+ this.onError(item.error);
50
+ if (item.stdout)
51
+ this.onStdOut(item.stdout.chunk, item.stdout.test, item.stdout.result);
52
+ if (item.stderr)
53
+ this.onStdErr(item.stderr.chunk, item.stderr.test, item.stderr.result);
54
+ }
55
+ }
56
+ onTestBegin(test, result) {
57
+ this._reporter.onTestBegin?.(test, result);
58
+ }
59
+ onStdOut(chunk, test, result) {
60
+ if (this._deferred) {
61
+ this._deferred.push({ stdout: { chunk, test, result } });
62
+ return;
63
+ }
64
+ this._reporter.onStdOut?.(chunk, test, result);
65
+ }
66
+ onStdErr(chunk, test, result) {
67
+ if (this._deferred) {
68
+ this._deferred.push({ stderr: { chunk, test, result } });
69
+ return;
70
+ }
71
+ this._reporter.onStdErr?.(chunk, test, result);
72
+ }
73
+ onTestEnd(test, result) {
74
+ this._reporter.onTestEnd?.(test, result);
75
+ }
76
+ async onEnd(result) {
77
+ return await this._reporter.onEnd?.(result);
78
+ }
79
+ async onExit() {
80
+ await this._reporter.onExit?.();
81
+ }
82
+ onError(error) {
83
+ if (this._deferred) {
84
+ this._deferred.push({ error });
85
+ return;
86
+ }
87
+ this._reporter.onError?.(error);
88
+ }
89
+ onStepBegin(test, result, step) {
90
+ this._reporter.onStepBegin?.(test, result, step);
91
+ }
92
+ onStepEnd(test, result, step) {
93
+ this._reporter.onStepEnd?.(test, result, step);
94
+ }
95
+ printsToStdio() {
96
+ return this._reporter.printsToStdio ? this._reporter.printsToStdio() : true;
97
+ }
98
+ }
99
+ // Annotate the CommonJS export names for ESM import in node:
100
+ 0 && (module.exports = {
101
+ wrapReporterAsV2
102
+ });
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/reporters/reporterV2.ts"],
4
+ "sourcesContent": ["/**\n * Copyright (c) Microsoft Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { FullConfig, FullResult, Reporter, Suite, TestCase, TestError, TestResult, TestStep } from '../../types/testReporter';\n\nexport interface ReporterV2 {\n onConfigure?(config: FullConfig): void;\n onBegin?(suite: Suite): void;\n onTestBegin?(test: TestCase, result: TestResult): void;\n onStdOut?(chunk: string | Buffer, test?: TestCase, result?: TestResult): void;\n onStdErr?(chunk: string | Buffer, test?: TestCase, result?: TestResult): void;\n onTestEnd?(test: TestCase, result: TestResult): void;\n onEnd?(result: FullResult): Promise<{ status?: FullResult['status'] } | undefined | void> | void;\n onExit?(): void | Promise<void>;\n onError?(error: TestError): void;\n onStepBegin?(test: TestCase, result: TestResult, step: TestStep): void;\n onStepEnd?(test: TestCase, result: TestResult, step: TestStep): void;\n printsToStdio?(): boolean;\n version(): 'v2';\n}\n\nexport type AnyReporter = ReporterV2 | Reporter;\n\ntype StdIOChunk = {\n chunk: string | Buffer;\n test?: TestCase;\n result?: TestResult;\n};\n\nexport function wrapReporterAsV2(reporter: Reporter | ReporterV2): ReporterV2 {\n try {\n if ('version' in reporter && reporter.version() === 'v2')\n return reporter as ReporterV2;\n } catch (e) {\n }\n return new ReporterV2Wrapper(reporter as Reporter);\n}\n\nclass ReporterV2Wrapper implements ReporterV2 {\n private _reporter: Reporter;\n private _deferred: { error?: TestError, stdout?: StdIOChunk, stderr?: StdIOChunk }[] | null = [];\n private _config!: FullConfig;\n\n constructor(reporter: Reporter) {\n this._reporter = reporter;\n }\n\n version(): 'v2' {\n return 'v2';\n }\n\n onConfigure(config: FullConfig) {\n this._config = config;\n }\n\n onBegin(suite: Suite) {\n this._reporter.onBegin?.(this._config, suite);\n\n const deferred = this._deferred!;\n this._deferred = null;\n for (const item of deferred) {\n if (item.error)\n this.onError(item.error);\n if (item.stdout)\n this.onStdOut(item.stdout.chunk, item.stdout.test, item.stdout.result);\n if (item.stderr)\n this.onStdErr(item.stderr.chunk, item.stderr.test, item.stderr.result);\n }\n }\n\n onTestBegin(test: TestCase, result: TestResult) {\n this._reporter.onTestBegin?.(test, result);\n }\n\n onStdOut(chunk: string | Buffer, test?: TestCase, result?: TestResult) {\n if (this._deferred) {\n this._deferred.push({ stdout: { chunk, test, result } });\n return;\n }\n this._reporter.onStdOut?.(chunk, test, result);\n }\n\n onStdErr(chunk: string | Buffer, test?: TestCase, result?: TestResult) {\n if (this._deferred) {\n this._deferred.push({ stderr: { chunk, test, result } });\n return;\n }\n this._reporter.onStdErr?.(chunk, test, result);\n }\n\n onTestEnd(test: TestCase, result: TestResult) {\n this._reporter.onTestEnd?.(test, result);\n }\n\n async onEnd(result: FullResult) {\n return await this._reporter.onEnd?.(result);\n }\n\n async onExit() {\n await this._reporter.onExit?.();\n }\n\n onError(error: TestError) {\n if (this._deferred) {\n this._deferred.push({ error });\n return;\n }\n this._reporter.onError?.(error);\n }\n\n onStepBegin(test: TestCase, result: TestResult, step: TestStep) {\n this._reporter.onStepBegin?.(test, result, step);\n }\n\n onStepEnd(test: TestCase, result: TestResult, step: TestStep) {\n this._reporter.onStepEnd?.(test, result, step);\n }\n\n printsToStdio() {\n return this._reporter.printsToStdio ? this._reporter.printsToStdio() : true;\n }\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AA0CO,SAAS,iBAAiB,UAA6C;AAC5E,MAAI;AACF,QAAI,aAAa,YAAY,SAAS,QAAQ,MAAM;AAClD,aAAO;AAAA,EACX,SAAS,GAAG;AAAA,EACZ;AACA,SAAO,IAAI,kBAAkB,QAAoB;AACnD;AAEA,MAAM,kBAAwC;AAAA,EAK5C,YAAY,UAAoB;AAHhC,SAAQ,YAAsF,CAAC;AAI7F,SAAK,YAAY;AAAA,EACnB;AAAA,EAEA,UAAgB;AACd,WAAO;AAAA,EACT;AAAA,EAEA,YAAY,QAAoB;AAC9B,SAAK,UAAU;AAAA,EACjB;AAAA,EAEA,QAAQ,OAAc;AACpB,SAAK,UAAU,UAAU,KAAK,SAAS,KAAK;AAE5C,UAAM,WAAW,KA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AAK,UAAU,cAAc,MAAM,QAAQ,IAAI;AAAA,EACjD;AAAA,EAEA,UAAU,MAAgB,QAAoB,MAAgB;AAC5D,SAAK,UAAU,YAAY,MAAM,QAAQ,IAAI;AAAA,EAC/C;AAAA,EAEA,gBAAgB;AACd,WAAO,KAAK,UAAU,gBAAgB,KAAK,UAAU,cAAc,IAAI;AAAA,EACzE;AACF;",
6
+ "names": []
7
+ }
@@ -0,0 +1,297 @@
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 teleEmitter_exports = {};
30
+ __export(teleEmitter_exports, {
31
+ TeleReporterEmitter: () => TeleReporterEmitter
32
+ });
33
+ module.exports = __toCommonJS(teleEmitter_exports);
34
+ var import_path = __toESM(require("path"));
35
+ var import_utils = require("playwright-core/lib/utils");
36
+ var import_teleReceiver = require("../isomorphic/teleReceiver");
37
+ class TeleReporterEmitter {
38
+ constructor(messageSink, options = {}) {
39
+ this._resultKnownAttachmentCounts = /* @__PURE__ */ new Map();
40
+ // In case there is blob reporter and UI mode, make sure one does override
41
+ // the id assigned by the other.
42
+ this._idSymbol = Symbol("id");
43
+ this._messageSink = messageSink;
44
+ this._emitterOptions = options;
45
+ }
46
+ version() {
47
+ return "v2";
48
+ }
49
+ onConfigure(config) {
50
+ this._rootDir = config.rootDir;
51
+ this._messageSink({ method: "onConfigure", params: { config: this._serializeConfig(config) } });
52
+ }
53
+ onBegin(suite) {
54
+ const projects = suite.suites.map((projectSuite) => this._serializeProject(projectSuite));
55
+ for (const project of projects)
56
+ this._messageSink({ method: "onProject", params: { project } });
57
+ this._messageSink({ method: "onBegin", params: void 0 });
58
+ }
59
+ onTestBegin(test, result) {
60
+ result[this._idSymbol] = (0, import_utils.createGuid)();
61
+ this._messageSink({
62
+ method: "onTestBegin",
63
+ params: {
64
+ testId: test.id,
65
+ result: this._serializeResultStart(result)
66
+ }
67
+ });
68
+ }
69
+ onTestEnd(test, result) {
70
+ const testEnd = {
71
+ testId: test.id,
72
+ expectedStatus: test.expectedStatus,
73
+ timeout: test.timeout,
74
+ annotations: []
75
+ };
76
+ this._sendNewAttachments(result, test.id);
77
+ this._messageSink({
78
+ method: "onTestEnd",
79
+ params: {
80
+ test: testEnd,
81
+ result: this._serializeResultEnd(result)
82
+ }
83
+ });
84
+ this._resultKnownAttachmentCounts.delete(result[this._idSymbol]);
85
+ }
86
+ onStepBegin(test, result, step) {
87
+ step[this._idSymbol] = (0, import_utils.createGuid)();
88
+ this._messageSink({
89
+ method: "onStepBegin",
90
+ params: {
91
+ testId: test.id,
92
+ resultId: result[this._idSymbol],
93
+ step: this._serializeStepStart(step)
94
+ }
95
+ });
96
+ }
97
+ onStepEnd(test, result, step) {
98
+ const resultId = result[this._idSymbol];
99
+ this._sendNewAttachments(result, test.id);
100
+ this._messageSink({
101
+ method: "onStepEnd",
102
+ params: {
103
+ testId: test.id,
104
+ resultId,
105
+ step: this._serializeStepEnd(step, result)
106
+ }
107
+ });
108
+ }
109
+ onError(error) {
110
+ this._messageSink({
111
+ method: "onError",
112
+ params: { error }
113
+ });
114
+ }
115
+ onStdOut(chunk, test, result) {
116
+ this._onStdIO("stdout", chunk, test, result);
117
+ }
118
+ onStdErr(chunk, test, result) {
119
+ this._onStdIO("stderr", chunk, test, result);
120
+ }
121
+ _onStdIO(type, chunk, test, result) {
122
+ if (this._emitterOptions.omitOutput)
123
+ return;
124
+ const isBase64 = typeof chunk !== "string";
125
+ const data = isBase64 ? chunk.toString("base64") : chunk;
126
+ this._messageSink({
127
+ method: "onStdIO",
128
+ params: { testId: test?.id, resultId: result ? result[this._idSymbol] : void 0, type, data, isBase64 }
129
+ });
130
+ }
131
+ async onEnd(result) {
132
+ const resultPayload = {
133
+ status: result.status,
134
+ startTime: result.startTime.getTime(),
135
+ duration: result.duration
136
+ };
137
+ this._messageSink({
138
+ method: "onEnd",
139
+ params: {
140
+ result: resultPayload
141
+ }
142
+ });
143
+ }
144
+ printsToStdio() {
145
+ return false;
146
+ }
147
+ _serializeConfig(config) {
148
+ return {
149
+ configFile: this._relativePath(config.configFile),
150
+ globalTimeout: config.globalTimeout,
151
+ maxFailures: config.maxFailures,
152
+ metadata: config.metadata,
153
+ rootDir: config.rootDir,
154
+ version: config.version,
155
+ workers: config.workers,
156
+ globalSetup: config.globalSetup,
157
+ globalTeardown: config.globalTeardown
158
+ };
159
+ }
160
+ _serializeProject(suite) {
161
+ const project = suite.project();
162
+ const report = {
163
+ metadata: project.metadata,
164
+ name: project.name,
165
+ outputDir: this._relativePath(project.outputDir),
166
+ repeatEach: project.repeatEach,
167
+ retries: project.retries,
168
+ testDir: this._relativePath(project.testDir),
169
+ testIgnore: (0, import_teleReceiver.serializeRegexPatterns)(project.testIgnore),
170
+ testMatch: (0, import_teleReceiver.serializeRegexPatterns)(project.testMatch),
171
+ timeout: project.timeout,
172
+ suites: suite.suites.map((fileSuite) => {
173
+ return this._serializeSuite(fileSuite);
174
+ }),
175
+ grep: (0, import_teleReceiver.serializeRegexPatterns)(project.grep),
176
+ grepInvert: (0, import_teleReceiver.serializeRegexPatterns)(project.grepInvert || []),
177
+ dependencies: project.dependencies,
178
+ snapshotDir: this._relativePath(project.snapshotDir),
179
+ teardown: project.teardown,
180
+ use: this._serializeProjectUseOptions(project.use)
181
+ };
182
+ return report;
183
+ }
184
+ _serializeProjectUseOptions(use) {
185
+ return {
186
+ testIdAttribute: use.testIdAttribute
187
+ };
188
+ }
189
+ _serializeSuite(suite) {
190
+ const result = {
191
+ title: suite.title,
192
+ location: this._relativeLocation(suite.location),
193
+ entries: suite.entries().map((e) => {
194
+ if (e.type === "test")
195
+ return this._serializeTest(e);
196
+ return this._serializeSuite(e);
197
+ })
198
+ };
199
+ return result;
200
+ }
201
+ _serializeTest(test) {
202
+ return {
203
+ testId: test.id,
204
+ title: test.title,
205
+ location: this._relativeLocation(test.location),
206
+ retries: test.retries,
207
+ tags: test.tags,
208
+ repeatEachIndex: test.repeatEachIndex,
209
+ annotations: this._relativeAnnotationLocations(test.annotations)
210
+ };
211
+ }
212
+ _serializeResultStart(result) {
213
+ return {
214
+ id: result[this._idSymbol],
215
+ retry: result.retry,
216
+ workerIndex: result.workerIndex,
217
+ parallelIndex: result.parallelIndex,
218
+ startTime: +result.startTime
219
+ };
220
+ }
221
+ _serializeResultEnd(result) {
222
+ return {
223
+ id: result[this._idSymbol],
224
+ duration: result.duration,
225
+ status: result.status,
226
+ errors: result.errors,
227
+ annotations: result.annotations?.length ? this._relativeAnnotationLocations(result.annotations) : void 0
228
+ };
229
+ }
230
+ _sendNewAttachments(result, testId) {
231
+ const resultId = result[this._idSymbol];
232
+ const knownAttachmentCount = this._resultKnownAttachmentCounts.get(resultId) ?? 0;
233
+ if (result.attachments.length > knownAttachmentCount) {
234
+ this._messageSink({
235
+ method: "onAttach",
236
+ params: {
237
+ testId,
238
+ resultId,
239
+ attachments: this._serializeAttachments(result.attachments.slice(knownAttachmentCount))
240
+ }
241
+ });
242
+ }
243
+ this._resultKnownAttachmentCounts.set(resultId, result.attachments.length);
244
+ }
245
+ _serializeAttachments(attachments) {
246
+ return attachments.map((a) => {
247
+ const { body, ...rest } = a;
248
+ return {
249
+ ...rest,
250
+ // There is no Buffer in the browser, so there is no point in sending the data there.
251
+ base64: body && !this._emitterOptions.omitBuffers ? body.toString("base64") : void 0
252
+ };
253
+ });
254
+ }
255
+ _serializeStepStart(step) {
256
+ return {
257
+ id: step[this._idSymbol],
258
+ parentStepId: step.parent?.[this._idSymbol],
259
+ title: step.title,
260
+ category: step.category,
261
+ startTime: +step.startTime,
262
+ location: this._relativeLocation(step.location)
263
+ };
264
+ }
265
+ _serializeStepEnd(step, result) {
266
+ return {
267
+ id: step[this._idSymbol],
268
+ duration: step.duration,
269
+ error: step.error,
270
+ attachments: step.attachments.length ? step.attachments.map((a) => result.attachments.indexOf(a)) : void 0,
271
+ annotations: step.annotations.length ? this._relativeAnnotationLocations(step.annotations) : void 0
272
+ };
273
+ }
274
+ _relativeAnnotationLocations(annotations) {
275
+ return annotations.map((annotation) => ({
276
+ ...annotation,
277
+ location: annotation.location ? this._relativeLocation(annotation.location) : void 0
278
+ }));
279
+ }
280
+ _relativeLocation(location) {
281
+ if (!location)
282
+ return location;
283
+ return {
284
+ ...location,
285
+ file: this._relativePath(location.file)
286
+ };
287
+ }
288
+ _relativePath(absolutePath) {
289
+ if (!absolutePath)
290
+ return absolutePath;
291
+ return import_path.default.relative(this._rootDir, absolutePath);
292
+ }
293
+ }
294
+ // Annotate the CommonJS export names for ESM import in node:
295
+ 0 && (module.exports = {
296
+ TeleReporterEmitter
297
+ });
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/reporters/teleEmitter.ts"],
4
+ "sourcesContent": ["/**\n * Copyright (c) Microsoft Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport path from 'path';\n\nimport { createGuid } from 'playwright-core/lib/utils';\n\nimport { serializeRegexPatterns } from '../isomorphic/teleReceiver';\n\nimport type { ReporterV2 } from './reporterV2';\nimport type * as reporterTypes from '../../types/testReporter';\nimport type { TestAnnotation } from '../../types/test';\nimport type * as teleReceiver from '../isomorphic/teleReceiver';\n\nexport type TeleReporterEmitterOptions = {\n omitOutput?: boolean;\n omitBuffers?: boolean;\n};\n\nexport class TeleReporterEmitter implements ReporterV2 {\n private _messageSink: (message: teleReceiver.JsonEvent) => void;\n private _rootDir!: string;\n private _emitterOptions: TeleReporterEmitterOptions;\n private _resultKnownAttachmentCounts = new Map<string, number>();\n // In case there is blob reporter and UI mode, make sure one does override\n // the id assigned by the other.\n private readonly _idSymbol = Symbol('id');\n\n constructor(messageSink: (message: teleReceiver.JsonEvent) => void, options: TeleReporterEmitterOptions = {}) {\n this._messageSink = messageSink;\n this._emitterOptions = options;\n }\n\n version(): 'v2' {\n return 'v2';\n }\n\n onConfigure(config: reporterTypes.FullConfig) {\n this._rootDir = config.rootDir;\n this._messageSink({ method: 'onConfigure', params: { config: this._serializeConfig(config) } });\n }\n\n onBegin(suite: reporterTypes.Suite) {\n const projects = suite.suites.map(projectSuite => this._serializeProject(projectSuite));\n for (const project of projects)\n this._messageSink({ method: 'onProject', params: { project } });\n this._messageSink({ method: 'onBegin', params: undefined });\n }\n\n onTestBegin(test: reporterTypes.TestCase, result: reporterTypes.TestResult): void {\n (result as any)[this._idSymbol] = createGuid();\n this._messageSink({\n method: 'onTestBegin',\n params: {\n testId: test.id,\n result: this._serializeResultStart(result)\n }\n });\n }\n\n onTestEnd(test: reporterTypes.TestCase, result: reporterTypes.TestResult): void {\n const testEnd: teleReceiver.JsonTestEnd = {\n testId: test.id,\n expectedStatus: test.expectedStatus,\n timeout: test.timeout,\n annotations: []\n };\n this._sendNewAttachments(result, test.id);\n this._messageSink({\n method: 'onTestEnd',\n params: {\n test: testEnd,\n result: this._serializeResultEnd(result),\n }\n });\n\n this._resultKnownAttachmentCounts.delete((result as any)[this._idSymbol]);\n }\n\n onStepBegin(test: reporterTypes.TestCase, result: reporterTypes.TestResult, step: reporterTypes.TestStep): void {\n (step as any)[this._idSymbol] = createGuid();\n this._messageSink({\n method: 'onStepBegin',\n params: {\n testId: test.id,\n resultId: (result as any)[this._idSymbol],\n step: this._serializeStepStart(step)\n }\n });\n }\n\n onStepEnd(test: reporterTypes.TestCase, result: reporterTypes.TestResult, step: reporterTypes.TestStep): void {\n // Create synthetic onAttach event so we serialize the entire attachment along with the step\n const resultId = (result as any)[this._idSymbol] as string;\n this._sendNewAttachments(result, test.id);\n\n this._messageSink({\n method: 'onStepEnd',\n params: {\n testId: test.id,\n resultId,\n step: this._serializeStepEnd(step, result)\n }\n });\n }\n\n onError(error: reporterTypes.TestError): void {\n this._messageSink({\n method: 'onError',\n params: { error }\n });\n }\n\n onStdOut(chunk: string | Buffer, test?: reporterTypes.TestCase, result?: reporterTypes.TestResult): void {\n this._onStdIO('stdout', chunk, test, result);\n }\n\n onStdErr(chunk: string | Buffer, test?: reporterTypes.TestCase, result?: reporterTypes.TestResult): void {\n this._onStdIO('stderr', chunk, test, result);\n }\n\n private _onStdIO(type: teleReceiver.JsonStdIOType, chunk: string | Buffer, test: void | reporterTypes.TestCase, result: void | reporterTypes.TestResult): void {\n if (this._emitterOptions.omitOutput)\n return;\n const isBase64 = typeof chunk !== 'string';\n const data = isBase64 ? chunk.toString('base64') : chunk;\n this._messageSink({\n method: 'onStdIO',\n params: { testId: test?.id, resultId: result ? (result as any)[this._idSymbol] : undefined, type, data, isBase64 }\n });\n }\n\n async onEnd(result: reporterTypes.FullResult) {\n const resultPayload: teleReceiver.JsonFullResult = {\n status: result.status,\n startTime: result.startTime.getTime(),\n duration: result.duration,\n };\n this._messageSink({\n method: 'onEnd',\n params: {\n result: resultPayload\n }\n });\n }\n\n printsToStdio() {\n return false;\n }\n\n private _serializeConfig(config: reporterTypes.FullConfig): teleReceiver.JsonConfig {\n return {\n configFile: this._relativePath(config.configFile),\n globalTimeout: config.globalTimeout,\n maxFailures: config.maxFailures,\n metadata: config.metadata,\n rootDir: config.rootDir,\n version: config.version,\n workers: config.workers,\n globalSetup: config.globalSetup,\n globalTeardown: config.globalTeardown,\n };\n }\n\n private _serializeProject(suite: reporterTypes.Suite): teleReceiver.JsonProject {\n const project = suite.project()!;\n const report: teleReceiver.JsonProject = {\n metadata: project.metadata,\n name: project.name,\n outputDir: this._relativePath(project.outputDir),\n repeatEach: project.repeatEach,\n retries: project.retries,\n testDir: this._relativePath(project.testDir),\n testIgnore: serializeRegexPatterns(project.testIgnore),\n testMatch: serializeRegexPatterns(project.testMatch),\n timeout: project.timeout,\n suites: suite.suites.map(fileSuite => {\n return this._serializeSuite(fileSuite);\n }),\n grep: serializeRegexPatterns(project.grep),\n grepInvert: serializeRegexPatterns(project.grepInvert || []),\n dependencies: project.dependencies,\n snapshotDir: this._relativePath(project.snapshotDir),\n teardown: project.teardown,\n use: this._serializeProjectUseOptions(project.use),\n };\n return report;\n }\n\n private _serializeProjectUseOptions(use: reporterTypes.FullProject['use']): Record<string, any> {\n return {\n testIdAttribute: use.testIdAttribute,\n };\n }\n\n private _serializeSuite(suite: reporterTypes.Suite): teleReceiver.JsonSuite {\n const result = {\n title: suite.title,\n location: this._relativeLocation(suite.location),\n entries: suite.entries().map(e => {\n if (e.type === 'test')\n return this._serializeTest(e);\n return this._serializeSuite(e);\n })\n };\n return result;\n }\n\n private _serializeTest(test: reporterTypes.TestCase): teleReceiver.JsonTestCase {\n return {\n testId: test.id,\n title: test.title,\n location: this._relativeLocation(test.location),\n retries: test.retries,\n tags: test.tags,\n repeatEachIndex: test.repeatEachIndex,\n annotations: this._relativeAnnotationLocations(test.annotations),\n };\n }\n\n private _serializeResultStart(result: reporterTypes.TestResult): teleReceiver.JsonTestResultStart {\n return {\n id: (result as any)[this._idSymbol],\n retry: result.retry,\n workerIndex: result.workerIndex,\n parallelIndex: result.parallelIndex,\n startTime: +result.startTime,\n };\n }\n\n private _serializeResultEnd(result: reporterTypes.TestResult): teleReceiver.JsonTestResultEnd {\n return {\n id: (result as any)[this._idSymbol],\n duration: result.duration,\n status: result.status,\n errors: result.errors,\n annotations: result.annotations?.length ? this._relativeAnnotationLocations(result.annotations) : undefined,\n };\n }\n\n private _sendNewAttachments(result: reporterTypes.TestResult, testId: string) {\n const resultId = (result as any)[this._idSymbol] as string;\n // Track whether this step (or something else since the last step) has added attachments and send them\n const knownAttachmentCount = this._resultKnownAttachmentCounts.get(resultId) ?? 0;\n if (result.attachments.length > knownAttachmentCount) {\n this._messageSink({\n method: 'onAttach',\n params: {\n testId,\n resultId,\n attachments: this._serializeAttachments((result.attachments.slice(knownAttachmentCount))),\n }\n });\n }\n\n this._resultKnownAttachmentCounts.set(resultId, result.attachments.length);\n }\n\n _serializeAttachments(attachments: reporterTypes.TestResult['attachments']): teleReceiver.JsonAttachment[] {\n return attachments.map(a => {\n const { body, ...rest } = a;\n return {\n ...rest,\n // There is no Buffer in the browser, so there is no point in sending the data there.\n base64: (body && !this._emitterOptions.omitBuffers) ? body.toString('base64') : undefined,\n };\n });\n }\n\n private _serializeStepStart(step: reporterTypes.TestStep): teleReceiver.JsonTestStepStart {\n return {\n id: (step as any)[this._idSymbol],\n parentStepId: (step.parent as any)?.[this._idSymbol],\n title: step.title,\n category: step.category,\n startTime: +step.startTime,\n location: this._relativeLocation(step.location),\n };\n }\n\n private _serializeStepEnd(step: reporterTypes.TestStep, result: reporterTypes.TestResult): teleReceiver.JsonTestStepEnd {\n return {\n id: (step as any)[this._idSymbol],\n duration: step.duration,\n error: step.error,\n attachments: step.attachments.length ? step.attachments.map(a => result.attachments.indexOf(a)) : undefined,\n annotations: step.annotations.length ? this._relativeAnnotationLocations(step.annotations) : undefined,\n };\n }\n\n private _relativeAnnotationLocations(annotations: TestAnnotation[]): TestAnnotation[] {\n return annotations.map(annotation => ({\n ...annotation,\n location: annotation.location ? this._relativeLocation(annotation.location) : undefined,\n }));\n }\n\n private _relativeLocation(location: reporterTypes.Location): reporterTypes.Location;\n private _relativeLocation(location?: reporterTypes.Location): reporterTypes.Location | undefined;\n private _relativeLocation(location: reporterTypes.Location | undefined): reporterTypes.Location | undefined {\n if (!location)\n return location;\n return {\n ...location,\n file: this._relativePath(location.file),\n };\n }\n\n private _relativePath(absolutePath: string): string;\n private _relativePath(absolutePath?: string): string | undefined;\n private _relativePath(absolutePath?: string): string | undefined {\n if (!absolutePath)\n return absolutePath;\n return path.relative(this._rootDir, absolutePath);\n }\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAgBA,kBAAiB;AAEjB,mBAA2B;AAE3B,0BAAuC;AAYhC,MAAM,oBAA0C;AAAA,EASrD,YAAY,aAAwD,UAAsC,CAAC,GAAG;AAL9G,SAAQ,+BAA+B,oBAAI,IAAoB;AAG/D;AAAA;AAAA,SAAiB,YAAY,OAAO,IAAI;AAGtC,SAAK,eAAe;AACpB,SAAK,kBAAkB;AAAA,EACzB;AAAA,EAEA,UAAgB;AACd,WAAO;AAAA,EACT;AAAA,EAEA,YAAY,QAAkC;AAC5C,SAAK,WAAW,OAAO;AACvB,SAAK,aAAa,EAAE,QAAQ,eAAe,QAAQ,EAAE,QAAQ,KAAK,iBAAiB,MAAM,EAAE,EAAE,CAAC;AAAA,EAChG;AAAA,EAEA,QAAQ,OAA4B;AAClC,UAAM,WAAW,MAAM,OAAO,IAAI,kBAAgB,KAAK,kBAAkB,YAAY,CAAC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+ "names": ["path"]
7
+ }
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __copyProps = (to, from, except, desc) => {
7
+ if (from && typeof from === "object" || typeof from === "function") {
8
+ for (let key of __getOwnPropNames(from))
9
+ if (!__hasOwnProp.call(to, key) && key !== except)
10
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
+ }
12
+ return to;
13
+ };
14
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
+ var blobV1_exports = {};
16
+ module.exports = __toCommonJS(blobV1_exports);
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/reporters/versions/blobV1.ts"],
4
+ "sourcesContent": ["/**\n * Copyright (c) Microsoft Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { Metadata } from '../../../types/test';\nimport type * as reporterTypes from '../../../types/testReporter';\n\nexport type JsonLocation = reporterTypes.Location;\nexport type JsonError = string;\nexport type JsonStackFrame = { file: string, line: number, column: number };\n\nexport type JsonStdIOType = 'stdout' | 'stderr';\n\nexport type JsonConfig = Pick<reporterTypes.FullConfig, 'configFile' | 'globalTimeout' | 'maxFailures' | 'metadata' | 'rootDir' | 'version' | 'workers'>;\n\nexport type JsonPattern = {\n s?: string;\n r?: { source: string, flags: string };\n};\n\nexport type JsonProject = {\n grep: JsonPattern[];\n grepInvert: JsonPattern[];\n metadata: Metadata;\n name: string;\n dependencies: string[];\n // This is relative to root dir.\n snapshotDir: string;\n // This is relative to root dir.\n outputDir: string;\n repeatEach: number;\n retries: number;\n suites: JsonSuite[];\n teardown?: string;\n // This is relative to root dir.\n testDir: string;\n testIgnore: JsonPattern[];\n testMatch: JsonPattern[];\n timeout: number;\n};\n\nexport type JsonSuite = {\n title: string;\n location?: JsonLocation;\n suites: JsonSuite[];\n tests: JsonTestCase[];\n};\n\nexport type JsonTestCase = {\n testId: string;\n title: string;\n location: JsonLocation;\n retries: number;\n tags?: string[];\n repeatEachIndex: number;\n};\n\nexport type JsonTestEnd = {\n testId: string;\n expectedStatus: reporterTypes.TestStatus;\n timeout: number;\n annotations: { type: string, description?: string }[];\n};\n\nexport type JsonTestResultStart = {\n id: string;\n retry: number;\n workerIndex: number;\n parallelIndex: number;\n startTime: number;\n};\n\nexport type JsonAttachment = Omit<reporterTypes.TestResult['attachments'][0], 'body'> & { base64?: string };\n\nexport type JsonTestResultEnd = {\n id: string;\n duration: number;\n status: reporterTypes.TestStatus;\n errors: reporterTypes.TestError[];\n attachments: JsonAttachment[];\n};\n\nexport type JsonTestStepStart = {\n id: string;\n parentStepId?: string;\n title: string;\n category: string,\n startTime: number;\n location?: reporterTypes.Location;\n};\n\nexport type JsonTestStepEnd = {\n id: string;\n duration: number;\n error?: reporterTypes.TestError;\n};\n\nexport type JsonFullResult = {\n status: reporterTypes.FullResult['status'];\n startTime: number;\n duration: number;\n};\n\nexport type JsonEvent = {\n method: string;\n params: any\n};\n\nexport type BlobReportMetadata = {\n version: number;\n userAgent: string;\n name?: string;\n shard?: { total: number, current: number };\n pathSeparator?: string;\n};\n"],
5
+ "mappings": ";;;;;;;;;;;;;;AAAA;AAAA;",
6
+ "names": []
7
+ }