@testmuai/playwright-bindings 0.1.44-beta.1 → 0.1.45-beta.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 (857) hide show
  1. package/README.md +28 -0
  2. package/dist/configure.d.ts +3 -0
  3. package/dist/configure.d.ts.map +1 -1
  4. package/dist/configure.js +8 -0
  5. package/dist/configure.js.map +1 -1
  6. package/dist/errors.d.ts +6 -0
  7. package/dist/errors.d.ts.map +1 -1
  8. package/dist/errors.js +9 -0
  9. package/dist/errors.js.map +1 -1
  10. package/dist/index.d.ts +87 -100
  11. package/dist/index.d.ts.map +1 -1
  12. package/dist/index.js +71 -37
  13. package/dist/index.js.map +1 -1
  14. package/dist/router.d.ts +53 -0
  15. package/dist/router.d.ts.map +1 -0
  16. package/dist/router.js +137 -0
  17. package/dist/router.js.map +1 -0
  18. package/dist/v3/actionEngine.d.ts.map +1 -0
  19. package/dist/v3/actionEngine.js +194 -0
  20. package/dist/v3/actionEngine.js.map +1 -0
  21. package/dist/v3/actionSpecs.d.ts.map +1 -0
  22. package/dist/v3/actionSpecs.js +354 -0
  23. package/dist/v3/actionSpecs.js.map +1 -0
  24. package/dist/v3/capability.d.ts.map +1 -0
  25. package/dist/v3/capability.js +346 -0
  26. package/dist/v3/capability.js.map +1 -0
  27. package/dist/v3/downloadsPath.d.ts.map +1 -0
  28. package/dist/v3/downloadsPath.js.map +1 -0
  29. package/dist/v3/healCache.d.ts.map +1 -0
  30. package/dist/v3/healCache.js.map +1 -0
  31. package/dist/v3/healPatch.d.ts +22 -0
  32. package/dist/v3/healPatch.d.ts.map +1 -0
  33. package/dist/v3/healPatch.js +345 -0
  34. package/dist/v3/healPatch.js.map +1 -0
  35. package/dist/v3/helpers/a11yFlatten.d.ts.map +1 -0
  36. package/dist/v3/helpers/a11yFlatten.js +569 -0
  37. package/dist/v3/helpers/a11yFlatten.js.map +1 -0
  38. package/dist/v3/helpers/apiCalls.d.ts.map +1 -0
  39. package/dist/v3/helpers/apiCalls.js +59 -0
  40. package/dist/v3/helpers/apiCalls.js.map +1 -0
  41. package/dist/v3/helpers/assertion.d.ts.map +1 -0
  42. package/dist/v3/helpers/assertion.js +105 -0
  43. package/dist/v3/helpers/assertion.js.map +1 -0
  44. package/dist/v3/helpers/assertionV3.d.ts.map +1 -0
  45. package/dist/v3/helpers/assertionV3.js.map +1 -0
  46. package/dist/v3/helpers/autohealAx.d.ts.map +1 -0
  47. package/dist/v3/helpers/autohealAx.js +148 -0
  48. package/dist/v3/helpers/autohealAx.js.map +1 -0
  49. package/dist/v3/helpers/axTree/actionable.d.ts.map +1 -0
  50. package/dist/v3/helpers/axTree/actionable.js +404 -0
  51. package/dist/v3/helpers/axTree/actionable.js.map +1 -0
  52. package/dist/v3/helpers/axTree/captureAxTree.d.ts.map +1 -0
  53. package/dist/v3/helpers/axTree/captureAxTree.js.map +1 -0
  54. package/dist/v3/helpers/axTree/captureFrameForest.d.ts.map +1 -0
  55. package/dist/v3/helpers/axTree/captureFrameForest.js +475 -0
  56. package/dist/v3/helpers/axTree/captureFrameForest.js.map +1 -0
  57. package/dist/v3/helpers/axTree/index.d.ts.map +1 -0
  58. package/dist/v3/helpers/axTree/index.js.map +1 -0
  59. package/dist/v3/helpers/axTree/serializeAxTree.d.ts.map +1 -0
  60. package/dist/v3/helpers/axTree/serializeAxTree.js.map +1 -0
  61. package/dist/v3/helpers/clipboard-intercept.d.ts.map +1 -0
  62. package/dist/v3/helpers/clipboard-intercept.js.map +1 -0
  63. package/dist/v3/helpers/clipboard.d.ts.map +1 -0
  64. package/dist/v3/helpers/clipboard.js.map +1 -0
  65. package/dist/v3/helpers/condition.d.ts +100 -0
  66. package/dist/v3/helpers/condition.d.ts.map +1 -0
  67. package/dist/v3/helpers/condition.js +356 -0
  68. package/dist/v3/helpers/condition.js.map +1 -0
  69. package/dist/v3/helpers/cookies.d.ts.map +1 -0
  70. package/dist/v3/helpers/cookies.js +66 -0
  71. package/dist/v3/helpers/cookies.js.map +1 -0
  72. package/dist/v3/helpers/coordinateResolver.d.ts.map +1 -0
  73. package/dist/v3/helpers/coordinateResolver.js +118 -0
  74. package/dist/v3/helpers/coordinateResolver.js.map +1 -0
  75. package/dist/v3/helpers/coordinateResolverRead.d.ts.map +1 -0
  76. package/dist/v3/helpers/coordinateResolverRead.js +107 -0
  77. package/dist/v3/helpers/coordinateResolverRead.js.map +1 -0
  78. package/dist/v3/helpers/credits.d.ts.map +1 -0
  79. package/dist/v3/helpers/credits.js +52 -0
  80. package/dist/v3/helpers/credits.js.map +1 -0
  81. package/dist/v3/helpers/derive.d.ts.map +1 -0
  82. package/dist/v3/helpers/derive.js +87 -0
  83. package/dist/v3/helpers/derive.js.map +1 -0
  84. package/dist/v3/helpers/devtools.d.ts.map +1 -0
  85. package/dist/v3/helpers/devtools.js +1215 -0
  86. package/dist/v3/helpers/devtools.js.map +1 -0
  87. package/dist/v3/helpers/dialog.d.ts.map +1 -0
  88. package/dist/v3/helpers/dialog.js.map +1 -0
  89. package/dist/v3/helpers/drag.d.ts.map +1 -0
  90. package/dist/v3/helpers/drag.js +276 -0
  91. package/dist/v3/helpers/drag.js.map +1 -0
  92. package/dist/v3/helpers/evaluation/colors.d.ts.map +1 -0
  93. package/dist/v3/helpers/evaluation/colors.js.map +1 -0
  94. package/dist/v3/helpers/evaluation/evaluate.d.ts.map +1 -0
  95. package/dist/v3/helpers/evaluation/evaluate.js.map +1 -0
  96. package/dist/v3/helpers/executeApi.d.ts.map +1 -0
  97. package/dist/v3/helpers/executeApi.js +373 -0
  98. package/dist/v3/helpers/executeApi.js.map +1 -0
  99. package/dist/v3/helpers/executeDb.d.ts.map +1 -0
  100. package/dist/v3/helpers/executeDb.js +54 -0
  101. package/dist/v3/helpers/executeDb.js.map +1 -0
  102. package/dist/v3/helpers/executeJs.d.ts.map +1 -0
  103. package/dist/v3/helpers/executeJs.js +93 -0
  104. package/dist/v3/helpers/executeJs.js.map +1 -0
  105. package/dist/v3/helpers/gesture.d.ts.map +1 -0
  106. package/dist/v3/helpers/gesture.js +131 -0
  107. package/dist/v3/helpers/gesture.js.map +1 -0
  108. package/dist/v3/helpers/healCascade.d.ts.map +1 -0
  109. package/dist/v3/helpers/healCascade.js +418 -0
  110. package/dist/v3/helpers/healCascade.js.map +1 -0
  111. package/dist/v3/helpers/iframeA11y.d.ts.map +1 -0
  112. package/dist/v3/helpers/iframeA11y.js +128 -0
  113. package/dist/v3/helpers/iframeA11y.js.map +1 -0
  114. package/dist/v3/helpers/kaneCli.d.ts.map +1 -0
  115. package/dist/v3/helpers/kaneCli.js +319 -0
  116. package/dist/v3/helpers/kaneCli.js.map +1 -0
  117. package/dist/v3/helpers/loop.d.ts +4 -0
  118. package/dist/v3/helpers/loop.d.ts.map +1 -0
  119. package/dist/v3/helpers/loop.js +4 -0
  120. package/dist/v3/helpers/loop.js.map +1 -0
  121. package/dist/v3/helpers/math.d.ts.map +1 -0
  122. package/dist/v3/helpers/math.js +119 -0
  123. package/dist/v3/helpers/math.js.map +1 -0
  124. package/dist/v3/helpers/network.d.ts.map +1 -0
  125. package/dist/v3/helpers/network.js +185 -0
  126. package/dist/v3/helpers/network.js.map +1 -0
  127. package/dist/v3/helpers/pageReady.d.ts.map +1 -0
  128. package/dist/v3/helpers/pageReady.js +85 -0
  129. package/dist/v3/helpers/pageReady.js.map +1 -0
  130. package/dist/v3/helpers/png.d.ts.map +1 -0
  131. package/dist/v3/helpers/png.js.map +1 -0
  132. package/dist/v3/helpers/queryResult.d.ts.map +1 -0
  133. package/dist/v3/helpers/queryResult.js.map +1 -0
  134. package/dist/v3/helpers/runtimeSnapshot.d.ts.map +1 -0
  135. package/dist/v3/helpers/runtimeSnapshot.js +204 -0
  136. package/dist/v3/helpers/runtimeSnapshot.js.map +1 -0
  137. package/dist/v3/helpers/schemaAssertion.d.ts.map +1 -0
  138. package/dist/v3/helpers/schemaAssertion.js +117 -0
  139. package/dist/v3/helpers/schemaAssertion.js.map +1 -0
  140. package/dist/v3/helpers/screenshot.d.ts +41 -0
  141. package/dist/v3/helpers/screenshot.d.ts.map +1 -0
  142. package/dist/v3/helpers/screenshot.js +83 -0
  143. package/dist/v3/helpers/screenshot.js.map +1 -0
  144. package/dist/v3/helpers/scrollUntil.d.ts.map +1 -0
  145. package/dist/v3/helpers/scrollUntil.js +90 -0
  146. package/dist/v3/helpers/scrollUntil.js.map +1 -0
  147. package/dist/v3/helpers/smartui.d.ts.map +1 -0
  148. package/dist/v3/helpers/smartui.js +77 -0
  149. package/dist/v3/helpers/smartui.js.map +1 -0
  150. package/dist/v3/helpers/sseParser.d.ts.map +1 -0
  151. package/dist/v3/helpers/sseParser.js.map +1 -0
  152. package/dist/v3/helpers/tabs.d.ts +43 -0
  153. package/dist/v3/helpers/tabs.d.ts.map +1 -0
  154. package/dist/v3/helpers/tabs.js +258 -0
  155. package/dist/v3/helpers/tabs.js.map +1 -0
  156. package/dist/v3/helpers/text.d.ts.map +1 -0
  157. package/dist/v3/helpers/text.js.map +1 -0
  158. package/dist/v3/helpers/textNormalize.d.ts.map +1 -0
  159. package/dist/v3/helpers/textNormalize.js.map +1 -0
  160. package/dist/v3/helpers/textualAnalyzer/domStructured.d.ts.map +1 -0
  161. package/dist/v3/helpers/textualAnalyzer/domStructured.js +242 -0
  162. package/dist/v3/helpers/textualAnalyzer/domStructured.js.map +1 -0
  163. package/dist/v3/helpers/textualAnalyzer/evaluate.d.ts.map +1 -0
  164. package/dist/v3/helpers/textualAnalyzer/evaluate.js.map +1 -0
  165. package/dist/v3/helpers/textualAnalyzer/extractor.d.ts.map +1 -0
  166. package/dist/v3/helpers/textualAnalyzer/extractor.js.map +1 -0
  167. package/dist/v3/helpers/textualAnalyzer/heal.d.ts.map +1 -0
  168. package/dist/v3/helpers/textualAnalyzer/heal.js +120 -0
  169. package/dist/v3/helpers/textualAnalyzer/heal.js.map +1 -0
  170. package/dist/v3/helpers/textualAnalyzer/index.d.ts.map +1 -0
  171. package/dist/v3/helpers/textualAnalyzer/index.js +60 -0
  172. package/dist/v3/helpers/textualAnalyzer/index.js.map +1 -0
  173. package/dist/v3/helpers/textualAnalyzer/locatorEnrichment.d.ts.map +1 -0
  174. package/dist/v3/helpers/textualAnalyzer/locatorEnrichment.js +224 -0
  175. package/dist/v3/helpers/textualAnalyzer/locatorEnrichment.js.map +1 -0
  176. package/dist/v3/helpers/textualRead.d.ts.map +1 -0
  177. package/dist/v3/helpers/textualRead.js.map +1 -0
  178. package/dist/v3/helpers/vision.d.ts +79 -0
  179. package/dist/v3/helpers/vision.d.ts.map +1 -0
  180. package/dist/v3/helpers/vision.js +235 -0
  181. package/dist/v3/helpers/vision.js.map +1 -0
  182. package/dist/v3/helpers/visionFence.d.ts.map +1 -0
  183. package/dist/v3/helpers/visionFence.js.map +1 -0
  184. package/dist/v3/helpers/visionV3.d.ts +52 -0
  185. package/dist/v3/helpers/visionV3.d.ts.map +1 -0
  186. package/dist/v3/helpers/visionV3.js +366 -0
  187. package/dist/v3/helpers/visionV3.js.map +1 -0
  188. package/dist/v3/helpers/wait.d.ts.map +1 -0
  189. package/dist/v3/helpers/wait.js +48 -0
  190. package/dist/v3/helpers/wait.js.map +1 -0
  191. package/dist/v3/http.d.ts.map +1 -0
  192. package/dist/v3/http.js +45 -0
  193. package/dist/v3/http.js.map +1 -0
  194. package/dist/v3/httpClient.d.ts.map +1 -0
  195. package/dist/v3/httpClient.js.map +1 -0
  196. package/dist/v3/index.d.ts +40 -0
  197. package/dist/v3/index.d.ts.map +1 -0
  198. package/dist/v3/index.js +41 -0
  199. package/dist/v3/index.js.map +1 -0
  200. package/dist/v3/rankedLocator.d.ts.map +1 -0
  201. package/dist/v3/rankedLocator.js +85 -0
  202. package/dist/v3/rankedLocator.js.map +1 -0
  203. package/dist/v3/relayProxy.d.ts.map +1 -0
  204. package/dist/v3/relayProxy.js +485 -0
  205. package/dist/v3/relayProxy.js.map +1 -0
  206. package/dist/v3/reporters/index.d.ts.map +1 -0
  207. package/dist/v3/reporters/index.js +7 -0
  208. package/dist/v3/reporters/index.js.map +1 -0
  209. package/dist/v3/reporters/local.d.ts.map +1 -0
  210. package/dist/v3/reporters/local.js +40 -0
  211. package/dist/v3/reporters/local.js.map +1 -0
  212. package/dist/v3/reporters/lt.d.ts.map +1 -0
  213. package/dist/v3/reporters/lt.js +122 -0
  214. package/dist/v3/reporters/lt.js.map +1 -0
  215. package/dist/v3/reporters/null.d.ts.map +1 -0
  216. package/dist/v3/reporters/null.js.map +1 -0
  217. package/dist/v3/routeFailure.d.ts.map +1 -0
  218. package/dist/v3/routeFailure.js +34 -0
  219. package/dist/v3/routeFailure.js.map +1 -0
  220. package/dist/v3/session.d.ts.map +1 -0
  221. package/dist/v3/session.js +312 -0
  222. package/dist/v3/session.js.map +1 -0
  223. package/dist/v3/step.d.ts.map +1 -0
  224. package/dist/v3/step.js +112 -0
  225. package/dist/v3/step.js.map +1 -0
  226. package/dist/v3/stepVariables.d.ts.map +1 -0
  227. package/dist/v3/stepVariables.js +61 -0
  228. package/dist/v3/stepVariables.js.map +1 -0
  229. package/dist/v3/test.d.ts.map +1 -0
  230. package/dist/v3/test.js.map +1 -0
  231. package/dist/v3/testConfig.d.ts.map +1 -0
  232. package/dist/v3/testConfig.js.map +1 -0
  233. package/dist/v3/testState.d.ts.map +1 -0
  234. package/dist/v3/testState.js.map +1 -0
  235. package/dist/v3/vars.d.ts +84 -0
  236. package/dist/v3/vars.d.ts.map +1 -0
  237. package/dist/v3/vars.js +913 -0
  238. package/dist/v3/vars.js.map +1 -0
  239. package/dist/v3/visionLocator.d.ts.map +1 -0
  240. package/dist/v3/visionLocator.js +117 -0
  241. package/dist/v3/visionLocator.js.map +1 -0
  242. package/dist/v4/actionEngine.d.ts +37 -0
  243. package/dist/v4/actionEngine.d.ts.map +1 -0
  244. package/dist/v4/actionEngine.js +194 -0
  245. package/dist/v4/actionEngine.js.map +1 -0
  246. package/dist/v4/actionSpecs.d.ts +35 -0
  247. package/dist/v4/actionSpecs.d.ts.map +1 -0
  248. package/dist/v4/actionSpecs.js +354 -0
  249. package/dist/v4/actionSpecs.js.map +1 -0
  250. package/dist/v4/capability.d.ts +81 -0
  251. package/dist/v4/capability.d.ts.map +1 -0
  252. package/dist/v4/capability.js +346 -0
  253. package/dist/v4/capability.js.map +1 -0
  254. package/dist/v4/downloadsPath.d.ts +17 -0
  255. package/dist/v4/downloadsPath.d.ts.map +1 -0
  256. package/dist/v4/downloadsPath.js +26 -0
  257. package/dist/v4/downloadsPath.js.map +1 -0
  258. package/dist/v4/healCache.d.ts +28 -0
  259. package/dist/v4/healCache.d.ts.map +1 -0
  260. package/dist/v4/healCache.js +17 -0
  261. package/dist/v4/healCache.js.map +1 -0
  262. package/dist/v4/healPatch.d.ts +22 -0
  263. package/dist/v4/healPatch.d.ts.map +1 -0
  264. package/dist/v4/healPatch.js +415 -0
  265. package/dist/v4/healPatch.js.map +1 -0
  266. package/dist/v4/helpers/a11yFlatten.d.ts +37 -0
  267. package/dist/v4/helpers/a11yFlatten.d.ts.map +1 -0
  268. package/dist/v4/helpers/a11yFlatten.js +569 -0
  269. package/dist/v4/helpers/a11yFlatten.js.map +1 -0
  270. package/dist/v4/helpers/apiCalls.d.ts +26 -0
  271. package/dist/v4/helpers/apiCalls.d.ts.map +1 -0
  272. package/dist/v4/helpers/apiCalls.js +59 -0
  273. package/dist/v4/helpers/apiCalls.js.map +1 -0
  274. package/dist/v4/helpers/assertion.d.ts +26 -0
  275. package/dist/v4/helpers/assertion.d.ts.map +1 -0
  276. package/dist/v4/helpers/assertion.js +134 -0
  277. package/dist/v4/helpers/assertion.js.map +1 -0
  278. package/dist/v4/helpers/assertionV3.d.ts +70 -0
  279. package/dist/v4/helpers/assertionV3.d.ts.map +1 -0
  280. package/dist/v4/helpers/assertionV3.js +400 -0
  281. package/dist/v4/helpers/assertionV3.js.map +1 -0
  282. package/dist/v4/helpers/autohealAx.d.ts +41 -0
  283. package/dist/v4/helpers/autohealAx.d.ts.map +1 -0
  284. package/dist/v4/helpers/autohealAx.js +148 -0
  285. package/dist/v4/helpers/autohealAx.js.map +1 -0
  286. package/dist/v4/helpers/axTree/actionable.d.ts +143 -0
  287. package/dist/v4/helpers/axTree/actionable.d.ts.map +1 -0
  288. package/dist/v4/helpers/axTree/actionable.js +404 -0
  289. package/dist/v4/helpers/axTree/actionable.js.map +1 -0
  290. package/dist/v4/helpers/axTree/captureAxTree.d.ts +21 -0
  291. package/dist/v4/helpers/axTree/captureAxTree.d.ts.map +1 -0
  292. package/dist/v4/helpers/axTree/captureAxTree.js +15 -0
  293. package/dist/v4/helpers/axTree/captureAxTree.js.map +1 -0
  294. package/dist/v4/helpers/axTree/captureFrameForest.d.ts +52 -0
  295. package/dist/v4/helpers/axTree/captureFrameForest.d.ts.map +1 -0
  296. package/dist/v4/helpers/axTree/captureFrameForest.js +475 -0
  297. package/dist/v4/helpers/axTree/captureFrameForest.js.map +1 -0
  298. package/dist/v4/helpers/axTree/index.d.ts +10 -0
  299. package/dist/v4/helpers/axTree/index.d.ts.map +1 -0
  300. package/dist/v4/helpers/axTree/index.js +8 -0
  301. package/dist/v4/helpers/axTree/index.js.map +1 -0
  302. package/dist/v4/helpers/axTree/serializeAxTree.d.ts +106 -0
  303. package/dist/v4/helpers/axTree/serializeAxTree.d.ts.map +1 -0
  304. package/dist/v4/helpers/axTree/serializeAxTree.js +238 -0
  305. package/dist/v4/helpers/axTree/serializeAxTree.js.map +1 -0
  306. package/dist/v4/helpers/clipboard-intercept.d.ts +5 -0
  307. package/dist/v4/helpers/clipboard-intercept.d.ts.map +1 -0
  308. package/dist/v4/helpers/clipboard-intercept.js +149 -0
  309. package/dist/v4/helpers/clipboard-intercept.js.map +1 -0
  310. package/dist/v4/helpers/clipboard.d.ts +27 -0
  311. package/dist/v4/helpers/clipboard.d.ts.map +1 -0
  312. package/dist/v4/helpers/clipboard.js +70 -0
  313. package/dist/v4/helpers/clipboard.js.map +1 -0
  314. package/dist/v4/helpers/condition.d.ts +100 -0
  315. package/dist/v4/helpers/condition.d.ts.map +1 -0
  316. package/dist/v4/helpers/condition.js +356 -0
  317. package/dist/v4/helpers/condition.js.map +1 -0
  318. package/dist/v4/helpers/cookies.d.ts +12 -0
  319. package/dist/v4/helpers/cookies.d.ts.map +1 -0
  320. package/dist/v4/helpers/cookies.js +66 -0
  321. package/dist/v4/helpers/cookies.js.map +1 -0
  322. package/dist/v4/helpers/coordinateResolver.d.ts +29 -0
  323. package/dist/v4/helpers/coordinateResolver.d.ts.map +1 -0
  324. package/dist/v4/helpers/coordinateResolver.js +118 -0
  325. package/dist/v4/helpers/coordinateResolver.js.map +1 -0
  326. package/dist/v4/helpers/credits.d.ts +19 -0
  327. package/dist/v4/helpers/credits.d.ts.map +1 -0
  328. package/dist/v4/helpers/credits.js +52 -0
  329. package/dist/v4/helpers/credits.js.map +1 -0
  330. package/dist/v4/helpers/derive.d.ts +27 -0
  331. package/dist/v4/helpers/derive.d.ts.map +1 -0
  332. package/dist/v4/helpers/derive.js +87 -0
  333. package/dist/v4/helpers/derive.js.map +1 -0
  334. package/dist/v4/helpers/devtools.d.ts +39 -0
  335. package/dist/v4/helpers/devtools.d.ts.map +1 -0
  336. package/dist/v4/helpers/devtools.js +1215 -0
  337. package/dist/v4/helpers/devtools.js.map +1 -0
  338. package/dist/v4/helpers/dialog.d.ts +29 -0
  339. package/dist/v4/helpers/dialog.d.ts.map +1 -0
  340. package/dist/v4/helpers/dialog.js +35 -0
  341. package/dist/v4/helpers/dialog.js.map +1 -0
  342. package/dist/v4/helpers/drag.d.ts +38 -0
  343. package/dist/v4/helpers/drag.d.ts.map +1 -0
  344. package/dist/v4/helpers/drag.js +245 -0
  345. package/dist/v4/helpers/drag.js.map +1 -0
  346. package/dist/v4/helpers/evaluation/colors.d.ts +2 -0
  347. package/dist/v4/helpers/evaluation/colors.d.ts.map +1 -0
  348. package/dist/v4/helpers/evaluation/colors.js +151 -0
  349. package/dist/v4/helpers/evaluation/colors.js.map +1 -0
  350. package/dist/v4/helpers/evaluation/evaluate.d.ts +10 -0
  351. package/dist/v4/helpers/evaluation/evaluate.d.ts.map +1 -0
  352. package/dist/v4/helpers/evaluation/evaluate.js +423 -0
  353. package/dist/v4/helpers/evaluation/evaluate.js.map +1 -0
  354. package/dist/v4/helpers/executeApi.d.ts +63 -0
  355. package/dist/v4/helpers/executeApi.d.ts.map +1 -0
  356. package/dist/v4/helpers/executeApi.js +363 -0
  357. package/dist/v4/helpers/executeApi.js.map +1 -0
  358. package/dist/v4/helpers/executeDb.d.ts +11 -0
  359. package/dist/v4/helpers/executeDb.d.ts.map +1 -0
  360. package/dist/v4/helpers/executeDb.js +54 -0
  361. package/dist/v4/helpers/executeDb.js.map +1 -0
  362. package/dist/v4/helpers/executeJs.d.ts +16 -0
  363. package/dist/v4/helpers/executeJs.d.ts.map +1 -0
  364. package/dist/v4/helpers/executeJs.js +86 -0
  365. package/dist/v4/helpers/executeJs.js.map +1 -0
  366. package/dist/v4/helpers/gesture.d.ts +45 -0
  367. package/dist/v4/helpers/gesture.d.ts.map +1 -0
  368. package/dist/v4/helpers/gesture.js +131 -0
  369. package/dist/v4/helpers/gesture.js.map +1 -0
  370. package/dist/v4/helpers/healCascade.d.ts +39 -0
  371. package/dist/v4/helpers/healCascade.d.ts.map +1 -0
  372. package/dist/v4/helpers/healCascade.js +418 -0
  373. package/dist/v4/helpers/healCascade.js.map +1 -0
  374. package/dist/v4/helpers/kaneCli.d.ts +18 -0
  375. package/dist/v4/helpers/kaneCli.d.ts.map +1 -0
  376. package/dist/v4/helpers/kaneCli.js +319 -0
  377. package/dist/v4/helpers/kaneCli.js.map +1 -0
  378. package/dist/v4/helpers/loop.d.ts +4 -0
  379. package/dist/v4/helpers/loop.d.ts.map +1 -0
  380. package/dist/v4/helpers/loop.js +4 -0
  381. package/dist/v4/helpers/loop.js.map +1 -0
  382. package/dist/v4/helpers/math.d.ts +19 -0
  383. package/dist/v4/helpers/math.d.ts.map +1 -0
  384. package/dist/v4/helpers/math.js +117 -0
  385. package/dist/v4/helpers/math.js.map +1 -0
  386. package/dist/v4/helpers/network.d.ts +27 -0
  387. package/dist/v4/helpers/network.d.ts.map +1 -0
  388. package/dist/v4/helpers/network.js +185 -0
  389. package/dist/v4/helpers/network.js.map +1 -0
  390. package/dist/v4/helpers/pageReady.d.ts +27 -0
  391. package/dist/v4/helpers/pageReady.d.ts.map +1 -0
  392. package/dist/v4/helpers/pageReady.js +69 -0
  393. package/dist/v4/helpers/pageReady.js.map +1 -0
  394. package/dist/v4/helpers/png.d.ts +3 -0
  395. package/dist/v4/helpers/png.d.ts.map +1 -0
  396. package/dist/v4/helpers/png.js +18 -0
  397. package/dist/v4/helpers/png.js.map +1 -0
  398. package/dist/v4/helpers/queryResult.d.ts +13 -0
  399. package/dist/v4/helpers/queryResult.d.ts.map +1 -0
  400. package/dist/v4/helpers/queryResult.js +27 -0
  401. package/dist/v4/helpers/queryResult.js.map +1 -0
  402. package/dist/v4/helpers/runtimeSnapshot.d.ts +37 -0
  403. package/dist/v4/helpers/runtimeSnapshot.d.ts.map +1 -0
  404. package/dist/v4/helpers/runtimeSnapshot.js +101 -0
  405. package/dist/v4/helpers/runtimeSnapshot.js.map +1 -0
  406. package/dist/v4/helpers/schemaAssertion.d.ts +12 -0
  407. package/dist/v4/helpers/schemaAssertion.d.ts.map +1 -0
  408. package/dist/v4/helpers/schemaAssertion.js +117 -0
  409. package/dist/v4/helpers/schemaAssertion.js.map +1 -0
  410. package/dist/v4/helpers/screenshot.d.ts +40 -0
  411. package/dist/v4/helpers/screenshot.d.ts.map +1 -0
  412. package/dist/v4/helpers/screenshot.js +82 -0
  413. package/dist/v4/helpers/screenshot.js.map +1 -0
  414. package/dist/v4/helpers/scrollUntil.d.ts +13 -0
  415. package/dist/v4/helpers/scrollUntil.d.ts.map +1 -0
  416. package/dist/v4/helpers/scrollUntil.js +90 -0
  417. package/dist/v4/helpers/scrollUntil.js.map +1 -0
  418. package/dist/v4/helpers/smartui.d.ts +9 -0
  419. package/dist/v4/helpers/smartui.d.ts.map +1 -0
  420. package/dist/v4/helpers/smartui.js +77 -0
  421. package/dist/v4/helpers/smartui.js.map +1 -0
  422. package/dist/v4/helpers/sseParser.d.ts +34 -0
  423. package/dist/v4/helpers/sseParser.d.ts.map +1 -0
  424. package/dist/v4/helpers/sseParser.js +128 -0
  425. package/dist/v4/helpers/sseParser.js.map +1 -0
  426. package/dist/v4/helpers/tabs.d.ts +32 -0
  427. package/dist/v4/helpers/tabs.d.ts.map +1 -0
  428. package/dist/v4/helpers/tabs.js +89 -0
  429. package/dist/v4/helpers/tabs.js.map +1 -0
  430. package/dist/v4/helpers/text.d.ts +15 -0
  431. package/dist/v4/helpers/text.d.ts.map +1 -0
  432. package/dist/v4/helpers/text.js +24 -0
  433. package/dist/v4/helpers/text.js.map +1 -0
  434. package/dist/v4/helpers/textNormalize.d.ts +18 -0
  435. package/dist/v4/helpers/textNormalize.d.ts.map +1 -0
  436. package/dist/v4/helpers/textNormalize.js +39 -0
  437. package/dist/v4/helpers/textNormalize.js.map +1 -0
  438. package/dist/v4/helpers/textualAnalyzer/domStructured.d.ts +44 -0
  439. package/dist/v4/helpers/textualAnalyzer/domStructured.d.ts.map +1 -0
  440. package/dist/v4/helpers/textualAnalyzer/domStructured.js +242 -0
  441. package/dist/v4/helpers/textualAnalyzer/domStructured.js.map +1 -0
  442. package/dist/v4/helpers/textualAnalyzer/evaluate.d.ts +14 -0
  443. package/dist/v4/helpers/textualAnalyzer/evaluate.d.ts.map +1 -0
  444. package/dist/v4/helpers/textualAnalyzer/evaluate.js +5 -0
  445. package/dist/v4/helpers/textualAnalyzer/evaluate.js.map +1 -0
  446. package/dist/v4/helpers/textualAnalyzer/extractor.d.ts +21 -0
  447. package/dist/v4/helpers/textualAnalyzer/extractor.d.ts.map +1 -0
  448. package/dist/v4/helpers/textualAnalyzer/extractor.js +38 -0
  449. package/dist/v4/helpers/textualAnalyzer/extractor.js.map +1 -0
  450. package/dist/v4/helpers/textualAnalyzer/heal.d.ts +25 -0
  451. package/dist/v4/helpers/textualAnalyzer/heal.d.ts.map +1 -0
  452. package/dist/v4/helpers/textualAnalyzer/heal.js +120 -0
  453. package/dist/v4/helpers/textualAnalyzer/heal.js.map +1 -0
  454. package/dist/v4/helpers/textualAnalyzer/index.d.ts +29 -0
  455. package/dist/v4/helpers/textualAnalyzer/index.d.ts.map +1 -0
  456. package/dist/v4/helpers/textualAnalyzer/index.js +60 -0
  457. package/dist/v4/helpers/textualAnalyzer/index.js.map +1 -0
  458. package/dist/v4/helpers/textualAnalyzer/locatorEnrichment.d.ts +47 -0
  459. package/dist/v4/helpers/textualAnalyzer/locatorEnrichment.d.ts.map +1 -0
  460. package/dist/v4/helpers/textualAnalyzer/locatorEnrichment.js +224 -0
  461. package/dist/v4/helpers/textualAnalyzer/locatorEnrichment.js.map +1 -0
  462. package/dist/v4/helpers/vision.d.ts.map +1 -0
  463. package/dist/v4/helpers/vision.js +487 -0
  464. package/dist/v4/helpers/vision.js.map +1 -0
  465. package/dist/v4/helpers/wait.d.ts +16 -0
  466. package/dist/v4/helpers/wait.d.ts.map +1 -0
  467. package/dist/v4/helpers/wait.js +48 -0
  468. package/dist/v4/helpers/wait.js.map +1 -0
  469. package/dist/v4/http.d.ts +14 -0
  470. package/dist/v4/http.d.ts.map +1 -0
  471. package/dist/v4/http.js +45 -0
  472. package/dist/v4/http.js.map +1 -0
  473. package/dist/v4/httpClient.d.ts +18 -0
  474. package/dist/v4/httpClient.d.ts.map +1 -0
  475. package/dist/v4/httpClient.js +140 -0
  476. package/dist/v4/httpClient.js.map +1 -0
  477. package/dist/v4/index.d.ts +40 -0
  478. package/dist/v4/index.d.ts.map +1 -0
  479. package/dist/v4/index.js +41 -0
  480. package/dist/v4/index.js.map +1 -0
  481. package/dist/v4/rankedLocator.d.ts +27 -0
  482. package/dist/v4/rankedLocator.d.ts.map +1 -0
  483. package/dist/v4/rankedLocator.js +85 -0
  484. package/dist/v4/rankedLocator.js.map +1 -0
  485. package/dist/v4/relayProxy.d.ts +46 -0
  486. package/dist/v4/relayProxy.d.ts.map +1 -0
  487. package/dist/v4/relayProxy.js +485 -0
  488. package/dist/v4/relayProxy.js.map +1 -0
  489. package/dist/v4/reporters/index.d.ts +33 -0
  490. package/dist/v4/reporters/index.d.ts.map +1 -0
  491. package/dist/v4/reporters/index.js +7 -0
  492. package/dist/v4/reporters/index.js.map +1 -0
  493. package/dist/v4/reporters/local.d.ts +13 -0
  494. package/dist/v4/reporters/local.d.ts.map +1 -0
  495. package/dist/v4/reporters/local.js +40 -0
  496. package/dist/v4/reporters/local.js.map +1 -0
  497. package/dist/v4/reporters/lt.d.ts +28 -0
  498. package/dist/v4/reporters/lt.d.ts.map +1 -0
  499. package/dist/v4/reporters/lt.js +110 -0
  500. package/dist/v4/reporters/lt.js.map +1 -0
  501. package/dist/v4/reporters/null.d.ts +11 -0
  502. package/dist/v4/reporters/null.d.ts.map +1 -0
  503. package/dist/v4/reporters/null.js +10 -0
  504. package/dist/v4/reporters/null.js.map +1 -0
  505. package/dist/v4/routeFailure.d.ts +9 -0
  506. package/dist/v4/routeFailure.d.ts.map +1 -0
  507. package/dist/v4/routeFailure.js +34 -0
  508. package/dist/v4/routeFailure.js.map +1 -0
  509. package/dist/v4/session.d.ts +22 -0
  510. package/dist/v4/session.d.ts.map +1 -0
  511. package/dist/v4/session.js +312 -0
  512. package/dist/v4/session.js.map +1 -0
  513. package/dist/v4/step.d.ts +53 -0
  514. package/dist/v4/step.d.ts.map +1 -0
  515. package/dist/v4/step.js +95 -0
  516. package/dist/v4/step.js.map +1 -0
  517. package/dist/v4/stepVariables.d.ts +15 -0
  518. package/dist/v4/stepVariables.d.ts.map +1 -0
  519. package/dist/v4/stepVariables.js +61 -0
  520. package/dist/v4/stepVariables.js.map +1 -0
  521. package/dist/v4/test.d.ts +10 -0
  522. package/dist/v4/test.d.ts.map +1 -0
  523. package/dist/v4/test.js +5 -0
  524. package/dist/v4/test.js.map +1 -0
  525. package/dist/v4/testConfig.d.ts +12 -0
  526. package/dist/v4/testConfig.d.ts.map +1 -0
  527. package/dist/v4/testConfig.js +89 -0
  528. package/dist/v4/testConfig.js.map +1 -0
  529. package/dist/v4/testState.d.ts +10 -0
  530. package/dist/v4/testState.d.ts.map +1 -0
  531. package/dist/v4/testState.js +16 -0
  532. package/dist/v4/testState.js.map +1 -0
  533. package/dist/v4/vars.d.ts +84 -0
  534. package/dist/v4/vars.d.ts.map +1 -0
  535. package/dist/v4/vars.js +912 -0
  536. package/dist/v4/vars.js.map +1 -0
  537. package/dist/v4/visionLocator.d.ts +53 -0
  538. package/dist/v4/visionLocator.d.ts.map +1 -0
  539. package/dist/v4/visionLocator.js +117 -0
  540. package/dist/v4/visionLocator.js.map +1 -0
  541. package/package.json +1 -1
  542. package/dist/actionEngine.d.ts.map +0 -1
  543. package/dist/actionEngine.js +0 -194
  544. package/dist/actionEngine.js.map +0 -1
  545. package/dist/actionSpecs.d.ts.map +0 -1
  546. package/dist/actionSpecs.js +0 -354
  547. package/dist/actionSpecs.js.map +0 -1
  548. package/dist/capability.d.ts.map +0 -1
  549. package/dist/capability.js +0 -346
  550. package/dist/capability.js.map +0 -1
  551. package/dist/downloadsPath.d.ts.map +0 -1
  552. package/dist/downloadsPath.js.map +0 -1
  553. package/dist/healCache.d.ts.map +0 -1
  554. package/dist/healCache.js.map +0 -1
  555. package/dist/healPatch.d.ts +0 -20
  556. package/dist/healPatch.d.ts.map +0 -1
  557. package/dist/healPatch.js +0 -429
  558. package/dist/healPatch.js.map +0 -1
  559. package/dist/helpers/a11yFlatten.d.ts.map +0 -1
  560. package/dist/helpers/a11yFlatten.js +0 -569
  561. package/dist/helpers/a11yFlatten.js.map +0 -1
  562. package/dist/helpers/apiCalls.d.ts.map +0 -1
  563. package/dist/helpers/apiCalls.js +0 -59
  564. package/dist/helpers/apiCalls.js.map +0 -1
  565. package/dist/helpers/assertion.d.ts.map +0 -1
  566. package/dist/helpers/assertion.js +0 -152
  567. package/dist/helpers/assertion.js.map +0 -1
  568. package/dist/helpers/assertionV3.d.ts.map +0 -1
  569. package/dist/helpers/assertionV3.js.map +0 -1
  570. package/dist/helpers/autohealAx.d.ts.map +0 -1
  571. package/dist/helpers/autohealAx.js +0 -148
  572. package/dist/helpers/autohealAx.js.map +0 -1
  573. package/dist/helpers/axTree/actionable.d.ts.map +0 -1
  574. package/dist/helpers/axTree/actionable.js +0 -404
  575. package/dist/helpers/axTree/actionable.js.map +0 -1
  576. package/dist/helpers/axTree/captureAxTree.d.ts.map +0 -1
  577. package/dist/helpers/axTree/captureAxTree.js.map +0 -1
  578. package/dist/helpers/axTree/captureFrameForest.d.ts.map +0 -1
  579. package/dist/helpers/axTree/captureFrameForest.js +0 -475
  580. package/dist/helpers/axTree/captureFrameForest.js.map +0 -1
  581. package/dist/helpers/axTree/index.d.ts.map +0 -1
  582. package/dist/helpers/axTree/index.js.map +0 -1
  583. package/dist/helpers/axTree/serializeAxTree.d.ts.map +0 -1
  584. package/dist/helpers/axTree/serializeAxTree.js.map +0 -1
  585. package/dist/helpers/clipboard-intercept.d.ts.map +0 -1
  586. package/dist/helpers/clipboard-intercept.js.map +0 -1
  587. package/dist/helpers/clipboard.d.ts.map +0 -1
  588. package/dist/helpers/clipboard.js.map +0 -1
  589. package/dist/helpers/condition.d.ts +0 -100
  590. package/dist/helpers/condition.d.ts.map +0 -1
  591. package/dist/helpers/condition.js +0 -357
  592. package/dist/helpers/condition.js.map +0 -1
  593. package/dist/helpers/cookies.d.ts.map +0 -1
  594. package/dist/helpers/cookies.js +0 -66
  595. package/dist/helpers/cookies.js.map +0 -1
  596. package/dist/helpers/coordinateResolver.d.ts.map +0 -1
  597. package/dist/helpers/coordinateResolver.js +0 -118
  598. package/dist/helpers/coordinateResolver.js.map +0 -1
  599. package/dist/helpers/coordinateResolverRead.d.ts.map +0 -1
  600. package/dist/helpers/coordinateResolverRead.js +0 -107
  601. package/dist/helpers/coordinateResolverRead.js.map +0 -1
  602. package/dist/helpers/credits.d.ts.map +0 -1
  603. package/dist/helpers/credits.js +0 -52
  604. package/dist/helpers/credits.js.map +0 -1
  605. package/dist/helpers/derive.d.ts.map +0 -1
  606. package/dist/helpers/derive.js +0 -87
  607. package/dist/helpers/derive.js.map +0 -1
  608. package/dist/helpers/devtools.d.ts.map +0 -1
  609. package/dist/helpers/devtools.js +0 -1215
  610. package/dist/helpers/devtools.js.map +0 -1
  611. package/dist/helpers/dialog.d.ts.map +0 -1
  612. package/dist/helpers/dialog.js.map +0 -1
  613. package/dist/helpers/drag.d.ts.map +0 -1
  614. package/dist/helpers/drag.js +0 -276
  615. package/dist/helpers/drag.js.map +0 -1
  616. package/dist/helpers/evaluation/colors.d.ts.map +0 -1
  617. package/dist/helpers/evaluation/colors.js.map +0 -1
  618. package/dist/helpers/evaluation/evaluate.d.ts.map +0 -1
  619. package/dist/helpers/evaluation/evaluate.js.map +0 -1
  620. package/dist/helpers/executeApi.d.ts.map +0 -1
  621. package/dist/helpers/executeApi.js +0 -377
  622. package/dist/helpers/executeApi.js.map +0 -1
  623. package/dist/helpers/executeDb.d.ts.map +0 -1
  624. package/dist/helpers/executeDb.js +0 -54
  625. package/dist/helpers/executeDb.js.map +0 -1
  626. package/dist/helpers/executeJs.d.ts.map +0 -1
  627. package/dist/helpers/executeJs.js +0 -117
  628. package/dist/helpers/executeJs.js.map +0 -1
  629. package/dist/helpers/gesture.d.ts.map +0 -1
  630. package/dist/helpers/gesture.js +0 -131
  631. package/dist/helpers/gesture.js.map +0 -1
  632. package/dist/helpers/healCascade.d.ts.map +0 -1
  633. package/dist/helpers/healCascade.js +0 -418
  634. package/dist/helpers/healCascade.js.map +0 -1
  635. package/dist/helpers/iframeA11y.d.ts.map +0 -1
  636. package/dist/helpers/iframeA11y.js +0 -128
  637. package/dist/helpers/iframeA11y.js.map +0 -1
  638. package/dist/helpers/kaneCli.d.ts.map +0 -1
  639. package/dist/helpers/kaneCli.js +0 -319
  640. package/dist/helpers/kaneCli.js.map +0 -1
  641. package/dist/helpers/loop.d.ts +0 -6
  642. package/dist/helpers/loop.d.ts.map +0 -1
  643. package/dist/helpers/loop.js +0 -9
  644. package/dist/helpers/loop.js.map +0 -1
  645. package/dist/helpers/math.d.ts.map +0 -1
  646. package/dist/helpers/math.js +0 -152
  647. package/dist/helpers/math.js.map +0 -1
  648. package/dist/helpers/network.d.ts.map +0 -1
  649. package/dist/helpers/network.js +0 -185
  650. package/dist/helpers/network.js.map +0 -1
  651. package/dist/helpers/pageReady.d.ts.map +0 -1
  652. package/dist/helpers/pageReady.js +0 -85
  653. package/dist/helpers/pageReady.js.map +0 -1
  654. package/dist/helpers/png.d.ts.map +0 -1
  655. package/dist/helpers/png.js.map +0 -1
  656. package/dist/helpers/queryResult.d.ts.map +0 -1
  657. package/dist/helpers/queryResult.js.map +0 -1
  658. package/dist/helpers/runtimeSnapshot.d.ts.map +0 -1
  659. package/dist/helpers/runtimeSnapshot.js +0 -204
  660. package/dist/helpers/runtimeSnapshot.js.map +0 -1
  661. package/dist/helpers/schemaAssertion.d.ts.map +0 -1
  662. package/dist/helpers/schemaAssertion.js +0 -117
  663. package/dist/helpers/schemaAssertion.js.map +0 -1
  664. package/dist/helpers/screenshot.d.ts +0 -45
  665. package/dist/helpers/screenshot.d.ts.map +0 -1
  666. package/dist/helpers/screenshot.js +0 -90
  667. package/dist/helpers/screenshot.js.map +0 -1
  668. package/dist/helpers/scrollUntil.d.ts.map +0 -1
  669. package/dist/helpers/scrollUntil.js +0 -90
  670. package/dist/helpers/scrollUntil.js.map +0 -1
  671. package/dist/helpers/smartui.d.ts.map +0 -1
  672. package/dist/helpers/smartui.js +0 -77
  673. package/dist/helpers/smartui.js.map +0 -1
  674. package/dist/helpers/sseParser.d.ts.map +0 -1
  675. package/dist/helpers/sseParser.js.map +0 -1
  676. package/dist/helpers/tabs.d.ts +0 -44
  677. package/dist/helpers/tabs.d.ts.map +0 -1
  678. package/dist/helpers/tabs.js +0 -270
  679. package/dist/helpers/tabs.js.map +0 -1
  680. package/dist/helpers/text.d.ts.map +0 -1
  681. package/dist/helpers/text.js.map +0 -1
  682. package/dist/helpers/textNormalize.d.ts.map +0 -1
  683. package/dist/helpers/textNormalize.js.map +0 -1
  684. package/dist/helpers/textualAnalyzer/domStructured.d.ts.map +0 -1
  685. package/dist/helpers/textualAnalyzer/domStructured.js +0 -242
  686. package/dist/helpers/textualAnalyzer/domStructured.js.map +0 -1
  687. package/dist/helpers/textualAnalyzer/evaluate.d.ts.map +0 -1
  688. package/dist/helpers/textualAnalyzer/evaluate.js.map +0 -1
  689. package/dist/helpers/textualAnalyzer/extractor.d.ts.map +0 -1
  690. package/dist/helpers/textualAnalyzer/extractor.js.map +0 -1
  691. package/dist/helpers/textualAnalyzer/heal.d.ts.map +0 -1
  692. package/dist/helpers/textualAnalyzer/heal.js +0 -120
  693. package/dist/helpers/textualAnalyzer/heal.js.map +0 -1
  694. package/dist/helpers/textualAnalyzer/index.d.ts.map +0 -1
  695. package/dist/helpers/textualAnalyzer/index.js +0 -60
  696. package/dist/helpers/textualAnalyzer/index.js.map +0 -1
  697. package/dist/helpers/textualAnalyzer/locatorEnrichment.d.ts.map +0 -1
  698. package/dist/helpers/textualAnalyzer/locatorEnrichment.js +0 -224
  699. package/dist/helpers/textualAnalyzer/locatorEnrichment.js.map +0 -1
  700. package/dist/helpers/textualRead.d.ts.map +0 -1
  701. package/dist/helpers/textualRead.js.map +0 -1
  702. package/dist/helpers/vision.d.ts.map +0 -1
  703. package/dist/helpers/vision.js +0 -498
  704. package/dist/helpers/vision.js.map +0 -1
  705. package/dist/helpers/visionFence.d.ts.map +0 -1
  706. package/dist/helpers/visionFence.js.map +0 -1
  707. package/dist/helpers/visionV3.d.ts +0 -52
  708. package/dist/helpers/visionV3.d.ts.map +0 -1
  709. package/dist/helpers/visionV3.js +0 -366
  710. package/dist/helpers/visionV3.js.map +0 -1
  711. package/dist/helpers/wait.d.ts.map +0 -1
  712. package/dist/helpers/wait.js +0 -48
  713. package/dist/helpers/wait.js.map +0 -1
  714. package/dist/http.d.ts.map +0 -1
  715. package/dist/http.js +0 -45
  716. package/dist/http.js.map +0 -1
  717. package/dist/httpClient.d.ts.map +0 -1
  718. package/dist/httpClient.js.map +0 -1
  719. package/dist/rankedLocator.d.ts.map +0 -1
  720. package/dist/rankedLocator.js +0 -85
  721. package/dist/rankedLocator.js.map +0 -1
  722. package/dist/relayProxy.d.ts.map +0 -1
  723. package/dist/relayProxy.js +0 -485
  724. package/dist/relayProxy.js.map +0 -1
  725. package/dist/reporters/index.d.ts.map +0 -1
  726. package/dist/reporters/index.js +0 -7
  727. package/dist/reporters/index.js.map +0 -1
  728. package/dist/reporters/local.d.ts.map +0 -1
  729. package/dist/reporters/local.js +0 -40
  730. package/dist/reporters/local.js.map +0 -1
  731. package/dist/reporters/lt.d.ts.map +0 -1
  732. package/dist/reporters/lt.js +0 -127
  733. package/dist/reporters/lt.js.map +0 -1
  734. package/dist/reporters/null.d.ts.map +0 -1
  735. package/dist/reporters/null.js.map +0 -1
  736. package/dist/routeFailure.d.ts.map +0 -1
  737. package/dist/routeFailure.js +0 -34
  738. package/dist/routeFailure.js.map +0 -1
  739. package/dist/session.d.ts.map +0 -1
  740. package/dist/session.js +0 -312
  741. package/dist/session.js.map +0 -1
  742. package/dist/step.d.ts.map +0 -1
  743. package/dist/step.js +0 -112
  744. package/dist/step.js.map +0 -1
  745. package/dist/stepVariables.d.ts.map +0 -1
  746. package/dist/stepVariables.js +0 -61
  747. package/dist/stepVariables.js.map +0 -1
  748. package/dist/test.d.ts.map +0 -1
  749. package/dist/test.js.map +0 -1
  750. package/dist/testConfig.d.ts.map +0 -1
  751. package/dist/testConfig.js.map +0 -1
  752. package/dist/testState.d.ts.map +0 -1
  753. package/dist/testState.js.map +0 -1
  754. package/dist/vars.d.ts +0 -78
  755. package/dist/vars.d.ts.map +0 -1
  756. package/dist/vars.js +0 -912
  757. package/dist/vars.js.map +0 -1
  758. package/dist/visionLocator.d.ts.map +0 -1
  759. package/dist/visionLocator.js +0 -117
  760. package/dist/visionLocator.js.map +0 -1
  761. /package/dist/{actionEngine.d.ts → v3/actionEngine.d.ts} +0 -0
  762. /package/dist/{actionSpecs.d.ts → v3/actionSpecs.d.ts} +0 -0
  763. /package/dist/{capability.d.ts → v3/capability.d.ts} +0 -0
  764. /package/dist/{downloadsPath.d.ts → v3/downloadsPath.d.ts} +0 -0
  765. /package/dist/{downloadsPath.js → v3/downloadsPath.js} +0 -0
  766. /package/dist/{healCache.d.ts → v3/healCache.d.ts} +0 -0
  767. /package/dist/{healCache.js → v3/healCache.js} +0 -0
  768. /package/dist/{helpers → v3/helpers}/a11yFlatten.d.ts +0 -0
  769. /package/dist/{helpers → v3/helpers}/apiCalls.d.ts +0 -0
  770. /package/dist/{helpers → v3/helpers}/assertion.d.ts +0 -0
  771. /package/dist/{helpers → v3/helpers}/assertionV3.d.ts +0 -0
  772. /package/dist/{helpers → v3/helpers}/assertionV3.js +0 -0
  773. /package/dist/{helpers → v3/helpers}/autohealAx.d.ts +0 -0
  774. /package/dist/{helpers → v3/helpers}/axTree/actionable.d.ts +0 -0
  775. /package/dist/{helpers → v3/helpers}/axTree/captureAxTree.d.ts +0 -0
  776. /package/dist/{helpers → v3/helpers}/axTree/captureAxTree.js +0 -0
  777. /package/dist/{helpers → v3/helpers}/axTree/captureFrameForest.d.ts +0 -0
  778. /package/dist/{helpers → v3/helpers}/axTree/index.d.ts +0 -0
  779. /package/dist/{helpers → v3/helpers}/axTree/index.js +0 -0
  780. /package/dist/{helpers → v3/helpers}/axTree/serializeAxTree.d.ts +0 -0
  781. /package/dist/{helpers → v3/helpers}/axTree/serializeAxTree.js +0 -0
  782. /package/dist/{helpers → v3/helpers}/clipboard-intercept.d.ts +0 -0
  783. /package/dist/{helpers → v3/helpers}/clipboard-intercept.js +0 -0
  784. /package/dist/{helpers → v3/helpers}/clipboard.d.ts +0 -0
  785. /package/dist/{helpers → v3/helpers}/clipboard.js +0 -0
  786. /package/dist/{helpers → v3/helpers}/cookies.d.ts +0 -0
  787. /package/dist/{helpers → v3/helpers}/coordinateResolver.d.ts +0 -0
  788. /package/dist/{helpers → v3/helpers}/coordinateResolverRead.d.ts +0 -0
  789. /package/dist/{helpers → v3/helpers}/credits.d.ts +0 -0
  790. /package/dist/{helpers → v3/helpers}/derive.d.ts +0 -0
  791. /package/dist/{helpers → v3/helpers}/devtools.d.ts +0 -0
  792. /package/dist/{helpers → v3/helpers}/dialog.d.ts +0 -0
  793. /package/dist/{helpers → v3/helpers}/dialog.js +0 -0
  794. /package/dist/{helpers → v3/helpers}/drag.d.ts +0 -0
  795. /package/dist/{helpers → v3/helpers}/evaluation/colors.d.ts +0 -0
  796. /package/dist/{helpers → v3/helpers}/evaluation/colors.js +0 -0
  797. /package/dist/{helpers → v3/helpers}/evaluation/evaluate.d.ts +0 -0
  798. /package/dist/{helpers → v3/helpers}/evaluation/evaluate.js +0 -0
  799. /package/dist/{helpers → v3/helpers}/executeApi.d.ts +0 -0
  800. /package/dist/{helpers → v3/helpers}/executeDb.d.ts +0 -0
  801. /package/dist/{helpers → v3/helpers}/executeJs.d.ts +0 -0
  802. /package/dist/{helpers → v3/helpers}/gesture.d.ts +0 -0
  803. /package/dist/{helpers → v3/helpers}/healCascade.d.ts +0 -0
  804. /package/dist/{helpers → v3/helpers}/iframeA11y.d.ts +0 -0
  805. /package/dist/{helpers → v3/helpers}/kaneCli.d.ts +0 -0
  806. /package/dist/{helpers → v3/helpers}/math.d.ts +0 -0
  807. /package/dist/{helpers → v3/helpers}/network.d.ts +0 -0
  808. /package/dist/{helpers → v3/helpers}/pageReady.d.ts +0 -0
  809. /package/dist/{helpers → v3/helpers}/png.d.ts +0 -0
  810. /package/dist/{helpers → v3/helpers}/png.js +0 -0
  811. /package/dist/{helpers → v3/helpers}/queryResult.d.ts +0 -0
  812. /package/dist/{helpers → v3/helpers}/queryResult.js +0 -0
  813. /package/dist/{helpers → v3/helpers}/runtimeSnapshot.d.ts +0 -0
  814. /package/dist/{helpers → v3/helpers}/schemaAssertion.d.ts +0 -0
  815. /package/dist/{helpers → v3/helpers}/scrollUntil.d.ts +0 -0
  816. /package/dist/{helpers → v3/helpers}/smartui.d.ts +0 -0
  817. /package/dist/{helpers → v3/helpers}/sseParser.d.ts +0 -0
  818. /package/dist/{helpers → v3/helpers}/sseParser.js +0 -0
  819. /package/dist/{helpers → v3/helpers}/text.d.ts +0 -0
  820. /package/dist/{helpers → v3/helpers}/text.js +0 -0
  821. /package/dist/{helpers → v3/helpers}/textNormalize.d.ts +0 -0
  822. /package/dist/{helpers → v3/helpers}/textNormalize.js +0 -0
  823. /package/dist/{helpers → v3/helpers}/textualAnalyzer/domStructured.d.ts +0 -0
  824. /package/dist/{helpers → v3/helpers}/textualAnalyzer/evaluate.d.ts +0 -0
  825. /package/dist/{helpers → v3/helpers}/textualAnalyzer/evaluate.js +0 -0
  826. /package/dist/{helpers → v3/helpers}/textualAnalyzer/extractor.d.ts +0 -0
  827. /package/dist/{helpers → v3/helpers}/textualAnalyzer/extractor.js +0 -0
  828. /package/dist/{helpers → v3/helpers}/textualAnalyzer/heal.d.ts +0 -0
  829. /package/dist/{helpers → v3/helpers}/textualAnalyzer/index.d.ts +0 -0
  830. /package/dist/{helpers → v3/helpers}/textualAnalyzer/locatorEnrichment.d.ts +0 -0
  831. /package/dist/{helpers → v3/helpers}/textualRead.d.ts +0 -0
  832. /package/dist/{helpers → v3/helpers}/textualRead.js +0 -0
  833. /package/dist/{helpers → v3/helpers}/visionFence.d.ts +0 -0
  834. /package/dist/{helpers → v3/helpers}/visionFence.js +0 -0
  835. /package/dist/{helpers → v3/helpers}/wait.d.ts +0 -0
  836. /package/dist/{http.d.ts → v3/http.d.ts} +0 -0
  837. /package/dist/{httpClient.d.ts → v3/httpClient.d.ts} +0 -0
  838. /package/dist/{httpClient.js → v3/httpClient.js} +0 -0
  839. /package/dist/{rankedLocator.d.ts → v3/rankedLocator.d.ts} +0 -0
  840. /package/dist/{relayProxy.d.ts → v3/relayProxy.d.ts} +0 -0
  841. /package/dist/{reporters → v3/reporters}/index.d.ts +0 -0
  842. /package/dist/{reporters → v3/reporters}/local.d.ts +0 -0
  843. /package/dist/{reporters → v3/reporters}/lt.d.ts +0 -0
  844. /package/dist/{reporters → v3/reporters}/null.d.ts +0 -0
  845. /package/dist/{reporters → v3/reporters}/null.js +0 -0
  846. /package/dist/{routeFailure.d.ts → v3/routeFailure.d.ts} +0 -0
  847. /package/dist/{session.d.ts → v3/session.d.ts} +0 -0
  848. /package/dist/{step.d.ts → v3/step.d.ts} +0 -0
  849. /package/dist/{stepVariables.d.ts → v3/stepVariables.d.ts} +0 -0
  850. /package/dist/{test.d.ts → v3/test.d.ts} +0 -0
  851. /package/dist/{test.js → v3/test.js} +0 -0
  852. /package/dist/{testConfig.d.ts → v3/testConfig.d.ts} +0 -0
  853. /package/dist/{testConfig.js → v3/testConfig.js} +0 -0
  854. /package/dist/{testState.d.ts → v3/testState.d.ts} +0 -0
  855. /package/dist/{testState.js → v3/testState.js} +0 -0
  856. /package/dist/{visionLocator.d.ts → v3/visionLocator.d.ts} +0 -0
  857. /package/dist/{helpers → v4/helpers}/vision.d.ts +0 -0
