@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 process_exports = {};
20
+ __export(process_exports, {
21
+ ProcessRunner: () => ProcessRunner
22
+ });
23
+ module.exports = __toCommonJS(process_exports);
24
+ var import_utils = require("playwright-core/lib/utils");
25
+ var import_util = require("../util");
26
+ class ProcessRunner {
27
+ async gracefullyClose() {
28
+ }
29
+ dispatchEvent(method, params) {
30
+ const response = { method, params };
31
+ sendMessageToParent({ method: "__dispatch__", params: response });
32
+ }
33
+ }
34
+ let gracefullyCloseCalled = false;
35
+ let forceExitInitiated = false;
36
+ sendMessageToParent({ method: "ready" });
37
+ process.on("disconnect", () => gracefullyCloseAndExit(true));
38
+ process.on("SIGINT", () => {
39
+ });
40
+ process.on("SIGTERM", () => {
41
+ });
42
+ let processRunner;
43
+ let processName;
44
+ const startingEnv = { ...process.env };
45
+ process.on("message", async (message) => {
46
+ if (message.method === "__init__") {
47
+ const { processParams, runnerParams, runnerScript } = message.params;
48
+ void (0, import_utils.startProfiling)();
49
+ (0, import_utils.setTimeOrigin)(processParams.timeOrigin);
50
+ const { create } = require(runnerScript);
51
+ processRunner = create(runnerParams);
52
+ processName = processParams.processName;
53
+ return;
54
+ }
55
+ if (message.method === "__stop__") {
56
+ const keys = /* @__PURE__ */ new Set([...Object.keys(process.env), ...Object.keys(startingEnv)]);
57
+ const producedEnv = [...keys].filter((key) => startingEnv[key] !== process.env[key]).map((key) => [key, process.env[key] ?? null]);
58
+ sendMessageToParent({ method: "__env_produced__", params: producedEnv });
59
+ await gracefullyCloseAndExit(false);
60
+ return;
61
+ }
62
+ if (message.method === "__dispatch__") {
63
+ const { id, method, params } = message.params;
64
+ try {
65
+ const result = await processRunner[method](params);
66
+ const response = { id, result };
67
+ sendMessageToParent({ method: "__dispatch__", params: response });
68
+ } catch (e) {
69
+ const response = { id, error: (0, import_util.serializeError)(e) };
70
+ sendMessageToParent({ method: "__dispatch__", params: response });
71
+ }
72
+ }
73
+ });
74
+ const kForceExitTimeout = +(process.env.PWTEST_FORCE_EXIT_TIMEOUT || 3e4);
75
+ async function gracefullyCloseAndExit(forceExit) {
76
+ if (forceExit && !forceExitInitiated) {
77
+ forceExitInitiated = true;
78
+ setTimeout(() => process.exit(0), kForceExitTimeout);
79
+ }
80
+ if (!gracefullyCloseCalled) {
81
+ gracefullyCloseCalled = true;
82
+ await processRunner?.gracefullyClose().catch(() => {
83
+ });
84
+ if (processName)
85
+ await (0, import_utils.stopProfiling)(processName).catch(() => {
86
+ });
87
+ process.exit(0);
88
+ }
89
+ }
90
+ function sendMessageToParent(message) {
91
+ try {
92
+ process.send(message);
93
+ } catch (e) {
94
+ try {
95
+ JSON.stringify(message);
96
+ } catch {
97
+ throw e;
98
+ }
99
+ }
100
+ }
101
+ // Annotate the CommonJS export names for ESM import in node:
102
+ 0 && (module.exports = {
103
+ ProcessRunner
104
+ });
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/common/process.ts"],
4
+ "sourcesContent": ["/**\n * Copyright Microsoft Corporation. All rights reserved.\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 { setTimeOrigin, startProfiling, stopProfiling } from 'playwright-core/lib/utils';\n\nimport { serializeError } from '../util';\n\nimport type { EnvProducedPayload, ProcessInitParams, TestInfoErrorImpl } from './ipc';\n\nexport type ProtocolRequest = {\n id: number;\n method: string;\n params?: any;\n};\n\nexport type ProtocolResponse = {\n id?: number;\n error?: TestInfoErrorImpl;\n method?: string;\n params?: any;\n result?: any;\n};\n\nexport class ProcessRunner {\n async gracefullyClose(): Promise<void> { }\n\n protected dispatchEvent(method: string, params: any) {\n const response: ProtocolResponse = { method, params };\n sendMessageToParent({ method: '__dispatch__', params: response });\n }\n}\n\nlet gracefullyCloseCalled = false;\nlet forceExitInitiated = false;\n\nsendMessageToParent({ method: 'ready' });\n\nprocess.on('disconnect', () => gracefullyCloseAndExit(true));\nprocess.on('SIGINT', () => {});\nprocess.on('SIGTERM', () => {});\n\nlet processRunner: ProcessRunner | undefined;\nlet processName: string | undefined;\nconst startingEnv = { ...process.env };\n\nprocess.on('message', async (message: any) => {\n if (message.method === '__init__') {\n const { processParams, runnerParams, runnerScript } = message.params as { processParams: ProcessInitParams, runnerParams: any, runnerScript: string };\n void startProfiling();\n setTimeOrigin(processParams.timeOrigin);\n const { create } = require(runnerScript);\n processRunner = create(runnerParams) as ProcessRunner;\n processName = processParams.processName;\n return;\n }\n if (message.method === '__stop__') {\n const keys = new Set([...Object.keys(process.env), ...Object.keys(startingEnv)]);\n const producedEnv: EnvProducedPayload = [...keys].filter(key => startingEnv[key] !== process.env[key]).map(key => [key, process.env[key] ?? null]);\n sendMessageToParent({ method: '__env_produced__', params: producedEnv });\n await gracefullyCloseAndExit(false);\n return;\n }\n if (message.method === '__dispatch__') {\n const { id, method, params } = message.params as ProtocolRequest;\n try {\n const result = await (processRunner as any)[method](params);\n const response: ProtocolResponse = { id, result };\n sendMessageToParent({ method: '__dispatch__', params: response });\n } catch (e) {\n const response: ProtocolResponse = { id, error: serializeError(e) };\n sendMessageToParent({ method: '__dispatch__', params: response });\n }\n }\n});\n\nconst kForceExitTimeout = +(process.env.PWTEST_FORCE_EXIT_TIMEOUT || 30000);\n\nasync function gracefullyCloseAndExit(forceExit: boolean) {\n if (forceExit && !forceExitInitiated) {\n forceExitInitiated = true;\n // Force exit after 30 seconds.\n // eslint-disable-next-line no-restricted-properties\n setTimeout(() => process.exit(0), kForceExitTimeout);\n }\n if (!gracefullyCloseCalled) {\n gracefullyCloseCalled = true;\n // Meanwhile, try to gracefully shutdown.\n await processRunner?.gracefullyClose().catch(() => {});\n if (processName)\n await stopProfiling(processName).catch(() => {});\n // eslint-disable-next-line no-restricted-properties\n process.exit(0);\n }\n}\n\nfunction sendMessageToParent(message: { method: string, params?: any }) {\n try {\n process.send!(message);\n } catch (e) {\n try {\n // By default, the IPC messages are serialized as JSON.\n JSON.stringify(message);\n } catch {\n // Always throw serialization errors.\n throw e;\n }\n // Can throw when closing.\n }\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAgBA,mBAA6D;AAE7D,kBAA+B;AAkBxB,MAAM,cAAc;AAAA,EACzB,MAAM,kBAAiC;AAAA,EAAE;AAAA,EAE/B,cAAc,QAAgB,QAAa;AACnD,UAAM,WA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6B,EAAE,IAAI,OAAO;AAChD,0BAAoB,EAAE,QAAQ,gBAAgB,QAAQ,SAAS,CAAC;AAAA,IAClE,SAAS,GAAG;AACV,YAAM,WAA6B,EAAE,IAAI,WAAO,4BAAe,CAAC,EAAE;AAClE,0BAAoB,EAAE,QAAQ,gBAAgB,QAAQ,SAAS,CAAC;AAAA,IAClE;AAAA,EACF;AACF,CAAC;AAED,MAAM,oBAAoB,EAAE,QAAQ,IAAI,6BAA6B;AAErE,eAAe,uBAAuB,WAAoB;AACxD,MAAI,aAAa,CAAC,oBAAoB;AACpC,yBAAqB;AAGrB,eAAW,MAAM,QAAQ,KAAK,CAAC,GAAG,iBAAiB;AAAA,EACrD;AACA,MAAI,CAAC,uBAAuB;AAC1B,4BAAwB;AAExB,UAAM,eAAe,gBAAgB,EAAE,MAAM,MAAM;AAAA,IAAC,CAAC;AACrD,QAAI;AACF,gBAAM,4BAAc,WAAW,EAAE,MAAM,MAAM;AAAA,MAAC,CAAC;AAEjD,YAAQ,KAAK,CAAC;AAAA,EAChB;AACF;AAEA,SAAS,oBAAoB,SAA2C;AACtE,MAAI;AACF,YAAQ,KAAM,OAAO;AAAA,EACvB,SAAS,GAAG;AACV,QAAI;AAEF,WAAK,UAAU,OAAO;AAAA,IACxB,QAAQ;AAEN,YAAM;AAAA,IACR;AAAA,EAEF;AACF;",
6
+ "names": []
7
+ }
@@ -0,0 +1,140 @@
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 suiteUtils_exports = {};
30
+ __export(suiteUtils_exports, {
31
+ applyRepeatEachIndex: () => applyRepeatEachIndex,
32
+ bindFileSuiteToProject: () => bindFileSuiteToProject,
33
+ filterByFocusedLine: () => filterByFocusedLine,
34
+ filterOnly: () => filterOnly,
35
+ filterSuite: () => filterSuite,
36
+ filterTestsRemoveEmptySuites: () => filterTestsRemoveEmptySuites
37
+ });
38
+ module.exports = __toCommonJS(suiteUtils_exports);
39
+ var import_path = __toESM(require("path"));
40
+ var import_utils = require("playwright-core/lib/utils");
41
+ var import_util = require("../util");
42
+ function filterSuite(suite, suiteFilter, testFilter) {
43
+ for (const child of suite.suites) {
44
+ if (!suiteFilter(child))
45
+ filterSuite(child, suiteFilter, testFilter);
46
+ }
47
+ const filteredTests = suite.tests.filter(testFilter);
48
+ const entries = /* @__PURE__ */ new Set([...suite.suites, ...filteredTests]);
49
+ suite._entries = suite._entries.filter((e) => entries.has(e));
50
+ }
51
+ function filterTestsRemoveEmptySuites(suite, filter) {
52
+ const filteredSuites = suite.suites.filter((child) => filterTestsRemoveEmptySuites(child, filter));
53
+ const filteredTests = suite.tests.filter(filter);
54
+ const entries = /* @__PURE__ */ new Set([...filteredSuites, ...filteredTests]);
55
+ suite._entries = suite._entries.filter((e) => entries.has(e));
56
+ return !!suite._entries.length;
57
+ }
58
+ function bindFileSuiteToProject(project, suite) {
59
+ const relativeFile = import_path.default.relative(project.project.testDir, suite.location.file);
60
+ const fileId = (0, import_utils.calculateSha1)((0, import_utils.toPosixPath)(relativeFile)).slice(0, 20);
61
+ const result = suite._deepClone();
62
+ result._fileId = fileId;
63
+ result.forEachTest((test, suite2) => {
64
+ suite2._fileId = fileId;
65
+ const [file, ...titles] = test.titlePath();
66
+ const testIdExpression = `[project=${project.id}]${(0, import_utils.toPosixPath)(file)}${titles.join("")}`;
67
+ const testId = fileId + "-" + (0, import_utils.calculateSha1)(testIdExpression).slice(0, 20);
68
+ test.id = testId;
69
+ test._projectId = project.id;
70
+ let inheritedRetries;
71
+ let inheritedTimeout;
72
+ for (let parentSuite = suite2; parentSuite; parentSuite = parentSuite.parent) {
73
+ if (parentSuite._staticAnnotations.length)
74
+ test.annotations.unshift(...parentSuite._staticAnnotations);
75
+ if (inheritedRetries === void 0 && parentSuite._retries !== void 0)
76
+ inheritedRetries = parentSuite._retries;
77
+ if (inheritedTimeout === void 0 && parentSuite._timeout !== void 0)
78
+ inheritedTimeout = parentSuite._timeout;
79
+ }
80
+ test.retries = inheritedRetries ?? project.project.retries;
81
+ test.timeout = inheritedTimeout ?? project.project.timeout;
82
+ if (test.annotations.some((a) => a.type === "skip" || a.type === "fixme"))
83
+ test.expectedStatus = "skipped";
84
+ if (test._poolDigest)
85
+ test._workerHash = `${project.id}-${test._poolDigest}-0`;
86
+ });
87
+ return result;
88
+ }
89
+ function applyRepeatEachIndex(project, fileSuite, repeatEachIndex) {
90
+ fileSuite.forEachTest((test, suite) => {
91
+ if (repeatEachIndex) {
92
+ const [file, ...titles] = test.titlePath();
93
+ const testIdExpression = `[project=${project.id}]${(0, import_utils.toPosixPath)(file)}${titles.join("")} (repeat:${repeatEachIndex})`;
94
+ const testId = suite._fileId + "-" + (0, import_utils.calculateSha1)(testIdExpression).slice(0, 20);
95
+ test.id = testId;
96
+ test.repeatEachIndex = repeatEachIndex;
97
+ if (test._poolDigest)
98
+ test._workerHash = `${project.id}-${test._poolDigest}-${repeatEachIndex}`;
99
+ }
100
+ });
101
+ }
102
+ function filterOnly(suite) {
103
+ if (!suite._getOnlyItems().length)
104
+ return;
105
+ const suiteFilter = (suite2) => suite2._only;
106
+ const testFilter = (test) => test._only;
107
+ return filterSuiteWithOnlySemantics(suite, suiteFilter, testFilter);
108
+ }
109
+ function filterSuiteWithOnlySemantics(suite, suiteFilter, testFilter) {
110
+ const onlySuites = suite.suites.filter((child) => filterSuiteWithOnlySemantics(child, suiteFilter, testFilter) || suiteFilter(child));
111
+ const onlyTests = suite.tests.filter(testFilter);
112
+ const onlyEntries = /* @__PURE__ */ new Set([...onlySuites, ...onlyTests]);
113
+ if (onlyEntries.size) {
114
+ suite._entries = suite._entries.filter((e) => onlyEntries.has(e));
115
+ return true;
116
+ }
117
+ return false;
118
+ }
119
+ function filterByFocusedLine(suite, focusedTestFileLines) {
120
+ if (!focusedTestFileLines.length)
121
+ return;
122
+ const matchers = focusedTestFileLines.map(createFileMatcherFromFilter);
123
+ const testFileLineMatches = (testFileName, testLine, testColumn) => matchers.some((m) => m(testFileName, testLine, testColumn));
124
+ const suiteFilter = (suite2) => !!suite2.location && testFileLineMatches(suite2.location.file, suite2.location.line, suite2.location.column);
125
+ const testFilter = (test) => testFileLineMatches(test.location.file, test.location.line, test.location.column);
126
+ return filterSuite(suite, suiteFilter, testFilter);
127
+ }
128
+ function createFileMatcherFromFilter(filter) {
129
+ const fileMatcher = (0, import_util.createFileMatcher)(filter.re || filter.exact || "");
130
+ return (testFileName, testLine, testColumn) => fileMatcher(testFileName) && (filter.line === testLine || filter.line === null) && (filter.column === testColumn || filter.column === null);
131
+ }
132
+ // Annotate the CommonJS export names for ESM import in node:
133
+ 0 && (module.exports = {
134
+ applyRepeatEachIndex,
135
+ bindFileSuiteToProject,
136
+ filterByFocusedLine,
137
+ filterOnly,
138
+ filterSuite,
139
+ filterTestsRemoveEmptySuites
140
+ });
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/common/suiteUtils.ts"],
4
+ "sourcesContent": ["/**\n* Copyright Microsoft Corporation. All rights reserved.\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 { calculateSha1, toPosixPath } from 'playwright-core/lib/utils';\n\nimport { createFileMatcher } from '../util';\n\nimport type { FullProjectInternal } from './config';\nimport type { Suite, TestCase } from './test';\nimport type { TestCaseFilter, TestFileFilter } from '../util';\n\n\nexport function filterSuite(suite: Suite, suiteFilter: (suites: Suite) => boolean, testFilter: TestCaseFilter) {\n for (const child of suite.suites) {\n if (!suiteFilter(child))\n filterSuite(child, suiteFilter, testFilter);\n }\n const filteredTests = suite.tests.filter(testFilter);\n const entries = new Set([...suite.suites, ...filteredTests]);\n suite._entries = suite._entries.filter(e => entries.has(e)); // Preserve the order.\n}\n\nexport function filterTestsRemoveEmptySuites(suite: Suite, filter: TestCaseFilter): boolean {\n const filteredSuites = suite.suites.filter(child => filterTestsRemoveEmptySuites(child, filter));\n const filteredTests = suite.tests.filter(filter);\n const entries = new Set([...filteredSuites, ...filteredTests]);\n suite._entries = suite._entries.filter(e => entries.has(e)); // Preserve the order.\n return !!suite._entries.length;\n}\n\nexport function bindFileSuiteToProject(project: FullProjectInternal, suite: Suite): Suite {\n const relativeFile = path.relative(project.project.testDir, suite.location!.file);\n const fileId = calculateSha1(toPosixPath(relativeFile)).slice(0, 20);\n\n // Clone suite.\n const result = suite._deepClone();\n result._fileId = fileId;\n\n // Assign test properties with project-specific values.\n result.forEachTest((test, suite) => {\n suite._fileId = fileId;\n // At the point of the query, suite is not yet attached to the project, so we only get file, describe and test titles.\n const [file, ...titles] = test.titlePath();\n const testIdExpression = `[project=${project.id}]${toPosixPath(file)}\\x1e${titles.join('\\x1e')}`;\n const testId = fileId + '-' + calculateSha1(testIdExpression).slice(0, 20);\n test.id = testId;\n test._projectId = project.id;\n\n // Inherit properties from parent suites.\n let inheritedRetries: number | undefined;\n let inheritedTimeout: number | undefined;\n for (let parentSuite: Suite | undefined = suite; parentSuite; parentSuite = parentSuite.parent) {\n if (parentSuite._staticAnnotations.length)\n test.annotations.unshift(...parentSuite._staticAnnotations);\n if (inheritedRetries === undefined && parentSuite._retries !== undefined)\n inheritedRetries = parentSuite._retries;\n if (inheritedTimeout === undefined && parentSuite._timeout !== undefined)\n inheritedTimeout = parentSuite._timeout;\n }\n test.retries = inheritedRetries ?? project.project.retries;\n test.timeout = inheritedTimeout ?? project.project.timeout;\n\n // Skip annotations imply skipped expectedStatus.\n if (test.annotations.some(a => a.type === 'skip' || a.type === 'fixme'))\n test.expectedStatus = 'skipped';\n\n // We only compute / set digest in the runner.\n if (test._poolDigest)\n test._workerHash = `${project.id}-${test._poolDigest}-0`;\n });\n\n return result;\n}\n\nexport function applyRepeatEachIndex(project: FullProjectInternal, fileSuite: Suite, repeatEachIndex: number) {\n // Assign test properties with project-specific values.\n fileSuite.forEachTest((test, suite) => {\n if (repeatEachIndex) {\n const [file, ...titles] = test.titlePath();\n const testIdExpression = `[project=${project.id}]${toPosixPath(file)}\\x1e${titles.join('\\x1e')} (repeat:${repeatEachIndex})`;\n const testId = suite._fileId + '-' + calculateSha1(testIdExpression).slice(0, 20);\n test.id = testId;\n test.repeatEachIndex = repeatEachIndex;\n\n if (test._poolDigest)\n test._workerHash = `${project.id}-${test._poolDigest}-${repeatEachIndex}`;\n }\n });\n}\n\nexport function filterOnly(suite: Suite) {\n if (!suite._getOnlyItems().length)\n return;\n const suiteFilter = (suite: Suite) => suite._only;\n const testFilter = (test: TestCase) => test._only;\n return filterSuiteWithOnlySemantics(suite, suiteFilter, testFilter);\n}\n\nfunction filterSuiteWithOnlySemantics(suite: Suite, suiteFilter: (suites: Suite) => boolean, testFilter: TestCaseFilter) {\n const onlySuites = suite.suites.filter(child => filterSuiteWithOnlySemantics(child, suiteFilter, testFilter) || suiteFilter(child));\n const onlyTests = suite.tests.filter(testFilter);\n const onlyEntries = new Set([...onlySuites, ...onlyTests]);\n if (onlyEntries.size) {\n suite._entries = suite._entries.filter(e => onlyEntries.has(e)); // Preserve the order.\n return true;\n }\n return false;\n}\n\nexport function filterByFocusedLine(suite: Suite, focusedTestFileLines: TestFileFilter[]) {\n if (!focusedTestFileLines.length)\n return;\n const matchers = focusedTestFileLines.map(createFileMatcherFromFilter);\n const testFileLineMatches = (testFileName: string, testLine: number, testColumn: number) => matchers.some(m => m(testFileName, testLine, testColumn));\n const suiteFilter = (suite: Suite) => !!suite.location && testFileLineMatches(suite.location.file, suite.location.line, suite.location.column);\n const testFilter = (test: TestCase) => testFileLineMatches(test.location.file, test.location.line, test.location.column);\n return filterSuite(suite, suiteFilter, testFilter);\n}\n\nfunction createFileMatcherFromFilter(filter: TestFileFilter) {\n const fileMatcher = createFileMatcher(filter.re || filter.exact || '');\n return (testFileName: string, testLine: number, testColumn: number) =>\n fileMatcher(testFileName) && (filter.line === testLine || filter.line === null) && (filter.column === testColumn || filter.column === null);\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAgBA,kBAAiB;AAEjB,mBAA2C;AAE3C,kBAAkC;AAO3B,SAAS,YAAY,OAAc,aAAyC,YAA4B;AAC7G,aAAW,SAAS,MAAM,QAAQ;AAChC,QAAI,CAAC,YAAY,KAAK;AACpB,kBAAY,OAAO,aAAa,UAAU;AAAA,EAC9C;AACA,QAAM,gBAAgB,MAAM,MAAM,O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,OAAO,UAAU;AAC/C,QAAM,cAAc,oBAAI,IAAI,CAAC,GAAG,YAAY,GAAG,SAAS,CAAC;AACzD,MAAI,YAAY,MAAM;AACpB,UAAM,WAAW,MAAM,SAAS,OAAO,OAAK,YAAY,IAAI,CAAC,CAAC;AAC9D,WAAO;AAAA,EACT;AACA,SAAO;AACT;AAEO,SAAS,oBAAoB,OAAc,sBAAwC;AACxF,MAAI,CAAC,qBAAqB;AACxB;AACF,QAAM,WAAW,qBAAqB,IAAI,2BAA2B;AACrE,QAAM,sBAAsB,CAAC,cAAsB,UAAkB,eAAuB,SAAS,KAAK,OAAK,EAAE,cAAc,UAAU,UAAU,CAAC;AACpJ,QAAM,cAAc,CAACA,WAAiB,CAAC,CAACA,OAAM,YAAY,oBAAoBA,OAAM,SAAS,MAAMA,OAAM,SAAS,MAAMA,OAAM,SAAS,MAAM;AAC7I,QAAM,aAAa,CAAC,SAAmB,oBAAoB,KAAK,SAAS,MAAM,KAAK,SAAS,MAAM,KAAK,SAAS,MAAM;AACvH,SAAO,YAAY,OAAO,aAAa,UAAU;AACnD;AAEA,SAAS,4BAA4B,QAAwB;AAC3D,QAAM,kBAAc,+BAAkB,OAAO,MAAM,OAAO,SAAS,EAAE;AACrE,SAAO,CAAC,cAAsB,UAAkB,eAC9C,YAAY,YAAY,MAAM,OAAO,SAAS,YAAY,OAAO,SAAS,UAAU,OAAO,WAAW,cAAc,OAAO,WAAW;AAC1I;",
6
+ "names": ["path", "suite"]
7
+ }
@@ -0,0 +1,321 @@
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 test_exports = {};
20
+ __export(test_exports, {
21
+ Suite: () => Suite,
22
+ TestCase: () => TestCase
23
+ });
24
+ module.exports = __toCommonJS(test_exports);
25
+ var import_testType = require("./testType");
26
+ var import_teleReceiver = require("../isomorphic/teleReceiver");
27
+ class Base {
28
+ constructor(title) {
29
+ this._only = false;
30
+ this._requireFile = "";
31
+ this.title = title;
32
+ }
33
+ }
34
+ class Suite extends Base {
35
+ constructor(title, type) {
36
+ super(title);
37
+ this._use = [];
38
+ this._entries = [];
39
+ this._hooks = [];
40
+ // Annotations known statically before running the test, e.g. `test.describe.skip()` or `test.describe({ annotation }, body)`.
41
+ this._staticAnnotations = [];
42
+ // Explicitly declared tags that are not a part of the title.
43
+ this._tags = [];
44
+ this._modifiers = [];
45
+ this._parallelMode = "none";
46
+ this._type = type;
47
+ }
48
+ get type() {
49
+ return this._type;
50
+ }
51
+ entries() {
52
+ return this._entries;
53
+ }
54
+ get suites() {
55
+ return this._entries.filter((entry) => entry instanceof Suite);
56
+ }
57
+ get tests() {
58
+ return this._entries.filter((entry) => entry instanceof TestCase);
59
+ }
60
+ _addTest(test) {
61
+ test.parent = this;
62
+ this._entries.push(test);
63
+ }
64
+ _addSuite(suite) {
65
+ suite.parent = this;
66
+ this._entries.push(suite);
67
+ }
68
+ _prependSuite(suite) {
69
+ suite.parent = this;
70
+ this._entries.unshift(suite);
71
+ }
72
+ allTests() {
73
+ const result = [];
74
+ const visit = (suite) => {
75
+ for (const entry of suite._entries) {
76
+ if (entry instanceof Suite)
77
+ visit(entry);
78
+ else
79
+ result.push(entry);
80
+ }
81
+ };
82
+ visit(this);
83
+ return result;
84
+ }
85
+ _hasTests() {
86
+ let result = false;
87
+ const visit = (suite) => {
88
+ for (const entry of suite._entries) {
89
+ if (result)
90
+ return;
91
+ if (entry instanceof Suite)
92
+ visit(entry);
93
+ else
94
+ result = true;
95
+ }
96
+ };
97
+ visit(this);
98
+ return result;
99
+ }
100
+ titlePath() {
101
+ const titlePath = this.parent ? this.parent.titlePath() : [];
102
+ if (this.title || this._type !== "describe")
103
+ titlePath.push(this.title);
104
+ return titlePath;
105
+ }
106
+ _collectGrepTitlePath(path) {
107
+ if (this.parent)
108
+ this.parent._collectGrepTitlePath(path);
109
+ if (this.title || this._type !== "describe")
110
+ path.push(this.title);
111
+ path.push(...this._tags);
112
+ }
113
+ _getOnlyItems() {
114
+ const items = [];
115
+ if (this._only)
116
+ items.push(this);
117
+ for (const suite of this.suites)
118
+ items.push(...suite._getOnlyItems());
119
+ items.push(...this.tests.filter((test) => test._only));
120
+ return items;
121
+ }
122
+ _deepClone() {
123
+ const suite = this._clone();
124
+ for (const entry of this._entries) {
125
+ if (entry instanceof Suite)
126
+ suite._addSuite(entry._deepClone());
127
+ else
128
+ suite._addTest(entry._clone());
129
+ }
130
+ return suite;
131
+ }
132
+ _deepSerialize() {
133
+ const suite = this._serialize();
134
+ suite.entries = [];
135
+ for (const entry of this._entries) {
136
+ if (entry instanceof Suite)
137
+ suite.entries.push(entry._deepSerialize());
138
+ else
139
+ suite.entries.push(entry._serialize());
140
+ }
141
+ return suite;
142
+ }
143
+ static _deepParse(data) {
144
+ const suite = Suite._parse(data);
145
+ for (const entry of data.entries) {
146
+ if (entry.kind === "suite")
147
+ suite._addSuite(Suite._deepParse(entry));
148
+ else
149
+ suite._addTest(TestCase._parse(entry));
150
+ }
151
+ return suite;
152
+ }
153
+ forEachTest(visitor) {
154
+ for (const entry of this._entries) {
155
+ if (entry instanceof Suite)
156
+ entry.forEachTest(visitor);
157
+ else
158
+ visitor(entry, this);
159
+ }
160
+ }
161
+ _serialize() {
162
+ return {
163
+ kind: "suite",
164
+ title: this.title,
165
+ type: this._type,
166
+ location: this.location,
167
+ only: this._only,
168
+ requireFile: this._requireFile,
169
+ timeout: this._timeout,
170
+ retries: this._retries,
171
+ staticAnnotations: this._staticAnnotations.slice(),
172
+ tags: this._tags.slice(),
173
+ modifiers: this._modifiers.slice(),
174
+ parallelMode: this._parallelMode,
175
+ hooks: this._hooks.map((h) => ({ type: h.type, location: h.location, title: h.title })),
176
+ fileId: this._fileId
177
+ };
178
+ }
179
+ static _parse(data) {
180
+ const suite = new Suite(data.title, data.type);
181
+ suite.location = data.location;
182
+ suite._only = data.only;
183
+ suite._requireFile = data.requireFile;
184
+ suite._timeout = data.timeout;
185
+ suite._retries = data.retries;
186
+ suite._staticAnnotations = data.staticAnnotations;
187
+ suite._tags = data.tags;
188
+ suite._modifiers = data.modifiers;
189
+ suite._parallelMode = data.parallelMode;
190
+ suite._hooks = data.hooks.map((h) => ({ type: h.type, location: h.location, title: h.title, fn: () => {
191
+ } }));
192
+ suite._fileId = data.fileId;
193
+ return suite;
194
+ }
195
+ _clone() {
196
+ const data = this._serialize();
197
+ const suite = Suite._parse(data);
198
+ suite._use = this._use.slice();
199
+ suite._hooks = this._hooks.slice();
200
+ suite._fullProject = this._fullProject;
201
+ return suite;
202
+ }
203
+ project() {
204
+ return this._fullProject?.project || this.parent?.project();
205
+ }
206
+ }
207
+ class TestCase extends Base {
208
+ constructor(title, fn, testType, location) {
209
+ super(title);
210
+ this.results = [];
211
+ this.type = "test";
212
+ this.expectedStatus = "passed";
213
+ this.timeout = 0;
214
+ this.annotations = [];
215
+ this.retries = 0;
216
+ this.repeatEachIndex = 0;
217
+ this.id = "";
218
+ this._poolDigest = "";
219
+ this._workerHash = "";
220
+ this._projectId = "";
221
+ // Explicitly declared tags that are not a part of the title.
222
+ this._tags = [];
223
+ this.fn = fn;
224
+ this._testType = testType;
225
+ this.location = location;
226
+ }
227
+ titlePath() {
228
+ const titlePath = this.parent ? this.parent.titlePath() : [];
229
+ titlePath.push(this.title);
230
+ return titlePath;
231
+ }
232
+ outcome() {
233
+ return (0, import_teleReceiver.computeTestCaseOutcome)(this);
234
+ }
235
+ ok() {
236
+ const status = this.outcome();
237
+ return status === "expected" || status === "flaky" || status === "skipped";
238
+ }
239
+ get tags() {
240
+ const titleTags = this._grepBaseTitlePath().join(" ").match(/@[\S]+/g) || [];
241
+ return [
242
+ ...titleTags,
243
+ ...this._tags
244
+ ];
245
+ }
246
+ _serialize() {
247
+ return {
248
+ kind: "test",
249
+ id: this.id,
250
+ title: this.title,
251
+ retries: this.retries,
252
+ timeout: this.timeout,
253
+ expectedStatus: this.expectedStatus,
254
+ location: this.location,
255
+ only: this._only,
256
+ requireFile: this._requireFile,
257
+ poolDigest: this._poolDigest,
258
+ workerHash: this._workerHash,
259
+ annotations: this.annotations.slice(),
260
+ tags: this._tags.slice(),
261
+ projectId: this._projectId
262
+ };
263
+ }
264
+ static _parse(data) {
265
+ const test = new TestCase(data.title, () => {
266
+ }, import_testType.rootTestType, data.location);
267
+ test.id = data.id;
268
+ test.retries = data.retries;
269
+ test.timeout = data.timeout;
270
+ test.expectedStatus = data.expectedStatus;
271
+ test._only = data.only;
272
+ test._requireFile = data.requireFile;
273
+ test._poolDigest = data.poolDigest;
274
+ test._workerHash = data.workerHash;
275
+ test.annotations = data.annotations;
276
+ test._tags = data.tags;
277
+ test._projectId = data.projectId;
278
+ return test;
279
+ }
280
+ _clone() {
281
+ const data = this._serialize();
282
+ const test = TestCase._parse(data);
283
+ test._testType = this._testType;
284
+ test.fn = this.fn;
285
+ return test;
286
+ }
287
+ _appendTestResult() {
288
+ const result = {
289
+ retry: this.results.length,
290
+ parallelIndex: -1,
291
+ workerIndex: -1,
292
+ duration: 0,
293
+ startTime: /* @__PURE__ */ new Date(),
294
+ stdout: [],
295
+ stderr: [],
296
+ attachments: [],
297
+ status: "skipped",
298
+ steps: [],
299
+ errors: [],
300
+ annotations: []
301
+ };
302
+ this.results.push(result);
303
+ return result;
304
+ }
305
+ _grepBaseTitlePath() {
306
+ const path = [];
307
+ this.parent._collectGrepTitlePath(path);
308
+ path.push(this.title);
309
+ return path;
310
+ }
311
+ _grepTitleWithTags() {
312
+ const path = this._grepBaseTitlePath();
313
+ path.push(...this._tags);
314
+ return path.join(" ");
315
+ }
316
+ }
317
+ // Annotate the CommonJS export names for ESM import in node:
318
+ 0 && (module.exports = {
319
+ Suite,
320
+ TestCase
321
+ });
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/common/test.ts"],
4
+ "sourcesContent": ["/**\n * Copyright Microsoft Corporation. All rights reserved.\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 { rootTestType } from './testType';\nimport { computeTestCaseOutcome } from '../isomorphic/teleReceiver';\n\nimport type { FixturesWithLocation, FullProjectInternal } from './config';\nimport type { FixturePool } from './fixtures';\nimport type { TestTypeImpl } from './testType';\nimport type { TestAnnotation } from '../../types/test';\nimport type * as reporterTypes from '../../types/testReporter';\nimport type { FullProject, Location } from '../../types/testReporter';\n\n\nclass Base {\n title: string;\n _only = false;\n _requireFile: string = '';\n\n constructor(title: string) {\n this.title = title;\n }\n}\n\nexport type Modifier = {\n type: 'slow' | 'fixme' | 'skip' | 'fail',\n fn: Function,\n location: Location,\n description: string | undefined\n};\n\nexport class Suite extends Base {\n location?: Location;\n parent?: Suite;\n _use: FixturesWithLocation[] = [];\n _entries: (Suite | TestCase)[] = [];\n _hooks: { type: 'beforeEach' | 'afterEach' | 'beforeAll' | 'afterAll', fn: Function, title: string, location: Location }[] = [];\n _timeout: number | undefined;\n _retries: number | undefined;\n // Annotations known statically before running the test, e.g. `test.describe.skip()` or `test.describe({ annotation }, body)`.\n _staticAnnotations: TestAnnotation[] = [];\n // Explicitly declared tags that are not a part of the title.\n _tags: string[] = [];\n _modifiers: Modifier[] = [];\n _parallelMode: 'none' | 'default' | 'serial' | 'parallel' = 'none';\n _fullProject: FullProjectInternal | undefined;\n _fileId: string | undefined;\n readonly _type: 'root' | 'project' | 'file' | 'describe';\n\n constructor(title: string, type: 'root' | 'project' | 'file' | 'describe') {\n super(title);\n this._type = type;\n }\n\n get type(): 'root' | 'project' | 'file' | 'describe' {\n return this._type;\n }\n\n entries() {\n return this._entries;\n }\n\n get suites(): Suite[] {\n return this._entries.filter(entry => entry instanceof Suite) as Suite[];\n }\n\n get tests(): TestCase[] {\n return this._entries.filter(entry => entry instanceof TestCase) as TestCase[];\n }\n\n _addTest(test: TestCase) {\n test.parent = this;\n this._entries.push(test);\n }\n\n _addSuite(suite: Suite) {\n suite.parent = this;\n this._entries.push(suite);\n }\n\n _prependSuite(suite: Suite) {\n suite.parent = this;\n this._entries.unshift(suite);\n }\n\n allTests(): TestCase[] {\n const result: TestCase[] = [];\n const visit = (suite: Suite) => {\n for (const entry of suite._entries) {\n if (entry instanceof Suite)\n visit(entry);\n else\n result.push(entry);\n }\n };\n visit(this);\n return result;\n }\n\n _hasTests(): boolean {\n let result = false;\n const visit = (suite: Suite) => {\n for (const entry of suite._entries) {\n if (result)\n return;\n if (entry instanceof Suite)\n visit(entry);\n else\n result = true;\n }\n };\n visit(this);\n return result;\n }\n\n titlePath(): string[] {\n const titlePath = this.parent ? this.parent.titlePath() : [];\n // Ignore anonymous describe blocks.\n if (this.title || this._type !== 'describe')\n titlePath.push(this.title);\n return titlePath;\n }\n\n _collectGrepTitlePath(path: string[]) {\n if (this.parent)\n this.parent._collectGrepTitlePath(path);\n if (this.title || this._type !== 'describe')\n path.push(this.title);\n path.push(...this._tags);\n }\n\n _getOnlyItems(): (TestCase | Suite)[] {\n const items: (TestCase | Suite)[] = [];\n if (this._only)\n items.push(this);\n for (const suite of this.suites)\n items.push(...suite._getOnlyItems());\n items.push(...this.tests.filter(test => test._only));\n return items;\n }\n\n _deepClone(): Suite {\n const suite = this._clone();\n for (const entry of this._entries) {\n if (entry instanceof Suite)\n suite._addSuite(entry._deepClone());\n else\n suite._addTest(entry._clone());\n }\n return suite;\n }\n\n _deepSerialize(): any {\n const suite = this._serialize();\n suite.entries = [];\n for (const entry of this._entries) {\n if (entry instanceof Suite)\n suite.entries.push(entry._deepSerialize());\n else\n suite.entries.push(entry._serialize());\n }\n return suite;\n }\n\n static _deepParse(data: any): Suite {\n const suite = Suite._parse(data);\n for (const entry of data.entries) {\n if (entry.kind === 'suite')\n suite._addSuite(Suite._deepParse(entry));\n else\n suite._addTest(TestCase._parse(entry));\n }\n return suite;\n }\n\n forEachTest(visitor: (test: TestCase, suite: Suite) => void) {\n for (const entry of this._entries) {\n if (entry instanceof Suite)\n entry.forEachTest(visitor);\n else\n visitor(entry, this);\n }\n }\n\n _serialize(): any {\n return {\n kind: 'suite',\n title: this.title,\n type: this._type,\n location: this.location,\n only: this._only,\n requireFile: this._requireFile,\n timeout: this._timeout,\n retries: this._retries,\n staticAnnotations: this._staticAnnotations.slice(),\n tags: this._tags.slice(),\n modifiers: this._modifiers.slice(),\n parallelMode: this._parallelMode,\n hooks: this._hooks.map(h => ({ type: h.type, location: h.location, title: h.title })),\n fileId: this._fileId,\n };\n }\n\n static _parse(data: any): Suite {\n const suite = new Suite(data.title, data.type);\n suite.location = data.location;\n suite._only = data.only;\n suite._requireFile = data.requireFile;\n suite._timeout = data.timeout;\n suite._retries = data.retries;\n suite._staticAnnotations = data.staticAnnotations;\n suite._tags = data.tags;\n suite._modifiers = data.modifiers;\n suite._parallelMode = data.parallelMode;\n suite._hooks = data.hooks.map((h: any) => ({ type: h.type, location: h.location, title: h.title, fn: () => { } }));\n suite._fileId = data.fileId;\n return suite;\n }\n\n _clone(): Suite {\n const data = this._serialize();\n const suite = Suite._parse(data);\n suite._use = this._use.slice();\n suite._hooks = this._hooks.slice();\n suite._fullProject = this._fullProject;\n return suite;\n }\n\n project(): FullProject | undefined {\n return this._fullProject?.project || this.parent?.project();\n }\n}\n\nexport class TestCase extends Base implements reporterTypes.TestCase {\n fn: Function;\n results: reporterTypes.TestResult[] = [];\n location: Location;\n parent!: Suite;\n type: 'test' = 'test';\n\n expectedStatus: reporterTypes.TestStatus = 'passed';\n timeout = 0;\n annotations: TestAnnotation[] = [];\n retries = 0;\n repeatEachIndex = 0;\n\n _testType: TestTypeImpl;\n id = '';\n _pool: FixturePool | undefined;\n _poolDigest = '';\n _workerHash = '';\n _projectId = '';\n // Explicitly declared tags that are not a part of the title.\n _tags: string[] = [];\n\n constructor(title: string, fn: Function, testType: TestTypeImpl, location: Location) {\n super(title);\n this.fn = fn;\n this._testType = testType;\n this.location = location;\n }\n\n titlePath(): string[] {\n const titlePath = this.parent ? this.parent.titlePath() : [];\n titlePath.push(this.title);\n return titlePath;\n }\n\n outcome(): 'skipped' | 'expected' | 'unexpected' | 'flaky' {\n return computeTestCaseOutcome(this);\n }\n\n ok(): boolean {\n const status = this.outcome();\n return status === 'expected' || status === 'flaky' || status === 'skipped';\n }\n\n get tags(): string[] {\n const titleTags = this._grepBaseTitlePath().join(' ').match(/@[\\S]+/g) || [];\n\n return [\n ...titleTags,\n ...this._tags,\n ];\n }\n\n _serialize(): any {\n return {\n kind: 'test',\n id: this.id,\n title: this.title,\n retries: this.retries,\n timeout: this.timeout,\n expectedStatus: this.expectedStatus,\n location: this.location,\n only: this._only,\n requireFile: this._requireFile,\n poolDigest: this._poolDigest,\n workerHash: this._workerHash,\n annotations: this.annotations.slice(),\n tags: this._tags.slice(),\n projectId: this._projectId,\n };\n }\n\n static _parse(data: any): TestCase {\n const test = new TestCase(data.title, () => {}, rootTestType, data.location);\n test.id = data.id;\n test.retries = data.retries;\n test.timeout = data.timeout;\n test.expectedStatus = data.expectedStatus;\n test._only = data.only;\n test._requireFile = data.requireFile;\n test._poolDigest = data.poolDigest;\n test._workerHash = data.workerHash;\n test.annotations = data.annotations;\n test._tags = data.tags;\n test._projectId = data.projectId;\n return test;\n }\n\n _clone(): TestCase {\n const data = this._serialize();\n const test = TestCase._parse(data);\n test._testType = this._testType;\n test.fn = this.fn;\n return test;\n }\n\n _appendTestResult(): reporterTypes.TestResult {\n const result: reporterTypes.TestResult = {\n retry: this.results.length,\n parallelIndex: -1,\n workerIndex: -1,\n duration: 0,\n startTime: new Date(),\n stdout: [],\n stderr: [],\n attachments: [],\n status: 'skipped',\n steps: [],\n errors: [],\n annotations: [],\n };\n this.results.push(result);\n return result;\n }\n\n _grepBaseTitlePath(): string[] {\n const path: string[] = [];\n this.parent._collectGrepTitlePath(path);\n path.push(this.title);\n return path;\n }\n\n _grepTitleWithTags(): string {\n const path = this._grepBaseTitlePath();\n path.push(...this._tags);\n return path.join(' ');\n }\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAgBA,sBAA6B;AAC7B,0BAAuC;AAUvC,MAAM,KAAK;AAAA,EAKT,YAAY,OAAe;AAH3B,iBAAQ;AACR,wBAAuB;AAGrB,SAAK,QAAQ;AAAA,EACf;AACF;AASO,MAAM,cAAc,KAAK;AAAA,EAkB9B,YAAY,OAAe,MAAgD;AACzE,UAAM,KAAK;AAhBb,gBAA+B,CAAC;AAChC,oBAAiC,CAAC;AAClC,kBAA6H,CAAC;AAI9H;AAAA,8BAAuC,CAAC;AAExC;AAAA,iBAAkB,CAAC;AACnB,sBAAyB,CAAC;AAC1B,yBAA4D;AAO1D,SAAK,QAAQ;AAAA,EACf;AAAA,EAEA,IAAI,OAAiD;AACnD,WAAO,KAAK;AAAA,EACd;AAAA,EAEA,UAAU;AACR,WAAO,KAAK;AAAA,EACd;AAAA,EAEA,IAAI,SAAkB;AACpB,WAAO,KAAK,SAAS,OAAO,WAAS,iBAAiB,KAAK;AAAA,EAC7D;AAAA,EAEA,IAAI,QAAoB;AACtB,WAAO,KAAK,S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