spana-test 0.17.0 → 0.19.1

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 (159) hide show
  1. package/README.md +11 -0
  2. package/dist/agent/index.js +19 -18
  3. package/dist/agent/index.js.map +1 -1
  4. package/dist/api/app.d.ts +3 -1
  5. package/dist/api/app.d.ts.map +1 -1
  6. package/dist/api/expect.d.ts +2 -0
  7. package/dist/api/expect.d.ts.map +1 -1
  8. package/dist/{app-TX4RYRBY.js → app-RWO7IJ3R.js} +5 -5
  9. package/dist/{appium-OI2CQON6.js → appium-2PJWZXJI.js} +55 -56
  10. package/dist/{appium-OI2CQON6.js.map → appium-2PJWZXJI.js.map} +1 -1
  11. package/dist/channels/cdp-client.d.ts +8 -0
  12. package/dist/channels/cdp-client.d.ts.map +1 -1
  13. package/dist/channels/dom-channel.d.ts +4 -2
  14. package/dist/channels/dom-channel.d.ts.map +1 -1
  15. package/dist/{chunk-QJPIPZ4S.js → chunk-3EBGWXYE.js} +30 -30
  16. package/dist/{chunk-QJPIPZ4S.js.map → chunk-3EBGWXYE.js.map} +1 -1
  17. package/dist/{chunk-7YJBZ4HB.js → chunk-3JAGQ4XW.js} +66 -66
  18. package/dist/{chunk-7YJBZ4HB.js.map → chunk-3JAGQ4XW.js.map} +1 -1
  19. package/dist/{chunk-YNA6LFBF.js → chunk-4TTYSFBG.js} +2 -1
  20. package/dist/chunk-4TTYSFBG.js.map +1 -0
  21. package/dist/{chunk-FPCMRYOS.js → chunk-555KISAV.js} +60 -53
  22. package/dist/chunk-555KISAV.js.map +1 -0
  23. package/dist/{chunk-L5EVAGCV.js → chunk-5Q2ROROC.js} +432 -280
  24. package/dist/chunk-5Q2ROROC.js.map +1 -0
  25. package/dist/chunk-67PLJEY2.js +24645 -0
  26. package/dist/chunk-67PLJEY2.js.map +1 -0
  27. package/dist/{chunk-CXXK3JAI.js → chunk-7TMILDYA.js} +3 -3
  28. package/dist/{chunk-CR55BHI2.js → chunk-ABRN6BL6.js} +281 -44
  29. package/dist/chunk-ABRN6BL6.js.map +1 -0
  30. package/dist/{chunk-RXQKH6Z7.js → chunk-AFWHSQHU.js} +42 -42
  31. package/dist/{chunk-RXQKH6Z7.js.map → chunk-AFWHSQHU.js.map} +1 -1
  32. package/dist/{chunk-4GESFVZL.js → chunk-BIV3DXB5.js} +2 -2
  33. package/dist/{chunk-WZY3MBNG.js → chunk-BPUBV7OF.js} +5 -3
  34. package/dist/chunk-BPUBV7OF.js.map +1 -0
  35. package/dist/{chunk-FCUT3OKD.js → chunk-C2TMVKT7.js} +64 -10
  36. package/dist/chunk-C2TMVKT7.js.map +1 -0
  37. package/dist/{chunk-22VPSGCA.js → chunk-CQ67PB3R.js} +2 -2
  38. package/dist/{chunk-HFQ3KKIB.js → chunk-EJHZZ2OP.js} +325 -203
  39. package/dist/chunk-EJHZZ2OP.js.map +1 -0
  40. package/dist/{chunk-KRATI3A5.js → chunk-ERFUFR5T.js} +135 -110
  41. package/dist/chunk-ERFUFR5T.js.map +1 -0
  42. package/dist/{chunk-3NZRRXDP.js → chunk-F4DMBDPA.js} +2 -2
  43. package/dist/{chunk-GS7DRAOQ.js → chunk-FLPPA2XY.js} +3 -2
  44. package/dist/chunk-FLPPA2XY.js.map +1 -0
  45. package/dist/{chunk-XG6UF6BP.js → chunk-I7BUJBT2.js} +38 -38
  46. package/dist/{chunk-XG6UF6BP.js.map → chunk-I7BUJBT2.js.map} +1 -1
  47. package/dist/{chunk-H5ZMLSVC.js → chunk-IC46FAEW.js} +2 -2
  48. package/dist/{chunk-FWFT3FEP.js → chunk-KIDTBRIV.js} +45 -6
  49. package/dist/chunk-KIDTBRIV.js.map +1 -0
  50. package/dist/{chunk-YWASMWPK.js → chunk-LX6GMZIN.js} +5 -5
  51. package/dist/{chunk-YWASMWPK.js.map → chunk-LX6GMZIN.js.map} +1 -1
  52. package/dist/chunk-PS3DALTI.js +17 -0
  53. package/dist/chunk-PS3DALTI.js.map +1 -0
  54. package/dist/{chunk-OKU46IDG.js → chunk-T3PCI5QZ.js} +80 -54
  55. package/dist/chunk-T3PCI5QZ.js.map +1 -0
  56. package/dist/{chunk-T7Z2T3NP.js → chunk-YKNHKVE6.js} +47 -39
  57. package/dist/chunk-YKNHKVE6.js.map +1 -0
  58. package/dist/{chunk-X5W7LV2O.js → chunk-Z5BMFLZ5.js} +2 -2
  59. package/dist/cli/test-command.d.ts.map +1 -1
  60. package/dist/cli.js +15 -15
  61. package/dist/cloud/common.d.ts.map +1 -1
  62. package/dist/{config-loader-OSHDDKH5.js → config-loader-MX232REU.js} +3 -3
  63. package/dist/{console-OHKVJLW3.js → console-Z7F7X3WY.js} +40 -39
  64. package/dist/console-Z7F7X3WY.js.map +1 -0
  65. package/dist/core/rejections.d.ts +5 -0
  66. package/dist/core/rejections.d.ts.map +1 -0
  67. package/dist/core/screenshot-compare.d.ts +7 -2
  68. package/dist/core/screenshot-compare.d.ts.map +1 -1
  69. package/dist/core/video-recorder.d.ts.map +1 -1
  70. package/dist/{daemon-manager-VEMRSZ5R.js → daemon-manager-6CFUXGTR.js} +2 -2
  71. package/dist/{doctor-command-2O4VK3QR.js → doctor-command-O3MSNK7M.js} +10 -9
  72. package/dist/{doctor-command-2O4VK3QR.js.map → doctor-command-O3MSNK7M.js.map} +1 -1
  73. package/dist/{driver-ZVDLV6QF.js → driver-TBRUL2EL.js} +8 -7
  74. package/dist/{driver-BHHIEDX6.js → driver-VKJEQCG3.js} +6 -6
  75. package/dist/drivers/cdp-browser.d.ts +15 -0
  76. package/dist/drivers/cdp-browser.d.ts.map +1 -1
  77. package/dist/drivers/electron.d.ts +0 -8
  78. package/dist/drivers/electron.d.ts.map +1 -1
  79. package/dist/drivers/playwright.d.ts +2 -0
  80. package/dist/drivers/playwright.d.ts.map +1 -1
  81. package/dist/{electrobun-4Z66F5NW.js → electrobun-5OGIQHTC.js} +7 -6
  82. package/dist/{electron-ZXM6SMZU.js → electron-XL7H25IQ.js} +3 -3
  83. package/dist/index.js +87 -88
  84. package/dist/index.js.map +1 -1
  85. package/dist/{installer-6HV5CU2I.js → installer-3X5SKWVX.js} +3 -3
  86. package/dist/{installer-DYGA4MRU.js → installer-Q37BOG5G.js} +3 -3
  87. package/dist/{json-QVHG6I3O.js → json-RNYQ54R7.js} +8 -7
  88. package/dist/json-RNYQ54R7.js.map +1 -0
  89. package/dist/{local-OYNEJSSQ.js → local-7PACQMS4.js} +10 -7
  90. package/dist/{playwright-SZP56NN2.js → playwright-MPVYCDGO.js} +9 -8
  91. package/dist/{provider-FKT6FEQS.js → provider-HWM3GF54.js} +3 -2
  92. package/dist/report/console.d.ts +2 -0
  93. package/dist/report/console.d.ts.map +1 -1
  94. package/dist/report/json.d.ts +5 -1
  95. package/dist/report/json.d.ts.map +1 -1
  96. package/dist/runtime/daemon-manager.d.ts.map +1 -1
  97. package/dist/runtime/local.d.ts +4 -0
  98. package/dist/runtime/local.d.ts.map +1 -1
  99. package/dist/runtime/web-server.d.ts.map +1 -1
  100. package/dist/schemas/config.d.ts +4 -1
  101. package/dist/schemas/config.d.ts.map +1 -1
  102. package/dist/{screenshot-compare-7TE44H7F.js → screenshot-compare-DNIP2EK4.js} +6 -4
  103. package/dist/{server-7QYNULRB.js → server-SGLHRRAE.js} +25 -24
  104. package/dist/{server-7QYNULRB.js.map → server-SGLHRRAE.js.map} +1 -1
  105. package/dist/{server-VIXRVKP5.js → server-ZCA5M6SW.js} +2 -2
  106. package/dist/session-NCG5GVP6.js +42 -0
  107. package/dist/smart/auto-wait.d.ts.map +1 -1
  108. package/dist/smart/channel-resolver.d.ts +4 -0
  109. package/dist/smart/channel-resolver.d.ts.map +1 -1
  110. package/dist/smart/coordinator.d.ts +1 -0
  111. package/dist/smart/coordinator.d.ts.map +1 -1
  112. package/dist/smart/element-matcher.d.ts.map +1 -1
  113. package/dist/{studio-command-ALDWIKEE.js → studio-command-VJ26HQU3.js} +2 -2
  114. package/dist/{test-command-HP5YE675.js → test-command-GPQL7SRB.js} +91 -22
  115. package/dist/test-command-GPQL7SRB.js.map +1 -0
  116. package/native/win32-x64/spana_native.dll +0 -0
  117. package/package.json +15 -6
  118. package/studio-dist/assets/{index-DXGUfzm3.js → index-DAE7R_Zp.js} +1 -1
  119. package/studio-dist/index.html +1 -1
  120. package/dist/chunk-CR55BHI2.js.map +0 -1
  121. package/dist/chunk-FCUT3OKD.js.map +0 -1
  122. package/dist/chunk-FPCMRYOS.js.map +0 -1
  123. package/dist/chunk-FWFT3FEP.js.map +0 -1
  124. package/dist/chunk-GS7DRAOQ.js.map +0 -1
  125. package/dist/chunk-HFQ3KKIB.js.map +0 -1
  126. package/dist/chunk-KRATI3A5.js.map +0 -1
  127. package/dist/chunk-L5EVAGCV.js.map +0 -1
  128. package/dist/chunk-OKU46IDG.js.map +0 -1
  129. package/dist/chunk-T7Z2T3NP.js.map +0 -1
  130. package/dist/chunk-WPG77TPT.js +0 -98
  131. package/dist/chunk-WPG77TPT.js.map +0 -1
  132. package/dist/chunk-WZY3MBNG.js.map +0 -1
  133. package/dist/chunk-YNA6LFBF.js.map +0 -1
  134. package/dist/console-OHKVJLW3.js.map +0 -1
  135. package/dist/json-QVHG6I3O.js.map +0 -1
  136. package/dist/session-3KME2U42.js +0 -41
  137. package/dist/test-command-HP5YE675.js.map +0 -1
  138. /package/dist/{app-TX4RYRBY.js.map → app-RWO7IJ3R.js.map} +0 -0
  139. /package/dist/{chunk-CXXK3JAI.js.map → chunk-7TMILDYA.js.map} +0 -0
  140. /package/dist/{chunk-4GESFVZL.js.map → chunk-BIV3DXB5.js.map} +0 -0
  141. /package/dist/{chunk-22VPSGCA.js.map → chunk-CQ67PB3R.js.map} +0 -0
  142. /package/dist/{chunk-3NZRRXDP.js.map → chunk-F4DMBDPA.js.map} +0 -0
  143. /package/dist/{chunk-H5ZMLSVC.js.map → chunk-IC46FAEW.js.map} +0 -0
  144. /package/dist/{chunk-X5W7LV2O.js.map → chunk-Z5BMFLZ5.js.map} +0 -0
  145. /package/dist/{config-loader-OSHDDKH5.js.map → config-loader-MX232REU.js.map} +0 -0
  146. /package/dist/{daemon-manager-VEMRSZ5R.js.map → daemon-manager-6CFUXGTR.js.map} +0 -0
  147. /package/dist/{driver-BHHIEDX6.js.map → driver-TBRUL2EL.js.map} +0 -0
  148. /package/dist/{driver-ZVDLV6QF.js.map → driver-VKJEQCG3.js.map} +0 -0
  149. /package/dist/{electrobun-4Z66F5NW.js.map → electrobun-5OGIQHTC.js.map} +0 -0
  150. /package/dist/{electron-ZXM6SMZU.js.map → electron-XL7H25IQ.js.map} +0 -0
  151. /package/dist/{installer-6HV5CU2I.js.map → installer-3X5SKWVX.js.map} +0 -0
  152. /package/dist/{installer-DYGA4MRU.js.map → installer-Q37BOG5G.js.map} +0 -0
  153. /package/dist/{local-OYNEJSSQ.js.map → local-7PACQMS4.js.map} +0 -0
  154. /package/dist/{playwright-SZP56NN2.js.map → playwright-MPVYCDGO.js.map} +0 -0
  155. /package/dist/{provider-FKT6FEQS.js.map → provider-HWM3GF54.js.map} +0 -0
  156. /package/dist/{screenshot-compare-7TE44H7F.js.map → screenshot-compare-DNIP2EK4.js.map} +0 -0
  157. /package/dist/{server-VIXRVKP5.js.map → server-ZCA5M6SW.js.map} +0 -0
  158. /package/dist/{session-3KME2U42.js.map → session-NCG5GVP6.js.map} +0 -0
  159. /package/dist/{studio-command-ALDWIKEE.js.map → studio-command-VJ26HQU3.js.map} +0 -0