@@ -0,0 +1,185 @@
1
+ import { resolveVar } from '../vars.js';
2
+ import { getHarUrl } from '../../config.js';
3
+ import { log, repr } from '../../log.js';
4
+ import { AssertionFailureError } from '../../errors.js';
5
+ async function resolve(val) {
6
+ return typeof val === 'string' ? resolveVar(val) : val;
7
+ }
8
+ // Operand values are captured HAR responses and can run to hundreds of
9
+ // kilobytes; keep the failure message readable.
10
+ const OPERAND_PREVIEW_CHARS = 200;
11
+ function preview(value) {
12
+ return value.length <= OPERAND_PREVIEW_CHARS
13
+ ? JSON.stringify(value)
14
+ : `${JSON.stringify(value.slice(0, OPERAND_PREVIEW_CHARS))}… (${value.length} chars)`;
15
+ }
16
+ function formatFailedLeaves(failed) {
17
+ if (failed.length === 0)
18
+ return 'no leaf comparison recorded';
19
+ return failed.map(([op, a, b]) => `${preview(a)} ${op} ${preview(b)}`).join('; ');
20
+ }
21
+ async function evaluateLeaf(l, failed) {
22
+ const a = await resolve(l.left_operand);
23
+ const b = await resolve(l.right_operand);
24
+ const result = await compareLeaf(l, a, b);
25
+ if (!result)
26
+ failed.push([l.operator.toLowerCase(), String(a), String(b)]);
27
+ return result;
28
+ }
29
+ async function compareLeaf(l, a, b) {
30
+ switch (l.operator.toLowerCase()) {
31
+ case 'equals': return a == b;
32
+ case 'not_equals': return a != b;
33
+ case 'contains': return String(a).includes(String(b));
34
+ case 'not_contains': return !String(a).includes(String(b));
35
+ case 'greater_than': return Number(a) > Number(b);
36
+ case 'greater_than_or_equal': return Number(a) >= Number(b);
37
+ case 'less_than': return Number(a) < Number(b);
38
+ case 'less_than_or_equal': return Number(a) <= Number(b);
39
+ case 'start_with': return String(a).startsWith(String(b));
40
+ case 'end_with': return String(a).endsWith(String(b));
41
+ }
42
+ }
43
+ function isComposite(n) {
44
+ const op = n.operator.toLowerCase();
45
+ return op === 'and' || op === 'or';
46
+ }
47
+ async function _evaluateNode(node, failed) {
48
+ if (isComposite(node)) {
49
+ const childResults = await Promise.all(node.operands.map((n) => _evaluateNode(n, failed)));
50
+ return node.operator.toLowerCase() === 'and' ? childResults.every(Boolean) : childResults.some(Boolean);
51
+ }
52
+ return evaluateLeaf(node, failed);
53
+ }
54
+ export async function evaluateNetworkAssertion(node) {
55
+ // PY parity: assertion.py:31-33 — log entry with operator + operands count
56
+ const operands = isComposite(node) ? node.operands.length : 0;
57
+ log.helper(`[network_assertion] evaluating operator=${node.operator} operands=${operands}`);
58
+ const failedLeaves = [];
59
+ const passed = await _evaluateNode(node, failedLeaves);
60
+ log.helper(`[network_assertion] result=${passed ? 'PASS' : 'FAIL'}`);
61
+ const result = {
62
+ status: passed ? 'passed' : 'failed',
63
+ tree: node,
64
+ };
65
+ if (!passed) {
66
+ // Report what the comparison actually compared. The tree still holds the
67
+ // unresolved {{var}} templates, so a tree-only message reads as though the
68
+ // operand never resolved when in fact it resolved to '' (TE-27434).
69
+ const detail = formatFailedLeaves(failedLeaves);
70
+ if (process.env.TESTMU_SKIP_ASSERTION_FAILURE) {
71
+ log.test(`[ASSERTION WARN] Network assertion failed: ${detail} | ${JSON.stringify(node)}`);
72
+ return result;
73
+ }
74
+ throw new AssertionFailureError(`Network assertion failed: ${detail}`, result);
75
+ }
76
+ return result;
77
+ }
78
+ // PY parity: _helpers/network.py:_decode_har_entry — base64-decode and
79
+ // JSON-parse JSON-mimetype bodies in-place so dot-path assertions on
80
+ // {{var.response.content.text.field}} walk into a parsed object, not a raw
81
+ // base64 string.
82
+ function decodeHarEntry(entry) {
83
+ if (!entry || typeof entry !== 'object')
84
+ return entry;
85
+ const decodeBody = (holder) => {
86
+ if (!holder || typeof holder.mimeType !== 'string' || !holder.mimeType.includes('application/json'))
87
+ return;
88
+ let text = holder.text ?? '';
89
+ if (holder.encoding === 'base64' && text) {
90
+ try {
91
+ text = Buffer.from(text, 'base64').toString('utf-8');
92
+ }
93
+ catch { /* leave as-is */ }
94
+ }
95
+ if (text) {
96
+ try {
97
+ holder.text = JSON.parse(text);
98
+ }
99
+ catch { /* leave as-is */ }
100
+ }
101
+ else {
102
+ holder.text = {};
103
+ }
104
+ };
105
+ decodeBody(entry?.response?.content);
106
+ decodeBody(entry?.request?.postData);
107
+ return entry;
108
+ }
109
+ export async function networkQuery(opts) {
110
+ // PY parity: HAR endpoint resolved via getHarUrl() — env wins, then cloud
111
+ // default, else null (skip). Replaces the prior runTarget cloud gate.
112
+ const HAR = getHarUrl();
113
+ if (HAR === null) {
114
+ log.helper(`[network_query] HAR endpoint not configured (no port env, not cloud) — skipping`);
115
+ return null;
116
+ }
117
+ // PY parity: network.py:132 — entry log with method, url[:80], index
118
+ log.helper(`[network_query] ${opts.method} ${opts.url.slice(0, 80)} (index=${opts.index})`);
119
+ // PY parity: network.py:134-148 — direct log_id lookup fast path
120
+ if (opts.networkLogId) {
121
+ try {
122
+ const resp = await fetch(`${HAR}/logs/entry?id=${opts.networkLogId}`);
123
+ if (resp.ok) {
124
+ const data = await resp.json();
125
+ if (data.entry) {
126
+ log.helper(`[network_query] found by log_id=${opts.networkLogId}`);
127
+ return decodeHarEntry(data.entry);
128
+ }
129
+ }
130
+ log.helper(`[network_query] log_id not found, falling back to polling`);
131
+ }
132
+ catch (e) {
133
+ log.helper(`[network_query] log_id lookup failed: ${String(e)} (falling back)`);
134
+ }
135
+ }
136
+ const interval = opts.pollingInterval ?? 2;
137
+ const maxTries = Math.max(1, Math.floor((opts.maxPollingTime ?? 10) / interval));
138
+ for (let i = 0; i < maxTries; i++) {
139
+ const attempt = i + 1;
140
+ try {
141
+ const resp = await fetch(`${HAR}/logs`);
142
+ if (resp.ok) {
143
+ // Martian returns HAR shape: {log: {entries: [...]}}. PY parity:
144
+ // network.py:175 — `data.get("log", {}).get("entries", [])`.
145
+ const data = await resp.json();
146
+ const entries = data?.log?.entries ?? [];
147
+ // PY parity: network.py:176-177 — per-attempt count
148
+ log.helper(`[network_query] attempt ${attempt}/${maxTries} — ${entries.length} HAR entries`);
149
+ const matches = entries.filter(e => e.request?.method === opts.method && e.request?.url === opts.url);
150
+ const entry = matches[opts.index - 1];
151
+ if (entry) {
152
+ // HAR entry id field is `_id` (Martian/HAR convention). PY parity:
153
+ // network.py:185 — `entry.get("_id", "")`.
154
+ const entryId = entry._id ?? "";
155
+ // PY parity: network.py:186-187 — match log
156
+ log.helper(`[network_query] matched at occurrence ${opts.index}, entry_id=${repr(entryId)}`);
157
+ if (entryId) {
158
+ // Best-effort enrichment via /logs/entry; fall through to listing
159
+ // entry on failure. PY parity: network.py:189-213.
160
+ try {
161
+ const detail = await fetch(`${HAR}/logs/entry?id=${entryId}`);
162
+ if (detail.ok) {
163
+ const full = await detail.json();
164
+ if (full?.entry)
165
+ return decodeHarEntry(full.entry);
166
+ }
167
+ }
168
+ catch { /* fall through to listing entry */ }
169
+ }
170
+ return decodeHarEntry(entry);
171
+ }
172
+ }
173
+ }
174
+ catch (e) {
175
+ // PY parity: network.py:215-216 — per-attempt error
176
+ log.helper(`[network_query] polling error: ${String(e)}`);
177
+ }
178
+ if (i < maxTries - 1)
179
+ await new Promise(r => setTimeout(r, interval * 1000));
180
+ }
181
+ // PY parity: network.py:192 — exhausted log
182
+ log.helper(`[network_query] no match found after ${maxTries} attempts`);
183
+ return null;
184
+ }
185
+ //# sourceMappingURL=network.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"network.js","sourceRoot":"","sources":["../../../src/v3/helpers/network.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAkBxD,KAAK,UAAU,OAAO,CAAC,GAAY;IACjC,OAAO,OAAO,GAAG,KAAK,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAU,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC;AAClE,CAAC;AAED,uEAAuE;AACvE,gDAAgD;AAChD,MAAM,qBAAqB,GAAG,GAAG,CAAC;AAElC,SAAS,OAAO,CAAC,KAAa;IAC5B,OAAO,KAAK,CAAC,MAAM,IAAI,qBAAqB;QAC1C,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC;QACvB,CAAC,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,qBAAqB,CAAC,CAAC,MAAM,KAAK,CAAC,MAAM,SAAS,CAAC;AAC1F,CAAC;AAED,SAAS,kBAAkB,CAAC,MAAuC;IACjE,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,6BAA6B,CAAC;IAC9D,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,OAAO,CAAC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S,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,EAC3B,KAAK,SAAW,GACf,OAAO,CAAC,CAAC,CAAC,CAeZ"}
@@ -0,0 +1,85 @@
1
+ /**
2
+ * Client-owned retry for automind's `page_not_ready` (HTTP 409) answer.
3
+ *
4
+ * The VQE does NOT retry internally. When the vision model reports an active
5
+ * loader, auteur-automind returns `{"error": "page_not_ready", ...}`
6
+ * (`app/services/vqe_service.py`) and the heal route maps it to **409** with an
7
+ * explicit contract (`app/api/endpoints/healer.py`):
8
+ *
9
+ * # 409 is pragmatic (outside tenacity's 5xx retry set) — client
10
+ * # owns the retry loop; do NOT switch this to a 5xx.
11
+ *
12
+ * Retrying inside the HTTP layer would re-POST the *same stale screenshot* and
13
+ * could never observe a settled page, so the budget has to wrap the screenshot
14
+ * capture — which is what `retryOnPageNotReady` does.
15
+ *
16
+ * Port of the V2 source
17
+ * (`_is_page_not_ready_response` + the `Heal.vision_query` loop): 3 POSTs,
18
+ * 3s between them, a fresh screenshot and a fresh `request_id` every attempt.
19
+ */
20
+ import { randomUUID } from 'node:crypto';
21
+ import { log } from '../../log.js';
22
+ /** Body discriminator automind sets when the VQE saw an active loader. */
23
+ export const PAGE_NOT_READY_ERROR = 'page_not_ready';
24
+ /** Status automind pairs with it (picked to sit outside the transport retry set). */
25
+ export const PAGE_NOT_READY_STATUS = 409;
26
+ /** Total POSTs per vision call (V2 parity). */
27
+ export const MAX_ATTEMPTS = 3;
28
+ /** Delay between attempts. The final attempt is not followed by a sleep. */
29
+ export const SLEEP_MS = 3000;
30
+ /**
31
+ * Fresh per-attempt id so every retry lands in its own automind VQE debug
32
+ * folder (`{org_id}/vqe/{request_id}`) instead of overwriting the last one.
33
+ */
34
+ export function newRequestId() {
35
+ return randomUUID().replace(/-/g, '').slice(0, 16);
36
+ }
37
+ /** True when a parsed heal response carries the loader signal. */
38
+ export function isPageNotReadyBody(body) {
39
+ return (typeof body === 'object' &&
40
+ body !== null &&
41
+ body['error'] === PAGE_NOT_READY_ERROR);
42
+ }
43
+ /**
44
+ * Terminal message for an exhausted budget, preserving loader diagnostics.
45
+ *
46
+ * Keeps the literal `page_not_ready` substring: auteur's
47
+ * `selenium_test_agent/llm/code_generation.py` routes on
48
+ * `"page_not_ready" in str(e)` to surface PAGE_NOT_READY_AFTER_RETRIES rather
49
+ * than a generic action failure.
50
+ */
51
+ export function pageNotReadyMessage(prefix, body) {
52
+ const b = (typeof body === 'object' && body !== null ? body : {});
53
+ const loaderReason = b['loader_reason'] ?? '';
54
+ const attempts = b['attempts'] ?? '';
55
+ return (`${prefix}: ${PAGE_NOT_READY_ERROR} ` +
56
+ `(loader_reason=${JSON.stringify(String(loaderReason))}, attempts=${String(attempts)}, ` +
57
+ `client_attempts=${MAX_ATTEMPTS})`);
58
+ }
59
+ const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
60
+ /**
61
+ * Run `attemptFn()` until it stops answering `page_not_ready`.
62
+ *
63
+ * `attemptFn` MUST re-capture the screenshot on every call — retrying above the
64
+ * transport layer is only useful because attempt N+1 observes a fresh page.
65
+ *
66
+ * Returns the last parsed body, which may still carry the loader error when the
67
+ * budget is exhausted; the caller raises from it so `loader_reason` survives
68
+ * into the step error.
69
+ */
70
+ export async function retryOnPageNotReady(attemptFn, label = 'vision') {
71
+ let result = await attemptFn();
72
+ for (let attempt = 1; attempt < MAX_ATTEMPTS; attempt++) {
73
+ if (!isPageNotReadyBody(result))
74
+ return result;
75
+ log.helper(`${label} :: page_not_ready (attempt ${attempt}/${MAX_ATTEMPTS}), waiting ` +
76
+ `${SLEEP_MS / 1000}s and retrying with a fresh screenshot`);
77
+ await sleep(SLEEP_MS);
78
+ result = await attemptFn();
79
+ }
80
+ if (isPageNotReadyBody(result)) {
81
+ log.helper(`${label} :: page_not_ready after ${MAX_ATTEMPTS} attempts — giving up`);
82
+ }
83
+ return result;
84
+ }
85
+ //# sourceMappingURL=pageReady.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pageReady.js","source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../src/v3/helpers/png.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,aAAa,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC;AAEpF,8EAA8E;AAC9E,MAAM,UAAU,aAAa,CAAC,IAAY;IACxC,IACE,IAAI,CAAC,MAAM,GAAG,EAAE;QAChB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,aAAa,CAAC;QAC1C,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,KAAK,MAAM,EACnD,CAAC;QACD,MAAM,IAAI,KAAK,CAAC,+BAA+B,CAAC,CAAC;IACnD,CAAC;IACD,OAAO,CAAC,IAAI,CAAC,YAAY,CAAC,EAAE,CAAC,EAAE,IAAI,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC,CAAC;AACxD,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"queryResult.d.ts","sourceRoot":"","sources":["../../../src/v3/helpers/queryResult.ts"],"names":[],"mappings":"AAAA,iFAAiF;AAEjF;;;;;;;;;GASG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,CAU5D"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"queryResult.js","sourceRoot":"","sources":["../../../src/v3/helpers/queryResult.ts"],"names":[],"mappings":"AAAA,iFAAiF;AAEjF;;;;;;;;;GASG;AACH,MAAM,UAAU,oBAAoB,CAAC,MAAe;IAClD,IAAI,MAAM,KAAK,IAAI,IAAI,MAAM,KAAK,SAAS;QAAE,OAAO,EAAE,CAAC;IACvD,IAAI,OAAO,MAAM,KAAK,QAAQ;QAAE,OAAO,MAAM,CAAC;IAC9C,IAAI,OAAO,MAAM,K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MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,QAAQ,GAAG,SAAS,CAAC;AAE7D;;;;;;;GAOG;AACH,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,UAAU,CAAC,OAAO,iBAAiB,CAAC,CAAC,CAAC,CAAC,GAAG,aAAa,CAenG;AAED,uEAAuE;AACvE,wBAAgB,6BAA6B,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAIrE;AAED,mEAAmE;AACnE,wBAAgB,+BAA+B,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAWvE;AAED,8DAA8D;AAC9D,wBAAsB,gCAAgC,CACpD,IAAI,EAAE;IAAE,QAAQ,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAA;CAAE,GAC/C,OAAO,CAAC,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,CAW7B"}
@@ -0,0 +1,204 @@
1
+ /**
2
+ * Non-CDP snapshot capture via the worker-provisioned aria-snap runtime.
3
+ *
4
+ * `newCDPSession` is Chromium-only in Playwright, but the TS capability builder
5
+ * maps `safari → pw-webkit` and `firefox → pw-firefox`, so a WebKit or Firefox
6
+ * grid session reaches the V3 textual-query path and cannot take the CDP route.
7
+ * Those sessions read the snapshot implementation that the test worker
8
+ * provisions on disk and evaluate it in the page instead.
9
+ *
10
+ * This mirrors `playwright-python/testmu/_helpers/vision.py` (and the
11
+ * selenium-python / selenium-java / playwright-csharp equivalents), which read
12
+ * the same Foreman asset rather than embedding the bundle in the package — the
13
+ * bindings ship via npm/pip/Maven/NuGet with no asset-delivery path of their own,
14
+ * and the runtime is proprietary and versioned with the worker, not the binding.
15
+ */
16
+ import { readFileSync } from 'node:fs';
17
+ import { log } from '../../log.js';
18
+ const LINUX_ASSET_PATH = '/home/ltuser/foreman/ltuser/aria_snapshot.js';
19
+ const MACOS_ASSET_PATH = '/Users/ltuser/foreman/ltuser/aria_snapshot.js';
20
+ const WINDOWS_ASSET_PATH = 'D:/foreman/ltuser/aria_snapshot.js';
21
+ /**
22
+ * Globals the provisioned runtime attaches to `globalThis`. Deleted after every
23
+ * capture so a page under test never observes them — the snapshot must not be
24
+ * able to change what it is snapshotting.
25
+ */
26
+ const RUNTIME_GLOBALS = [
27
+ '__ariaSnapshot',
28
+ '__ariaSnapshotDetails',
29
+ '__ariaSnapshotJSON',
30
+ '__ariaSnapshotCDP',
31
+ '__ariaSnapshotRaw',
32
+ '__domSnapshot',
33
+ '__domSnapshotCDP',
34
+ '__resolveDomSnapshotNode',
35
+ '__domSnapshotRaw',
36
+ '__domSnapshotRefs',
37
+ '__aria_snap_dom_streamer__',
38
+ ];
39
+ export const MISSING_RUNTIME_ASSET_ERROR = 'Required runtime asset was not provisioned.';
40
+ export const INVALID_RUNTIME_SNAPSHOT_ERROR = 'Required runtime asset returned an invalid snapshot.';
41
+ /** Fixed Foreman asset path for the worker host OS. */
42
+ export function runtimeSnapshotAssetPath(platform = process.platform) {
43
+ const p = String(platform).toLowerCase();
44
+ if (p === 'darwin')
45
+ return MACOS_ASSET_PATH;
46
+ if (p.startsWith('win'))
47
+ return WINDOWS_ASSET_PATH;
48
+ return LINUX_ASSET_PATH;
49
+ }
50
+ /**
51
+ * Read the host-provisioned snapshot implementation. Held in a mutable binding
52
+ * rather than called directly so unit tests can substitute it — the proprietary
53
+ * runtime asset only exists on a provisioned worker, so tests must never need
54
+ * the real file. (An ESM `import` binding cannot be spied on from outside.)
55
+ */
56
+ export function readRuntimeSnapshotAsset() {
57
+ return readFileSync(runtimeSnapshotAssetPath(), 'utf-8');
58
+ }
59
+ let reader = readRuntimeSnapshotAsset;
60
+ let cachedSource = null;
61
+ /** Test seam — substitute the asset reader. Pass nothing to restore the real one. */
62
+ export function _setRuntimeSnapshotReader(fn) {
63
+ reader = fn ?? readRuntimeSnapshotAsset;
64
+ cachedSource = null;
65
+ }
66
+ /** Load the provisioned implementation once, on first use. */
67
+ export function loadRuntimeSnapshotAsset() {
68
+ if (cachedSource !== null)
69
+ return cachedSource;
70
+ let source;
71
+ try {
72
+ source = reader();
73
+ }
74
+ catch {
75
+ throw new Error(MISSING_RUNTIME_ASSET_ERROR);
76
+ }
77
+ if (source.trim() === '')
78
+ throw new Error(MISSING_RUNTIME_ASSET_ERROR);
79
+ cachedSource = source;
80
+ return source;
81
+ }
82
+ /** Test seam — drop the memoized source. */
83
+ export function _resetRuntimeSnapshotCache() {
84
+ cachedSource = null;
85
+ }
86
+ /**
87
+ * Wrap the provisioned IIFE, both snapshot calls, and the global cleanup into
88
+ * ONE page evaluation. Splitting define and invoke would break Firefox, whose
89
+ * sandboxes do not persist page globals between evaluations, and would leave the
90
+ * runtime's globals attached if the second call threw.
91
+ */
92
+ export function buildRuntimeSnapshotExpression(source) {
93
+ const cleanupKeys = RUNTIME_GLOBALS.map((key) => JSON.stringify(key)).join(', ');
94
+ return `() => {
95
+ const cleanupKeys = [${cleanupKeys}];
96
+ try {
97
+ ${source}
98
+ return {
99
+ a11y_snapshot: globalThis.__ariaSnapshotCDP(),
100
+ dom_snapshot: globalThis.__domSnapshotCDP(),
101
+ };
102
+ } finally {
103
+ for (const key of cleanupKeys) {
104
+ try { delete globalThis[key]; } catch (_) {}
105
+ }
106
+ }
107
+ }`;
108
+ }
109
+ /**
110
+ * Validate the runtime's minimal CDP-shaped payload before it goes on the wire.
111
+ * A malformed snapshot must fail HERE with a clear message rather than as an
112
+ * opaque server-side error on the heal endpoint.
113
+ */
114
+ export function validateRuntimeSnapshotPair(result) {
115
+ const isRecord = (v) => typeof v === 'object' && v !== null && !Array.isArray(v);
116
+ if (!isRecord(result))
117
+ throw new Error(INVALID_RUNTIME_SNAPSHOT_ERROR);
118
+ const a11ySnapshot = result['a11y_snapshot'];
119
+ const domSnapshot = result['dom_snapshot'];
120
+ const documents = isRecord(domSnapshot) ? domSnapshot['documents'] : undefined;
121
+ const firstDocument = Array.isArray(documents) ? documents[0] : undefined;
122
+ if (!isRecord(a11ySnapshot) ||
123
+ !Array.isArray(a11ySnapshot['nodes']) ||
124
+ !isRecord(domSnapshot) ||
125
+ !Array.isArray(documents) ||
126
+ documents.length === 0 ||
127
+ !Array.isArray(domSnapshot['strings']) ||
128
+ !isRecord(firstDocument) ||
129
+ !isRecord(firstDocument['nodes']) ||
130
+ !isRecord(firstDocument['layout'])) {
131
+ throw new Error(INVALID_RUNTIME_SNAPSHOT_ERROR);
132
+ }
133
+ return [a11ySnapshot, domSnapshot];
134
+ }
135
+ /** Best-effort local engine identity; a relay may report Chromium for all engines. */
136
+ export function browserEngineName(page) {
137
+ try {
138
+ const name = page.context().browser()?.browserType().name();
139
+ return String(name ?? '').trim().toLowerCase();
140
+ }
141
+ catch {
142
+ return '';
143
+ }
144
+ }
145
+ /**
146
+ * Which capture route this session takes.
147
+ *
148
+ * The REQUESTED browser name wins over the local engine identity: cloud runs go
149
+ * through a relay that reports Chromium regardless of the real engine, so
150
+ * trusting the engine alone would route a WebKit session into CDP. `unknown`
151
+ * means "try CDP, fall back on an explicit non-Chromium rejection".
152
+ */
153
+ export function v3SnapshotCaptureRoute(page) {
154
+ const requested = (process.env['smart_browser_name'] ?? '').trim().toLowerCase();
155
+ if (requested === 'pw-webkit' || requested === 'pw-firefox')
156
+ return 'runtime';
157
+ if (['chrome', 'chromium', 'googlechrome', 'microsoftedge', 'edge', 'pw-chromium', 'island']
158
+ .includes(requested)) {
159
+ return 'native';
160
+ }
161
+ if (requested !== '')
162
+ return 'unknown';
163
+ const engine = browserEngineName(page);
164
+ if (engine === 'webkit' || engine === 'firefox')
165
+ return 'runtime';
166
+ if (engine === 'chromium')
167
+ return 'native';
168
+ return 'unknown';
169
+ }
170
+ /** Playwright's explicit non-Chromium CDP rejection, and only that. */
171
+ export function isExplicitUnsupportedCdpError(error) {
172
+ const message = String(error instanceof Error ? error.message : error).toLowerCase();
173
+ const exclusivity = message.includes('only supported') || message.includes('only available');
174
+ return message.includes('cdp') && message.includes('chromium') && exclusivity;
175
+ }
176
+ /** Errors that must keep their original Playwright diagnostics. */
177
+ export function isPageLifecycleOrTransportError(error) {
178
+ const message = String(error instanceof Error ? error.message : error).toLowerCase();
179
+ return [
180
+ 'page closed',
181
+ 'context closed',
182
+ 'browser closed',
183
+ 'target closed',
184
+ 'websocket',
185
+ 'connection closed',
186
+ 'navigation',
187
+ ].some((marker) => message.includes(marker));
188
+ }
189
+ /** Capture both snapshots through the provisioned runtime. */
190
+ export async function captureSnapshotsWithRuntimeAsset(page) {
191
+ const source = loadRuntimeSnapshotAsset();
192
+ log.helper('[snapshot] capturing via provisioned runtime asset (non-CDP engine)');
193
+ let result;
194
+ try {
195
+ result = await page.evaluate(buildRuntimeSnapshotExpression(source));
196
+ }
197
+ catch (err) {
198
+ if (isPageLifecycleOrTransportError(err))
199
+ throw err;
200
+ throw new Error(INVALID_RUNTIME_SNAPSHOT_ERROR);
201
+ }
202
+ return validateRuntimeSnapshotPair(result);
203
+ }
204
+ //# sourceMappingURL=runtimeSnapshot.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtimeSnapshot.js","sourceRoot":"","sources":["../../../src/v3/helpers/runtimeSnapshot.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAEnC,MAAM,gBAAgB,GAAG,8CAA8C,CAAC;AACxE,MAAM,gBAAgB,GAAG,+CAA+C,CAAC;AACzE,MAAM,kBAAkB,GAAG,oCAAoC,CAAC;AAEhE;;;;GAIG;AACH,MAAM,eAAe,GAAG;IACtB,gBAAgB;IAChB,uBAAuB;IACvB,oBAAoB;IACpB,mBAAmB;IACnB,mBAAmB;IACnB,eAAe;IACf,kBAAkB;IAClB,0BAA0B;IAC1B,kBAAkB;IAClB,mBAAmB;IACnB,4BAA4B;CACpB,CAAC;AAEX,MAAM,CAAC,MAAM,2BAA2B,GAAG,6CAA6C,CAAC;AACzF,MAAM,CAAC,MAAM,8BAA8B,GA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AC,CAAC;IACvE,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,IAAI,+BAA+B,CAAC,GAAG,CAAC;YAAE,MAAM,GAAG,CAAC;QACpD,MAAM,IAAI,KAAK,CAAC,8BAA8B,CAAC,CAAC;IAClD,CAAC;IACD,OAAO,2BAA2B,CAAC,MAAM,CAAC,CAAC;AAC7C,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schemaAssertion.d.ts","sourceRoot":"","sources":["../../../src/v3/helpers/schemaAssertion.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAOvC,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,MAAM,WAAW,qBAAqB;IACpC,MAAM,EAAE,QAAQ,GAAG,QAAQ,CAAC;IAC5B,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAqED,wBAAsB,qBAAqB,CACzC,IAAI,EAAE,IAAI,EACV,WAAW,EAAE,MAAM,EACnB,IAAI,GAAE,sBAA2B,GAChC,OAAO,CAAC,qBAAqB,CAAC,CAoDhC"}
@@ -0,0 +1,117 @@
1
+ import { Ajv2020 } from 'ajv/dist/2020.js';
2
+ import { fetchWithAuth } from '../http.js';
3
+ import { resolveVar } from '../vars.js';
4
+ import { log, preview } from '../../log.js';
5
+ import { AssertionFailureError } from '../../errors.js';
6
+ function coerceSchema(content) {
7
+ if (typeof content === 'string')
8
+ return JSON.parse(content);
9
+ return content;
10
+ }
11
+ async function resolveSchema(schemaId) {
12
+ try {
13
+ const base = (process.env['ATMS_URL'] ?? 'https://test-manager-api.lambdatest.com').replace(/\/$/, '');
14
+ const url = `${base}/api/v1/schema/${encodeURIComponent(schemaId)}?form=canonical`;
15
+ const resp = await fetchWithAuth(url, { method: 'GET' });
16
+ if (resp.ok) {
17
+ const body = (await resp.json());
18
+ const content = body?.data?.canonical_content;
19
+ if (content !== undefined && content !== null)
20
+ return coerceSchema(content);
21
+ }
22
+ else {
23
+ log.helper(`[schema_assertion] schema ${schemaId} live fetch failed: ${resp.status}`);
24
+ }
25
+ }
26
+ catch (e) {
27
+ log.helper(`[schema_assertion] schema ${schemaId} live fetch error: ${String(e)}`);
28
+ }
29
+ throw new Error(`Schema '${schemaId}' could not be fetched from ATMS at runtime`);
30
+ }
31
+ function foldHeaderList(entries) {
32
+ const folded = {};
33
+ for (const item of entries) {
34
+ let pairs;
35
+ if (typeof item === 'object' && item !== null && !Array.isArray(item)) {
36
+ pairs = Object.entries(item);
37
+ }
38
+ else if (typeof item === 'string' && item.includes('=')) {
39
+ const first = item.split(';', 1)[0] ?? '';
40
+ const eq = first.indexOf('=');
41
+ pairs = [[first.slice(0, eq).trim(), first.slice(eq + 1).trim()]];
42
+ }
43
+ else {
44
+ continue;
45
+ }
46
+ for (const [k, v] of pairs) {
47
+ const key = k.toLowerCase();
48
+ folded[key] = key in folded ? `${String(folded[key])}, ${String(v)}` : v;
49
+ }
50
+ }
51
+ return folded;
52
+ }
53
+ function normalizeEnvelopeForSchema(instance) {
54
+ if (typeof instance !== 'object' || instance === null || Array.isArray(instance))
55
+ return instance;
56
+ const env = instance;
57
+ if (!('status' in env) || !('headers' in env))
58
+ return instance;
59
+ const out = { ...env };
60
+ let changed = false;
61
+ for (const key of ['headers', 'cookies']) {
62
+ if (Array.isArray(out[key])) {
63
+ out[key] = foldHeaderList(out[key]);
64
+ changed = true;
65
+ }
66
+ }
67
+ if ('response_body' in out && out['response_body'] !== null && out['response_body'] !== undefined
68
+ && out['body'] !== out['response_body']) {
69
+ out['body'] = out['response_body'];
70
+ changed = true;
71
+ }
72
+ return changed ? out : instance;
73
+ }
74
+ export async function verifySchemaAssertion(page, description, opts = {}) {
75
+ const schemaId = opts.schemaId ?? '';
76
+ const sourceVariable = opts.sourceVariable ?? '';
77
+ const failureCondition = opts.failureCondition ?? 'hard_fail';
78
+ log.helper(`[schema_assertion] ${preview(description)} schema_id=${schemaId} `
79
+ + `source=${sourceVariable} failure=${failureCondition}`);
80
+ const template = sourceVariable.includes('{{') || sourceVariable.includes('${')
81
+ ? sourceVariable
82
+ : `{{${sourceVariable}}}`;
83
+ let instance = await resolveVar(template);
84
+ if (typeof instance === 'string') {
85
+ try {
86
+ instance = JSON.parse(instance);
87
+ }
88
+ catch { /* a plain non-JSON string is itself a valid JSON string instance */ }
89
+ }
90
+ instance = normalizeEnvelopeForSchema(instance);
91
+ if (instance && typeof instance === 'object' && !Array.isArray(instance)
92
+ && 'status' in instance && 'headers' in instance
93
+ && ('response_body' in instance
94
+ || 'body' in instance)) {
95
+ const env = instance;
96
+ instance = 'response_body' in env ? env['response_body'] : env['body'];
97
+ }
98
+ const schema = await resolveSchema(schemaId);
99
+ const ajv = new Ajv2020({ allErrors: true, strict: false });
100
+ const validate = ajv.compile(schema);
101
+ const valid = validate(instance);
102
+ if (valid) {
103
+ log.helper(`[schema_assertion] result status=passed`);
104
+ return { status: 'passed' };
105
+ }
106
+ const reason = (validate.errors ?? [])
107
+ .map((e) => `${e.instancePath || '<root>'}: ${e.message}`)
108
+ .join('; ');
109
+ const result = { status: 'failed', reason };
110
+ log.helper(`[schema_assertion] result status=failed reason=${reason.slice(0, 200)}`);
111
+ if (process.env.TESTMU_SKIP_ASSERTION_FAILURE) {
112
+ log.test(`[ASSERTION WARN] ${description} — Ignoring assertion failure: ${JSON.stringify(result)}`);
113
+ return result;
114
+ }
115
+ throw new AssertionFailureError(`Schema assertion failed: ${description}`, result);
116
+ }
117
+ //# sourceMappingURL=schemaAssertion.js.map