@@ -9,14 +9,20 @@ import {
9
9
  import {
10
10
  parseWebHierarchy
11
11
  } from "./chunk-ODRB22QA.js";
12
+ import {
13
+ ignoreBestEffortFailure
14
+ } from "./chunk-PS3DALTI.js";
12
15
  import {
13
16
  createPromiseApp,
14
17
  createPromiseExpect,
15
18
  flattenElements
16
- } from "./chunk-L5EVAGCV.js";
19
+ } from "./chunk-5Q2ROROC.js";
17
20
  import {
18
21
  mergeLaunchOptions
19
22
  } from "./chunk-B4FOISOF.js";
23
+ import {
24
+ Effect_exports
25
+ } from "./chunk-67PLJEY2.js";
20
26
  import {
21
27
  init_esm_shims
22
28
  } from "./chunk-VBAPZMPX.js";
@@ -74,7 +80,6 @@ function skipModifierOrRuntime(nameOrCondition, configOrFnOrReason, maybeFn) {
74
80
 
75
81
  // src/core/session-manager.ts
76
82
  init_esm_shims();
77
- import { Effect } from "effect";
78
83
  function createSessions(manager, driverFactory, coordinatorConfig, flowContext) {
79
84
  const coordConfig = coordinatorConfig ?? { parse: parseWebHierarchy };
80
85
  return {
@@ -85,7 +90,7 @@ function createSessions(manager, driverFactory, coordinatorConfig, flowContext)
85
90
  }
86
91
  const driver = await driverFactory(opts);
87
92
  const baseUrl = opts.baseUrl ?? "http://localhost:3000";
88
- await Effect.runPromise(driver.launchApp(baseUrl));
93
+ await Effect_exports.runPromise(driver.launchApp(baseUrl));
89
94
  const app = createPromiseApp(driver, baseUrl, coordConfig, void 0, {
90
95
  platform: "web",
91
96
  flowContext
@@ -97,12 +102,12 @@ function createSessions(manager, driverFactory, coordinatorConfig, flowContext)
97
102
  app,
98
103
  expect,
99
104
  async disconnect() {
100
- await Effect.runPromise(driver.killApp(baseUrl));
105
+ await Effect_exports.runPromise(driver.killApp(baseUrl));
101
106
  manager.remove(opts.name);
102
107
  }
103
108
  };
104
109
  const cleanup = async () => {
105
- await Effect.runPromise(driver.killApp(baseUrl));
110
+ await Effect_exports.runPromise(driver.killApp(baseUrl));
106
111
  };
107
112
  manager.register(session, cleanup);
108
113
  return session;
@@ -800,8 +805,7 @@ async function startCdpScreencastRecorder(cdp, options) {
800
805
  if (stopped) return;
801
806
  const sessionId = params?.sessionId;
802
807
  if (sessionId !== void 0) {
803
- void cdp.sendCommand("Page.screencastFrameAck", { sessionId }).catch(() => {
804
- });
808
+ void cdp.sendCommand("Page.screencastFrameAck", { sessionId }).catch(ignoreBestEffortFailure);
805
809
  }
806
810
  if (typeof params?.data === "string" && params.data.length > 0) {
807
811
  if (frames.length >= maxFrames) {
@@ -1012,13 +1016,11 @@ function extractTapPointFromStep(step2) {
1012
1016
 
1013
1017
  // src/core/engine.ts
1014
1018
  init_esm_shims();
1015
- import { Effect as Effect4 } from "effect";
1016
1019
 
1017
1020
  // src/core/artifacts.ts
1018
1021
  init_esm_shims();
1019
1022
  import { writeFileSync as writeFileSync3, mkdirSync as mkdirSync3 } from "fs";
1020
1023
  import { join as join4 } from "path";
1021
- import { Effect as Effect2 } from "effect";
1022
1024
  var DEFAULT_ARTIFACT_CONFIG = {
1023
1025
  outputDir: "./spana-output",
1024
1026
  captureOnFailure: true,
@@ -1073,7 +1075,7 @@ async function captureArtifacts(driver, config, flowName, platform, status) {
1073
1075
  const dir = flowArtifactDir(config, flowName, platform);
1074
1076
  if (config.screenshot) {
1075
1077
  try {
1076
- const screenshot = await Effect2.runPromise(Effect2.orDie(driver.takeScreenshot()));
1078
+ const screenshot = await Effect_exports.runPromise(Effect_exports.orDie(driver.takeScreenshot()));
1077
1079
  const path = join4(dir, "screenshot.png");
1078
1080
  writeFileSync3(path, screenshot);
1079
1081
  attachments.push(createAttachment(`${status}-screenshot`, "image/png", path));
@@ -1082,7 +1084,7 @@ async function captureArtifacts(driver, config, flowName, platform, status) {
1082
1084
  }
1083
1085
  if (config.uiHierarchy) {
1084
1086
  try {
1085
- const hierarchy = await Effect2.runPromise(Effect2.orDie(driver.dumpHierarchy()));
1087
+ const hierarchy = await Effect_exports.runPromise(Effect_exports.orDie(driver.dumpHierarchy()));
1086
1088
  const path = join4(dir, "hierarchy.json");
1087
1089
  writeFileSync3(path, hierarchy, "utf-8");
1088
1090
  attachments.push(createAttachment(`${status}-hierarchy`, "application/json", path));
@@ -1090,8 +1092,8 @@ async function captureArtifacts(driver, config, flowName, platform, status) {
1090
1092
  }
1091
1093
  if (status === "failed" && (platform === "web" || driver.domChannel?.isConnected())) {
1092
1094
  try {
1093
- const html = await Effect2.runPromise(
1094
- Effect2.orDie(
1095
+ const html = await Effect_exports.runPromise(
1096
+ Effect_exports.orDie(
1095
1097
  driver.evaluate(
1096
1098
  "typeof document !== 'undefined' && document.documentElement ? document.documentElement.outerHTML : ''"
1097
1099
  )
@@ -1108,7 +1110,7 @@ async function captureArtifacts(driver, config, flowName, platform, status) {
1108
1110
  }
1109
1111
  if (config.consoleLogs && driver.getConsoleLogs) {
1110
1112
  try {
1111
- const consoleLogs = await Effect2.runPromise(Effect2.orDie(driver.getConsoleLogs()));
1113
+ const consoleLogs = await Effect_exports.runPromise(Effect_exports.orDie(driver.getConsoleLogs()));
1112
1114
  if (consoleLogs.length > 0) {
1113
1115
  attachments.push(
1114
1116
  writeJsonAttachment(dir, "console-logs.json", `${status}-console-logs`, consoleLogs)
@@ -1119,7 +1121,7 @@ async function captureArtifacts(driver, config, flowName, platform, status) {
1119
1121
  }
1120
1122
  if (config.jsErrors && driver.getJSErrors) {
1121
1123
  try {
1122
- const jsErrors = await Effect2.runPromise(Effect2.orDie(driver.getJSErrors()));
1124
+ const jsErrors = await Effect_exports.runPromise(Effect_exports.orDie(driver.getJSErrors()));
1123
1125
  if (jsErrors.length > 0) {
1124
1126
  attachments.push(
1125
1127
  writeJsonAttachment(dir, "js-errors.json", `${status}-js-errors`, jsErrors)
@@ -1130,7 +1132,7 @@ async function captureArtifacts(driver, config, flowName, platform, status) {
1130
1132
  }
1131
1133
  if (config.har && driver.getHAR) {
1132
1134
  try {
1133
- const har = await Effect2.runPromise(Effect2.orDie(driver.getHAR()));
1135
+ const har = await Effect_exports.runPromise(Effect_exports.orDie(driver.getHAR()));
1134
1136
  if (har.log.entries.length > 0) {
1135
1137
  attachments.push(writeJsonAttachment(dir, "network.har", `${status}-network-har`, har));
1136
1138
  }
@@ -1139,7 +1141,7 @@ async function captureArtifacts(driver, config, flowName, platform, status) {
1139
1141
  }
1140
1142
  if (status === "failed" && driver.getDriverLogs) {
1141
1143
  try {
1142
- const driverLogs = await Effect2.runPromise(Effect2.orDie(driver.getDriverLogs()));
1144
+ const driverLogs = await Effect_exports.runPromise(Effect_exports.orDie(driver.getDriverLogs()));
1143
1145
  if (driverLogs.length > 0) {
1144
1146
  attachments.push(
1145
1147
  writeTextAttachment(
@@ -1156,7 +1158,7 @@ async function captureArtifacts(driver, config, flowName, platform, status) {
1156
1158
  if (status === "failed" && config.nativeLogs) {
1157
1159
  if (platform === "android") {
1158
1160
  try {
1159
- const info = await Effect2.runPromise(Effect2.orDie(driver.getDeviceInfo())).catch(
1161
+ const info = await Effect_exports.runPromise(Effect_exports.orDie(driver.getDeviceInfo())).catch(
1160
1162
  () => null
1161
1163
  );
1162
1164
  const logcat = await captureAndroidLogcat(info?.deviceId);
@@ -1188,7 +1190,7 @@ async function captureStepScreenshot(driver, config, flowName, platform, stepInd
1188
1190
  mkdirSync3(dir, { recursive: true });
1189
1191
  const fileName = `${String(stepIndex).padStart(3, "0")}-${safeName(stepName)}.png`;
1190
1192
  const path = join4(dir, fileName);
1191
- const bytes = screenshot ?? await Effect2.runPromise(Effect2.orDie(driver.takeScreenshot()));
1193
+ const bytes = screenshot ?? await Effect_exports.runPromise(Effect_exports.orDie(driver.takeScreenshot()));
1192
1194
  writeFileSync3(path, bytes);
1193
1195
  return createAttachment(stepName, "image/png", path);
1194
1196
  } catch {
@@ -1199,7 +1201,6 @@ async function captureStepScreenshot(driver, config, flowName, platform, stepInd
1199
1201
  // src/core/debug-repl.ts
1200
1202
  init_esm_shims();
1201
1203
  import * as repl from "repl";
1202
- import { Effect as Effect3 } from "effect";
1203
1204
  var didStartDebugRepl = false;
1204
1205
  function toSuggestedSelectors(root) {
1205
1206
  return flattenElements(root).filter((el) => el.visible !== false && (el.id || el.text || el.accessibilityLabel)).map((el) => ({
@@ -1220,7 +1221,7 @@ async function runDebugReplOnce(context) {
1220
1221
  console.log("Skipping debug REPL because stdin/stdout is not interactive.");
1221
1222
  return false;
1222
1223
  }
1223
- const hierarchy = async () => context.parseHierarchy(await Effect3.runPromise(context.driver.dumpHierarchy()));
1224
+ const hierarchy = async () => context.parseHierarchy(await Effect_exports.runPromise(context.driver.dumpHierarchy()));
1224
1225
  const selectors = async () => toSuggestedSelectors(await hierarchy());
1225
1226
  console.log("");
1226
1227
  console.log(`Entering debug REPL for failed flow "${context.flowName}" on ${context.platform}.`);
@@ -2001,8 +2002,8 @@ ${messages.join("\n")}`,
2001
2002
  const sessions = createSessions(
2002
2003
  sessionManager,
2003
2004
  async (opts) => {
2004
- const { makePlaywrightDriver } = await import("./playwright-SZP56NN2.js");
2005
- const pwDriver = await Effect4.runPromise(
2005
+ const { makePlaywrightDriver } = await import("./playwright-MPVYCDGO.js");
2006
+ const pwDriver = await Effect_exports.runPromise(
2006
2007
  makePlaywrightDriver({
2007
2008
  browser: opts.browser,
2008
2009
  headless: opts.headless ?? true,
@@ -2025,7 +2026,7 @@ ${messages.join("\n")}`,
2025
2026
  if (!collectingCoverage || !driver.stopJSCoverage) return;
2026
2027
  collectingCoverage = false;
2027
2028
  try {
2028
- const entries = await Effect4.runPromise(driver.stopJSCoverage());
2029
+ const entries = await Effect_exports.runPromise(driver.stopJSCoverage());
2029
2030
  const path = join6(flowArtifactDir(artifactConfig, flow2.name, platform), "js-coverage.json");
2030
2031
  writeFileSync5(path, JSON.stringify(entries), "utf8");
2031
2032
  attachments.push({ name: "js-coverage", contentType: "application/json", path });
@@ -2044,7 +2045,7 @@ ${messages.join("\n")}`,
2044
2045
  const outputDir = keep ? flowArtifactDir(artifactConfig, flow2.name, platform) : artifactConfig.outputDir;
2045
2046
  let viewport;
2046
2047
  try {
2047
- const info = await Effect4.runPromise(Effect4.orDie(driver.getDeviceInfo()));
2048
+ const info = await Effect_exports.runPromise(Effect_exports.orDie(driver.getDeviceInfo()));
2048
2049
  if (info.screenWidth > 0 && info.screenHeight > 0) {
2049
2050
  viewport = { width: info.screenWidth, height: info.screenHeight };
2050
2051
  }
@@ -2102,10 +2103,10 @@ ${messages.join("\n")}`,
2102
2103
  try {
2103
2104
  const outDir = flowArtifactDir(artifactConfig, flow2.name, platform);
2104
2105
  const [consoleLogs, jsErrors, har, domSnapshot] = await Promise.all([
2105
- driver.getConsoleLogs ? Effect4.runPromise(Effect4.orDie(driver.getConsoleLogs())).catch(() => []) : Promise.resolve([]),
2106
- driver.getJSErrors ? Effect4.runPromise(Effect4.orDie(driver.getJSErrors())).catch(() => []) : Promise.resolve([]),
2107
- driver.getHAR ? Effect4.runPromise(Effect4.orDie(driver.getHAR())).catch(() => void 0) : Promise.resolve(void 0),
2108
- driver.dumpHierarchy ? Effect4.runPromise(Effect4.orDie(driver.dumpHierarchy())).catch(() => void 0) : Promise.resolve(void 0)
2106
+ driver.getConsoleLogs ? Effect_exports.runPromise(Effect_exports.orDie(driver.getConsoleLogs())).catch(() => []) : Promise.resolve([]),
2107
+ driver.getJSErrors ? Effect_exports.runPromise(Effect_exports.orDie(driver.getJSErrors())).catch(() => []) : Promise.resolve([]),
2108
+ driver.getHAR ? Effect_exports.runPromise(Effect_exports.orDie(driver.getHAR())).catch(() => void 0) : Promise.resolve(void 0),
2109
+ driver.dumpHierarchy ? Effect_exports.runPromise(Effect_exports.orDie(driver.dumpHierarchy())).catch(() => void 0) : Promise.resolve(void 0)
2109
2110
  ]);
2110
2111
  const richTrace = buildRichFlowTrace({
2111
2112
  flowName: flow2.name,
@@ -2158,7 +2159,7 @@ ${messages.join("\n")}`,
2158
2159
  };
2159
2160
  if (driver.beginFlow) {
2160
2161
  try {
2161
- await Effect4.runPromise(driver.beginFlow(flow2.name));
2162
+ await Effect_exports.runPromise(driver.beginFlow(flow2.name));
2162
2163
  } catch (error) {
2163
2164
  return buildFailureResult(error);
2164
2165
  }
@@ -2168,7 +2169,7 @@ ${messages.join("\n")}`,
2168
2169
  const vp = flow2.config.viewport;
2169
2170
  const baseWidth = vp?.width ?? mergedCoordinatorConfig.screenWidth ?? 1280;
2170
2171
  const baseHeight = vp?.height ?? mergedCoordinatorConfig.screenHeight ?? 720;
2171
- await Effect4.runPromise(
2172
+ await Effect_exports.runPromise(
2172
2173
  driver.setViewport({
2173
2174
  width: baseWidth,
2174
2175
  height: baseHeight,
@@ -2184,7 +2185,7 @@ ${messages.join("\n")}`,
2184
2185
  }
2185
2186
  if ((flow2.config.locale || flow2.config.userAgent) && driver.setEmulation) {
2186
2187
  try {
2187
- await Effect4.runPromise(
2188
+ await Effect_exports.runPromise(
2188
2189
  driver.setEmulation({
2189
2190
  ...flow2.config.locale ? { locale: flow2.config.locale } : {},
2190
2191
  ...flow2.config.userAgent ? { userAgent: flow2.config.userAgent } : {}
@@ -2203,7 +2204,7 @@ ${messages.join("\n")}`,
2203
2204
  );
2204
2205
  }
2205
2206
  try {
2206
- await Effect4.runPromise(driver.startJSCoverage());
2207
+ await Effect_exports.runPromise(driver.startJSCoverage());
2207
2208
  collectingCoverage = true;
2208
2209
  } catch (error) {
2209
2210
  return buildFailureResult(error);
@@ -2218,7 +2219,7 @@ ${messages.join("\n")}`,
2218
2219
  exportMp4: artifactConfig.video !== "off"
2219
2220
  });
2220
2221
  } else if (artifactConfig.video !== "off" && (platform === "android" || platform === "ios")) {
2221
- const info = await Effect4.runPromise(Effect4.orDie(driver.getDeviceInfo())).catch(
2222
+ const info = await Effect_exports.runPromise(Effect_exports.orDie(driver.getDeviceInfo())).catch(
2222
2223
  () => void 0
2223
2224
  );
2224
2225
  if (info?.deviceId) {
@@ -3037,25 +3038,31 @@ function killProcessTree(child, signal) {
3037
3038
  } catch {
3038
3039
  }
3039
3040
  }
3041
+ function processGroupAlive(child) {
3042
+ const pid = child.pid;
3043
+ if (!pid || process.platform === "win32") return false;
3044
+ try {
3045
+ process.kill(-pid, 0);
3046
+ return true;
3047
+ } catch {
3048
+ return false;
3049
+ }
3050
+ }
3040
3051
  async function stopChildProcess(child, gracefulMs) {
3041
- if (child.exitCode !== null || child.signalCode !== null) return;
3042
- await new Promise((resolve2) => {
3043
- let done = false;
3044
- const finish = () => {
3045
- if (done) return;
3046
- done = true;
3047
- clearTimeout(timer);
3048
- resolve2();
3049
- };
3050
- child.once("exit", finish);
3051
- child.once("close", finish);
3052
- killProcessTree(child, "SIGTERM");
3053
- const timer = setTimeout(() => {
3054
- killProcessTree(child, "SIGKILL");
3055
- finish();
3056
- }, gracefulMs);
3057
- timer.unref?.();
3058
- });
3052
+ const treeAlive = () => child.exitCode === null && child.signalCode === null || processGroupAlive(child);
3053
+ const waitForTreeExit = async (ms) => {
3054
+ const deadline = Date.now() + ms;
3055
+ while (treeAlive() && Date.now() < deadline) {
3056
+ await new Promise((r) => setTimeout(r, 20));
3057
+ }
3058
+ };
3059
+ if (!treeAlive()) return;
3060
+ killProcessTree(child, "SIGTERM");
3061
+ await waitForTreeExit(gracefulMs);
3062
+ if (treeAlive()) {
3063
+ killProcessTree(child, "SIGKILL");
3064
+ await waitForTreeExit(1e3);
3065
+ }
3059
3066
  }
3060
3067
  async function startWebServer(config, opts = {}) {
3061
3068
  if (!config.command || config.command.trim().length === 0) {
@@ -3397,4 +3404,4 @@ export {
3397
3404
  filterFlowsForProject,
3398
3405
  resolveProjectExecutionPlan
3399
3406
  };
3400
- //# sourceMappingURL=chunk-FPCMRYOS.js.map
3407
+ //# sourceMappingURL=chunk-555KISAV.js.map