@testmuai/playwright-bindings 0.1.44 → 0.1.45
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.
- package/README.md +28 -0
- package/dist/configure.d.ts +8 -0
- package/dist/configure.d.ts.map +1 -1
- package/dist/configure.js +15 -0
- package/dist/configure.js.map +1 -1
- package/dist/errors.d.ts +6 -0
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +9 -0
- package/dist/errors.js.map +1 -1
- package/dist/index.d.ts +87 -100
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +71 -37
- package/dist/index.js.map +1 -1
- package/dist/router.d.ts +53 -0
- package/dist/router.d.ts.map +1 -0
- package/dist/router.js +137 -0
- package/dist/router.js.map +1 -0
- package/dist/v3/actionEngine.d.ts.map +1 -0
- package/dist/v3/actionEngine.js +194 -0
- package/dist/v3/actionEngine.js.map +1 -0
- package/dist/v3/actionSpecs.d.ts.map +1 -0
- package/dist/v3/actionSpecs.js +354 -0
- package/dist/v3/actionSpecs.js.map +1 -0
- package/dist/v3/capability.d.ts.map +1 -0
- package/dist/v3/capability.js +346 -0
- package/dist/v3/capability.js.map +1 -0
- package/dist/v3/downloadsPath.d.ts.map +1 -0
- package/dist/v3/downloadsPath.js.map +1 -0
- package/dist/v3/healCache.d.ts.map +1 -0
- package/dist/v3/healCache.js.map +1 -0
- package/dist/v3/healPatch.d.ts +22 -0
- package/dist/v3/healPatch.d.ts.map +1 -0
- package/dist/v3/healPatch.js +345 -0
- package/dist/v3/healPatch.js.map +1 -0
- package/dist/v3/helpers/a11yFlatten.d.ts.map +1 -0
- package/dist/v3/helpers/a11yFlatten.js +569 -0
- package/dist/v3/helpers/a11yFlatten.js.map +1 -0
- package/dist/v3/helpers/apiCalls.d.ts.map +1 -0
- package/dist/v3/helpers/apiCalls.js +59 -0
- package/dist/v3/helpers/apiCalls.js.map +1 -0
- package/dist/v3/helpers/assertion.d.ts.map +1 -0
- package/dist/v3/helpers/assertion.js +105 -0
- package/dist/v3/helpers/assertion.js.map +1 -0
- package/dist/v3/helpers/assertionV3.d.ts +91 -0
- package/dist/v3/helpers/assertionV3.d.ts.map +1 -0
- package/dist/v3/helpers/assertionV3.js +556 -0
- package/dist/v3/helpers/assertionV3.js.map +1 -0
- package/dist/v3/helpers/autohealAx.d.ts.map +1 -0
- package/dist/v3/helpers/autohealAx.js +148 -0
- package/dist/v3/helpers/autohealAx.js.map +1 -0
- package/dist/v3/helpers/axTree/actionable.d.ts.map +1 -0
- package/dist/v3/helpers/axTree/actionable.js +404 -0
- package/dist/v3/helpers/axTree/actionable.js.map +1 -0
- package/dist/v3/helpers/axTree/captureAxTree.d.ts.map +1 -0
- package/dist/v3/helpers/axTree/captureAxTree.js.map +1 -0
- package/dist/v3/helpers/axTree/captureFrameForest.d.ts.map +1 -0
- package/dist/v3/helpers/axTree/captureFrameForest.js +475 -0
- package/dist/v3/helpers/axTree/captureFrameForest.js.map +1 -0
- package/dist/v3/helpers/axTree/index.d.ts.map +1 -0
- package/dist/v3/helpers/axTree/index.js.map +1 -0
- package/dist/v3/helpers/axTree/serializeAxTree.d.ts.map +1 -0
- package/dist/v3/helpers/axTree/serializeAxTree.js.map +1 -0
- package/dist/v3/helpers/clipboard-intercept.d.ts.map +1 -0
- package/dist/v3/helpers/clipboard-intercept.js.map +1 -0
- package/dist/v3/helpers/clipboard.d.ts.map +1 -0
- package/dist/v3/helpers/clipboard.js.map +1 -0
- package/dist/v3/helpers/condition.d.ts +100 -0
- package/dist/v3/helpers/condition.d.ts.map +1 -0
- package/dist/v3/helpers/condition.js +365 -0
- package/dist/v3/helpers/condition.js.map +1 -0
- package/dist/v3/helpers/cookies.d.ts.map +1 -0
- package/dist/v3/helpers/cookies.js +66 -0
- package/dist/v3/helpers/cookies.js.map +1 -0
- package/dist/v3/helpers/coordinateResolver.d.ts.map +1 -0
- package/dist/v3/helpers/coordinateResolver.js +118 -0
- package/dist/v3/helpers/coordinateResolver.js.map +1 -0
- package/dist/v3/helpers/coordinateResolverRead.d.ts.map +1 -0
- package/dist/v3/helpers/coordinateResolverRead.js +107 -0
- package/dist/v3/helpers/coordinateResolverRead.js.map +1 -0
- package/dist/v3/helpers/credits.d.ts.map +1 -0
- package/dist/v3/helpers/credits.js +52 -0
- package/dist/v3/helpers/credits.js.map +1 -0
- package/dist/v3/helpers/derive.d.ts.map +1 -0
- package/dist/v3/helpers/derive.js +87 -0
- package/dist/v3/helpers/derive.js.map +1 -0
- package/dist/v3/helpers/devtools.d.ts.map +1 -0
- package/dist/v3/helpers/devtools.js +1215 -0
- package/dist/v3/helpers/devtools.js.map +1 -0
- package/dist/v3/helpers/dialog.d.ts.map +1 -0
- package/dist/v3/helpers/dialog.js.map +1 -0
- package/dist/v3/helpers/drag.d.ts.map +1 -0
- package/dist/v3/helpers/drag.js +276 -0
- package/dist/v3/helpers/drag.js.map +1 -0
- package/dist/v3/helpers/evaluation/colors.d.ts.map +1 -0
- package/dist/v3/helpers/evaluation/colors.js.map +1 -0
- package/dist/v3/helpers/evaluation/evaluate.d.ts.map +1 -0
- package/dist/v3/helpers/evaluation/evaluate.js.map +1 -0
- package/dist/v3/helpers/executeApi.d.ts.map +1 -0
- package/dist/v3/helpers/executeApi.js +393 -0
- package/dist/v3/helpers/executeApi.js.map +1 -0
- package/dist/v3/helpers/executeDb.d.ts.map +1 -0
- package/dist/v3/helpers/executeDb.js +54 -0
- package/dist/v3/helpers/executeDb.js.map +1 -0
- package/dist/v3/helpers/executeJs.d.ts.map +1 -0
- package/dist/v3/helpers/executeJs.js +93 -0
- package/dist/v3/helpers/executeJs.js.map +1 -0
- package/dist/v3/helpers/gesture.d.ts.map +1 -0
- package/dist/v3/helpers/gesture.js +131 -0
- package/dist/v3/helpers/gesture.js.map +1 -0
- package/dist/v3/helpers/healCascade.d.ts.map +1 -0
- package/dist/v3/helpers/healCascade.js +431 -0
- package/dist/v3/helpers/healCascade.js.map +1 -0
- package/dist/v3/helpers/iframeA11y.d.ts.map +1 -0
- package/dist/v3/helpers/iframeA11y.js +128 -0
- package/dist/v3/helpers/iframeA11y.js.map +1 -0
- package/dist/v3/helpers/kaneCli.d.ts.map +1 -0
- package/dist/v3/helpers/kaneCli.js +319 -0
- package/dist/v3/helpers/kaneCli.js.map +1 -0
- package/dist/v3/helpers/loop.d.ts +4 -0
- package/dist/v3/helpers/loop.d.ts.map +1 -0
- package/dist/v3/helpers/loop.js +4 -0
- package/dist/v3/helpers/loop.js.map +1 -0
- package/dist/v3/helpers/math.d.ts.map +1 -0
- package/dist/v3/helpers/math.js +119 -0
- package/dist/v3/helpers/math.js.map +1 -0
- package/dist/v3/helpers/network.d.ts.map +1 -0
- package/dist/v3/helpers/network.js +185 -0
- package/dist/v3/helpers/network.js.map +1 -0
- package/dist/v3/helpers/pageReady.d.ts.map +1 -0
- package/dist/v3/helpers/pageReady.js +85 -0
- package/dist/v3/helpers/pageReady.js.map +1 -0
- package/dist/v3/helpers/png.d.ts.map +1 -0
- package/dist/v3/helpers/png.js.map +1 -0
- package/dist/v3/helpers/queryResult.d.ts.map +1 -0
- package/dist/v3/helpers/queryResult.js.map +1 -0
- package/dist/v3/helpers/runtimeSnapshot.d.ts.map +1 -0
- package/dist/v3/helpers/runtimeSnapshot.js +204 -0
- package/dist/v3/helpers/runtimeSnapshot.js.map +1 -0
- package/dist/v3/helpers/schemaAssertion.d.ts.map +1 -0
- package/dist/v3/helpers/schemaAssertion.js +117 -0
- package/dist/v3/helpers/schemaAssertion.js.map +1 -0
- package/dist/v3/helpers/screenshot.d.ts +41 -0
- package/dist/v3/helpers/screenshot.d.ts.map +1 -0
- package/dist/v3/helpers/screenshot.js +83 -0
- package/dist/v3/helpers/screenshot.js.map +1 -0
- package/dist/v3/helpers/scrollUntil.d.ts.map +1 -0
- package/dist/v3/helpers/scrollUntil.js +90 -0
- package/dist/v3/helpers/scrollUntil.js.map +1 -0
- package/dist/v3/helpers/smartui.d.ts.map +1 -0
- package/dist/v3/helpers/smartui.js +77 -0
- package/dist/v3/helpers/smartui.js.map +1 -0
- package/dist/v3/helpers/sseParser.d.ts.map +1 -0
- package/dist/v3/helpers/sseParser.js.map +1 -0
- package/dist/v3/helpers/tabs.d.ts +43 -0
- package/dist/v3/helpers/tabs.d.ts.map +1 -0
- package/dist/v3/helpers/tabs.js +272 -0
- package/dist/v3/helpers/tabs.js.map +1 -0
- package/dist/v3/helpers/text.d.ts.map +1 -0
- package/dist/v3/helpers/text.js.map +1 -0
- package/dist/v3/helpers/textNormalize.d.ts.map +1 -0
- package/dist/v3/helpers/textNormalize.js.map +1 -0
- package/dist/v3/helpers/textualAnalyzer/domStructured.d.ts.map +1 -0
- package/dist/v3/helpers/textualAnalyzer/domStructured.js +242 -0
- package/dist/v3/helpers/textualAnalyzer/domStructured.js.map +1 -0
- package/dist/v3/helpers/textualAnalyzer/evaluate.d.ts.map +1 -0
- package/dist/v3/helpers/textualAnalyzer/evaluate.js.map +1 -0
- package/dist/v3/helpers/textualAnalyzer/extractor.d.ts.map +1 -0
- package/dist/v3/helpers/textualAnalyzer/extractor.js.map +1 -0
- package/dist/v3/helpers/textualAnalyzer/heal.d.ts.map +1 -0
- package/dist/v3/helpers/textualAnalyzer/heal.js +120 -0
- package/dist/v3/helpers/textualAnalyzer/heal.js.map +1 -0
- package/dist/v3/helpers/textualAnalyzer/index.d.ts.map +1 -0
- package/dist/v3/helpers/textualAnalyzer/index.js +60 -0
- package/dist/v3/helpers/textualAnalyzer/index.js.map +1 -0
- package/dist/v3/helpers/textualAnalyzer/locatorEnrichment.d.ts.map +1 -0
- package/dist/v3/helpers/textualAnalyzer/locatorEnrichment.js +224 -0
- package/dist/v3/helpers/textualAnalyzer/locatorEnrichment.js.map +1 -0
- package/dist/v3/helpers/textualRead.d.ts.map +1 -0
- package/dist/v3/helpers/textualRead.js.map +1 -0
- package/dist/v3/helpers/vision.d.ts +79 -0
- package/dist/v3/helpers/vision.d.ts.map +1 -0
- package/dist/v3/helpers/vision.js +235 -0
- package/dist/v3/helpers/vision.js.map +1 -0
- package/dist/v3/helpers/visionFence.d.ts.map +1 -0
- package/dist/v3/helpers/visionFence.js.map +1 -0
- package/dist/v3/helpers/visionV3.d.ts +52 -0
- package/dist/v3/helpers/visionV3.d.ts.map +1 -0
- package/dist/v3/helpers/visionV3.js +366 -0
- package/dist/v3/helpers/visionV3.js.map +1 -0
- package/dist/v3/helpers/wait.d.ts.map +1 -0
- package/dist/v3/helpers/wait.js +48 -0
- package/dist/v3/helpers/wait.js.map +1 -0
- package/dist/v3/http.d.ts.map +1 -0
- package/dist/v3/http.js +45 -0
- package/dist/v3/http.js.map +1 -0
- package/dist/v3/httpClient.d.ts.map +1 -0
- package/dist/v3/httpClient.js.map +1 -0
- package/dist/v3/index.d.ts +40 -0
- package/dist/v3/index.d.ts.map +1 -0
- package/dist/v3/index.js +41 -0
- package/dist/v3/index.js.map +1 -0
- package/dist/v3/rankedLocator.d.ts.map +1 -0
- package/dist/v3/rankedLocator.js +85 -0
- package/dist/v3/rankedLocator.js.map +1 -0
- package/dist/v3/relayProxy.d.ts.map +1 -0
- package/dist/v3/relayProxy.js +485 -0
- package/dist/v3/relayProxy.js.map +1 -0
- package/dist/v3/reporters/index.d.ts.map +1 -0
- package/dist/v3/reporters/index.js +7 -0
- package/dist/v3/reporters/index.js.map +1 -0
- package/dist/v3/reporters/local.d.ts.map +1 -0
- package/dist/v3/reporters/local.js +40 -0
- package/dist/v3/reporters/local.js.map +1 -0
- package/dist/v3/reporters/lt.d.ts.map +1 -0
- package/dist/v3/reporters/lt.js +122 -0
- package/dist/v3/reporters/lt.js.map +1 -0
- package/dist/v3/reporters/null.d.ts.map +1 -0
- package/dist/v3/reporters/null.js.map +1 -0
- package/dist/v3/routeFailure.d.ts.map +1 -0
- package/dist/v3/routeFailure.js +34 -0
- package/dist/v3/routeFailure.js.map +1 -0
- package/dist/v3/session.d.ts.map +1 -0
- package/dist/v3/session.js +312 -0
- package/dist/v3/session.js.map +1 -0
- package/dist/v3/step.d.ts +64 -0
- package/dist/v3/step.d.ts.map +1 -0
- package/dist/v3/step.js +166 -0
- package/dist/v3/step.js.map +1 -0
- package/dist/v3/stepVariables.d.ts.map +1 -0
- package/dist/v3/stepVariables.js +61 -0
- package/dist/v3/stepVariables.js.map +1 -0
- package/dist/v3/test.d.ts.map +1 -0
- package/dist/v3/test.js.map +1 -0
- package/dist/v3/testConfig.d.ts.map +1 -0
- package/dist/v3/testConfig.js.map +1 -0
- package/dist/v3/testState.d.ts.map +1 -0
- package/dist/v3/testState.js.map +1 -0
- package/dist/v3/vars.d.ts +87 -0
- package/dist/v3/vars.d.ts.map +1 -0
- package/dist/v3/vars.js +939 -0
- package/dist/v3/vars.js.map +1 -0
- package/dist/v3/visionLocator.d.ts.map +1 -0
- package/dist/v3/visionLocator.js +117 -0
- package/dist/v3/visionLocator.js.map +1 -0
- package/dist/v4/actionEngine.d.ts +37 -0
- package/dist/v4/actionEngine.d.ts.map +1 -0
- package/dist/v4/actionEngine.js +194 -0
- package/dist/v4/actionEngine.js.map +1 -0
- package/dist/v4/actionSpecs.d.ts +35 -0
- package/dist/v4/actionSpecs.d.ts.map +1 -0
- package/dist/v4/actionSpecs.js +354 -0
- package/dist/v4/actionSpecs.js.map +1 -0
- package/dist/v4/capability.d.ts +81 -0
- package/dist/v4/capability.d.ts.map +1 -0
- package/dist/v4/capability.js +346 -0
- package/dist/v4/capability.js.map +1 -0
- package/dist/v4/downloadsPath.d.ts +17 -0
- package/dist/v4/downloadsPath.d.ts.map +1 -0
- package/dist/v4/downloadsPath.js +26 -0
- package/dist/v4/downloadsPath.js.map +1 -0
- package/dist/v4/healCache.d.ts +28 -0
- package/dist/v4/healCache.d.ts.map +1 -0
- package/dist/v4/healCache.js +17 -0
- package/dist/v4/healCache.js.map +1 -0
- package/dist/v4/healPatch.d.ts +22 -0
- package/dist/v4/healPatch.d.ts.map +1 -0
- package/dist/v4/healPatch.js +415 -0
- package/dist/v4/healPatch.js.map +1 -0
- package/dist/v4/helpers/a11yFlatten.d.ts +37 -0
- package/dist/v4/helpers/a11yFlatten.d.ts.map +1 -0
- package/dist/v4/helpers/a11yFlatten.js +569 -0
- package/dist/v4/helpers/a11yFlatten.js.map +1 -0
- package/dist/v4/helpers/apiCalls.d.ts +26 -0
- package/dist/v4/helpers/apiCalls.d.ts.map +1 -0
- package/dist/v4/helpers/apiCalls.js +59 -0
- package/dist/v4/helpers/apiCalls.js.map +1 -0
- package/dist/v4/helpers/assertion.d.ts +26 -0
- package/dist/v4/helpers/assertion.d.ts.map +1 -0
- package/dist/v4/helpers/assertion.js +134 -0
- package/dist/v4/helpers/assertion.js.map +1 -0
- package/dist/v4/helpers/assertionV3.d.ts.map +1 -0
- package/dist/v4/helpers/assertionV3.js.map +1 -0
- package/dist/v4/helpers/autohealAx.d.ts +41 -0
- package/dist/v4/helpers/autohealAx.d.ts.map +1 -0
- package/dist/v4/helpers/autohealAx.js +148 -0
- package/dist/v4/helpers/autohealAx.js.map +1 -0
- package/dist/v4/helpers/axTree/actionable.d.ts +143 -0
- package/dist/v4/helpers/axTree/actionable.d.ts.map +1 -0
- package/dist/v4/helpers/axTree/actionable.js +404 -0
- package/dist/v4/helpers/axTree/actionable.js.map +1 -0
- package/dist/v4/helpers/axTree/captureAxTree.d.ts +21 -0
- package/dist/v4/helpers/axTree/captureAxTree.d.ts.map +1 -0
- package/dist/v4/helpers/axTree/captureAxTree.js +15 -0
- package/dist/v4/helpers/axTree/captureAxTree.js.map +1 -0
- package/dist/v4/helpers/axTree/captureFrameForest.d.ts +52 -0
- package/dist/v4/helpers/axTree/captureFrameForest.d.ts.map +1 -0
- package/dist/v4/helpers/axTree/captureFrameForest.js +475 -0
- package/dist/v4/helpers/axTree/captureFrameForest.js.map +1 -0
- package/dist/v4/helpers/axTree/index.d.ts +10 -0
- package/dist/v4/helpers/axTree/index.d.ts.map +1 -0
- package/dist/v4/helpers/axTree/index.js +8 -0
- package/dist/v4/helpers/axTree/index.js.map +1 -0
- package/dist/v4/helpers/axTree/serializeAxTree.d.ts +106 -0
- package/dist/v4/helpers/axTree/serializeAxTree.d.ts.map +1 -0
- package/dist/v4/helpers/axTree/serializeAxTree.js +238 -0
- package/dist/v4/helpers/axTree/serializeAxTree.js.map +1 -0
- package/dist/v4/helpers/clipboard-intercept.d.ts +5 -0
- package/dist/v4/helpers/clipboard-intercept.d.ts.map +1 -0
- package/dist/v4/helpers/clipboard-intercept.js +149 -0
- package/dist/v4/helpers/clipboard-intercept.js.map +1 -0
- package/dist/v4/helpers/clipboard.d.ts +27 -0
- package/dist/v4/helpers/clipboard.d.ts.map +1 -0
- package/dist/v4/helpers/clipboard.js +70 -0
- package/dist/v4/helpers/clipboard.js.map +1 -0
- package/dist/v4/helpers/condition.d.ts +100 -0
- package/dist/v4/helpers/condition.d.ts.map +1 -0
- package/dist/v4/helpers/condition.js +356 -0
- package/dist/v4/helpers/condition.js.map +1 -0
- package/dist/v4/helpers/cookies.d.ts +12 -0
- package/dist/v4/helpers/cookies.d.ts.map +1 -0
- package/dist/v4/helpers/cookies.js +66 -0
- package/dist/v4/helpers/cookies.js.map +1 -0
- package/dist/v4/helpers/coordinateResolver.d.ts +29 -0
- package/dist/v4/helpers/coordinateResolver.d.ts.map +1 -0
- package/dist/v4/helpers/coordinateResolver.js +118 -0
- package/dist/v4/helpers/coordinateResolver.js.map +1 -0
- package/dist/v4/helpers/credits.d.ts +19 -0
- package/dist/v4/helpers/credits.d.ts.map +1 -0
- package/dist/v4/helpers/credits.js +52 -0
- package/dist/v4/helpers/credits.js.map +1 -0
- package/dist/v4/helpers/derive.d.ts +27 -0
- package/dist/v4/helpers/derive.d.ts.map +1 -0
- package/dist/v4/helpers/derive.js +87 -0
- package/dist/v4/helpers/derive.js.map +1 -0
- package/dist/v4/helpers/devtools.d.ts +39 -0
- package/dist/v4/helpers/devtools.d.ts.map +1 -0
- package/dist/v4/helpers/devtools.js +1215 -0
- package/dist/v4/helpers/devtools.js.map +1 -0
- package/dist/v4/helpers/dialog.d.ts +29 -0
- package/dist/v4/helpers/dialog.d.ts.map +1 -0
- package/dist/v4/helpers/dialog.js +35 -0
- package/dist/v4/helpers/dialog.js.map +1 -0
- package/dist/v4/helpers/drag.d.ts +38 -0
- package/dist/v4/helpers/drag.d.ts.map +1 -0
- package/dist/v4/helpers/drag.js +245 -0
- package/dist/v4/helpers/drag.js.map +1 -0
- package/dist/v4/helpers/evaluation/colors.d.ts +2 -0
- package/dist/v4/helpers/evaluation/colors.d.ts.map +1 -0
- package/dist/v4/helpers/evaluation/colors.js +151 -0
- package/dist/v4/helpers/evaluation/colors.js.map +1 -0
- package/dist/v4/helpers/evaluation/evaluate.d.ts +10 -0
- package/dist/v4/helpers/evaluation/evaluate.d.ts.map +1 -0
- package/dist/v4/helpers/evaluation/evaluate.js +423 -0
- package/dist/v4/helpers/evaluation/evaluate.js.map +1 -0
- package/dist/v4/helpers/executeApi.d.ts +63 -0
- package/dist/v4/helpers/executeApi.d.ts.map +1 -0
- package/dist/v4/helpers/executeApi.js +363 -0
- package/dist/v4/helpers/executeApi.js.map +1 -0
- package/dist/v4/helpers/executeDb.d.ts +11 -0
- package/dist/v4/helpers/executeDb.d.ts.map +1 -0
- package/dist/v4/helpers/executeDb.js +54 -0
- package/dist/v4/helpers/executeDb.js.map +1 -0
- package/dist/v4/helpers/executeJs.d.ts +16 -0
- package/dist/v4/helpers/executeJs.d.ts.map +1 -0
- package/dist/v4/helpers/executeJs.js +86 -0
- package/dist/v4/helpers/executeJs.js.map +1 -0
- package/dist/v4/helpers/gesture.d.ts +45 -0
- package/dist/v4/helpers/gesture.d.ts.map +1 -0
- package/dist/v4/helpers/gesture.js +131 -0
- package/dist/v4/helpers/gesture.js.map +1 -0
- package/dist/v4/helpers/healCascade.d.ts +39 -0
- package/dist/v4/helpers/healCascade.d.ts.map +1 -0
- package/dist/v4/helpers/healCascade.js +418 -0
- package/dist/v4/helpers/healCascade.js.map +1 -0
- package/dist/v4/helpers/kaneCli.d.ts +18 -0
- package/dist/v4/helpers/kaneCli.d.ts.map +1 -0
- package/dist/v4/helpers/kaneCli.js +319 -0
- package/dist/v4/helpers/kaneCli.js.map +1 -0
- package/dist/v4/helpers/loop.d.ts +4 -0
- package/dist/v4/helpers/loop.d.ts.map +1 -0
- package/dist/v4/helpers/loop.js +4 -0
- package/dist/v4/helpers/loop.js.map +1 -0
- package/dist/v4/helpers/math.d.ts +19 -0
- package/dist/v4/helpers/math.d.ts.map +1 -0
- package/dist/v4/helpers/math.js +117 -0
- package/dist/v4/helpers/math.js.map +1 -0
- package/dist/v4/helpers/network.d.ts +27 -0
- package/dist/v4/helpers/network.d.ts.map +1 -0
- package/dist/v4/helpers/network.js +185 -0
- package/dist/v4/helpers/network.js.map +1 -0
- package/dist/v4/helpers/pageReady.d.ts +27 -0
- package/dist/v4/helpers/pageReady.d.ts.map +1 -0
- package/dist/v4/helpers/pageReady.js +69 -0
- package/dist/v4/helpers/pageReady.js.map +1 -0
- package/dist/v4/helpers/png.d.ts +3 -0
- package/dist/v4/helpers/png.d.ts.map +1 -0
- package/dist/v4/helpers/png.js +18 -0
- package/dist/v4/helpers/png.js.map +1 -0
- package/dist/v4/helpers/queryResult.d.ts +13 -0
- package/dist/v4/helpers/queryResult.d.ts.map +1 -0
- package/dist/v4/helpers/queryResult.js +27 -0
- package/dist/v4/helpers/queryResult.js.map +1 -0
- package/dist/v4/helpers/runtimeSnapshot.d.ts +37 -0
- package/dist/v4/helpers/runtimeSnapshot.d.ts.map +1 -0
- package/dist/v4/helpers/runtimeSnapshot.js +101 -0
- package/dist/v4/helpers/runtimeSnapshot.js.map +1 -0
- package/dist/v4/helpers/schemaAssertion.d.ts +12 -0
- package/dist/v4/helpers/schemaAssertion.d.ts.map +1 -0
- package/dist/v4/helpers/schemaAssertion.js +117 -0
- package/dist/v4/helpers/schemaAssertion.js.map +1 -0
- package/dist/v4/helpers/screenshot.d.ts +40 -0
- package/dist/v4/helpers/screenshot.d.ts.map +1 -0
- package/dist/v4/helpers/screenshot.js +82 -0
- package/dist/v4/helpers/screenshot.js.map +1 -0
- package/dist/v4/helpers/scrollUntil.d.ts +13 -0
- package/dist/v4/helpers/scrollUntil.d.ts.map +1 -0
- package/dist/v4/helpers/scrollUntil.js +90 -0
- package/dist/v4/helpers/scrollUntil.js.map +1 -0
- package/dist/v4/helpers/smartui.d.ts +9 -0
- package/dist/v4/helpers/smartui.d.ts.map +1 -0
- package/dist/v4/helpers/smartui.js +77 -0
- package/dist/v4/helpers/smartui.js.map +1 -0
- package/dist/v4/helpers/sseParser.d.ts +34 -0
- package/dist/v4/helpers/sseParser.d.ts.map +1 -0
- package/dist/v4/helpers/sseParser.js +128 -0
- package/dist/v4/helpers/sseParser.js.map +1 -0
- package/dist/v4/helpers/tabs.d.ts +32 -0
- package/dist/v4/helpers/tabs.d.ts.map +1 -0
- package/dist/v4/helpers/tabs.js +89 -0
- package/dist/v4/helpers/tabs.js.map +1 -0
- package/dist/v4/helpers/text.d.ts +15 -0
- package/dist/v4/helpers/text.d.ts.map +1 -0
- package/dist/v4/helpers/text.js +24 -0
- package/dist/v4/helpers/text.js.map +1 -0
- package/dist/v4/helpers/textNormalize.d.ts +18 -0
- package/dist/v4/helpers/textNormalize.d.ts.map +1 -0
- package/dist/v4/helpers/textNormalize.js +39 -0
- package/dist/v4/helpers/textNormalize.js.map +1 -0
- package/dist/v4/helpers/textualAnalyzer/domStructured.d.ts +44 -0
- package/dist/v4/helpers/textualAnalyzer/domStructured.d.ts.map +1 -0
- package/dist/v4/helpers/textualAnalyzer/domStructured.js +242 -0
- package/dist/v4/helpers/textualAnalyzer/domStructured.js.map +1 -0
- package/dist/v4/helpers/textualAnalyzer/evaluate.d.ts +14 -0
- package/dist/v4/helpers/textualAnalyzer/evaluate.d.ts.map +1 -0
- package/dist/v4/helpers/textualAnalyzer/evaluate.js +5 -0
- package/dist/v4/helpers/textualAnalyzer/evaluate.js.map +1 -0
- package/dist/v4/helpers/textualAnalyzer/extractor.d.ts +21 -0
- package/dist/v4/helpers/textualAnalyzer/extractor.d.ts.map +1 -0
- package/dist/v4/helpers/textualAnalyzer/extractor.js +38 -0
- package/dist/v4/helpers/textualAnalyzer/extractor.js.map +1 -0
- package/dist/v4/helpers/textualAnalyzer/heal.d.ts +25 -0
- package/dist/v4/helpers/textualAnalyzer/heal.d.ts.map +1 -0
- package/dist/v4/helpers/textualAnalyzer/heal.js +120 -0
- package/dist/v4/helpers/textualAnalyzer/heal.js.map +1 -0
- package/dist/v4/helpers/textualAnalyzer/index.d.ts +29 -0
- package/dist/v4/helpers/textualAnalyzer/index.d.ts.map +1 -0
- package/dist/v4/helpers/textualAnalyzer/index.js +60 -0
- package/dist/v4/helpers/textualAnalyzer/index.js.map +1 -0
- package/dist/v4/helpers/textualAnalyzer/locatorEnrichment.d.ts +47 -0
- package/dist/v4/helpers/textualAnalyzer/locatorEnrichment.d.ts.map +1 -0
- package/dist/v4/helpers/textualAnalyzer/locatorEnrichment.js +224 -0
- package/dist/v4/helpers/textualAnalyzer/locatorEnrichment.js.map +1 -0
- package/dist/v4/helpers/vision.d.ts.map +1 -0
- package/dist/v4/helpers/vision.js +487 -0
- package/dist/v4/helpers/vision.js.map +1 -0
- package/dist/v4/helpers/wait.d.ts +16 -0
- package/dist/v4/helpers/wait.d.ts.map +1 -0
- package/dist/v4/helpers/wait.js +48 -0
- package/dist/v4/helpers/wait.js.map +1 -0
- package/dist/v4/http.d.ts +14 -0
- package/dist/v4/http.d.ts.map +1 -0
- package/dist/v4/http.js +45 -0
- package/dist/v4/http.js.map +1 -0
- package/dist/v4/httpClient.d.ts +18 -0
- package/dist/v4/httpClient.d.ts.map +1 -0
- package/dist/v4/httpClient.js +140 -0
- package/dist/v4/httpClient.js.map +1 -0
- package/dist/v4/index.d.ts +40 -0
- package/dist/v4/index.d.ts.map +1 -0
- package/dist/v4/index.js +41 -0
- package/dist/v4/index.js.map +1 -0
- package/dist/v4/rankedLocator.d.ts +27 -0
- package/dist/v4/rankedLocator.d.ts.map +1 -0
- package/dist/v4/rankedLocator.js +85 -0
- package/dist/v4/rankedLocator.js.map +1 -0
- package/dist/v4/relayProxy.d.ts +46 -0
- package/dist/v4/relayProxy.d.ts.map +1 -0
- package/dist/v4/relayProxy.js +485 -0
- package/dist/v4/relayProxy.js.map +1 -0
- package/dist/v4/reporters/index.d.ts +33 -0
- package/dist/v4/reporters/index.d.ts.map +1 -0
- package/dist/v4/reporters/index.js +7 -0
- package/dist/v4/reporters/index.js.map +1 -0
- package/dist/v4/reporters/local.d.ts +13 -0
- package/dist/v4/reporters/local.d.ts.map +1 -0
- package/dist/v4/reporters/local.js +40 -0
- package/dist/v4/reporters/local.js.map +1 -0
- package/dist/v4/reporters/lt.d.ts +28 -0
- package/dist/v4/reporters/lt.d.ts.map +1 -0
- package/dist/v4/reporters/lt.js +110 -0
- package/dist/v4/reporters/lt.js.map +1 -0
- package/dist/v4/reporters/null.d.ts +11 -0
- package/dist/v4/reporters/null.d.ts.map +1 -0
- package/dist/v4/reporters/null.js +10 -0
- package/dist/v4/reporters/null.js.map +1 -0
- package/dist/v4/routeFailure.d.ts +9 -0
- package/dist/v4/routeFailure.d.ts.map +1 -0
- package/dist/v4/routeFailure.js +34 -0
- package/dist/v4/routeFailure.js.map +1 -0
- package/dist/v4/session.d.ts +22 -0
- package/dist/v4/session.d.ts.map +1 -0
- package/dist/v4/session.js +312 -0
- package/dist/v4/session.js.map +1 -0
- package/dist/v4/step.d.ts +53 -0
- package/dist/v4/step.d.ts.map +1 -0
- package/dist/v4/step.js +95 -0
- package/dist/v4/step.js.map +1 -0
- package/dist/v4/stepVariables.d.ts +15 -0
- package/dist/v4/stepVariables.d.ts.map +1 -0
- package/dist/v4/stepVariables.js +61 -0
- package/dist/v4/stepVariables.js.map +1 -0
- package/dist/v4/test.d.ts +10 -0
- package/dist/v4/test.d.ts.map +1 -0
- package/dist/v4/test.js +5 -0
- package/dist/v4/test.js.map +1 -0
- package/dist/v4/testConfig.d.ts +12 -0
- package/dist/v4/testConfig.d.ts.map +1 -0
- package/dist/v4/testConfig.js +89 -0
- package/dist/v4/testConfig.js.map +1 -0
- package/dist/v4/testState.d.ts +10 -0
- package/dist/v4/testState.d.ts.map +1 -0
- package/dist/v4/testState.js +16 -0
- package/dist/v4/testState.js.map +1 -0
- package/dist/v4/vars.d.ts +84 -0
- package/dist/v4/vars.d.ts.map +1 -0
- package/dist/v4/vars.js +912 -0
- package/dist/v4/vars.js.map +1 -0
- package/dist/v4/visionLocator.d.ts +53 -0
- package/dist/v4/visionLocator.d.ts.map +1 -0
- package/dist/v4/visionLocator.js +117 -0
- package/dist/v4/visionLocator.js.map +1 -0
- package/package.json +1 -1
- package/dist/actionEngine.d.ts.map +0 -1
- package/dist/actionEngine.js +0 -194
- package/dist/actionEngine.js.map +0 -1
- package/dist/actionSpecs.d.ts.map +0 -1
- package/dist/actionSpecs.js +0 -354
- package/dist/actionSpecs.js.map +0 -1
- package/dist/capability.d.ts.map +0 -1
- package/dist/capability.js +0 -346
- package/dist/capability.js.map +0 -1
- package/dist/downloadsPath.d.ts.map +0 -1
- package/dist/downloadsPath.js.map +0 -1
- package/dist/healCache.d.ts.map +0 -1
- package/dist/healCache.js.map +0 -1
- package/dist/healPatch.d.ts +0 -20
- package/dist/healPatch.d.ts.map +0 -1
- package/dist/healPatch.js +0 -429
- package/dist/healPatch.js.map +0 -1
- package/dist/helpers/a11yFlatten.d.ts.map +0 -1
- package/dist/helpers/a11yFlatten.js +0 -569
- package/dist/helpers/a11yFlatten.js.map +0 -1
- package/dist/helpers/apiCalls.d.ts.map +0 -1
- package/dist/helpers/apiCalls.js +0 -59
- package/dist/helpers/apiCalls.js.map +0 -1
- package/dist/helpers/assertion.d.ts.map +0 -1
- package/dist/helpers/assertion.js +0 -152
- package/dist/helpers/assertion.js.map +0 -1
- package/dist/helpers/assertionV3.d.ts.map +0 -1
- package/dist/helpers/assertionV3.js.map +0 -1
- package/dist/helpers/autohealAx.d.ts.map +0 -1
- package/dist/helpers/autohealAx.js +0 -148
- package/dist/helpers/autohealAx.js.map +0 -1
- package/dist/helpers/axTree/actionable.d.ts.map +0 -1
- package/dist/helpers/axTree/actionable.js +0 -404
- package/dist/helpers/axTree/actionable.js.map +0 -1
- package/dist/helpers/axTree/captureAxTree.d.ts.map +0 -1
- package/dist/helpers/axTree/captureAxTree.js.map +0 -1
- package/dist/helpers/axTree/captureFrameForest.d.ts.map +0 -1
- package/dist/helpers/axTree/captureFrameForest.js +0 -475
- package/dist/helpers/axTree/captureFrameForest.js.map +0 -1
- package/dist/helpers/axTree/index.d.ts.map +0 -1
- package/dist/helpers/axTree/index.js.map +0 -1
- package/dist/helpers/axTree/serializeAxTree.d.ts.map +0 -1
- package/dist/helpers/axTree/serializeAxTree.js.map +0 -1
- package/dist/helpers/clipboard-intercept.d.ts.map +0 -1
- package/dist/helpers/clipboard-intercept.js.map +0 -1
- package/dist/helpers/clipboard.d.ts.map +0 -1
- package/dist/helpers/clipboard.js.map +0 -1
- package/dist/helpers/condition.d.ts +0 -100
- package/dist/helpers/condition.d.ts.map +0 -1
- package/dist/helpers/condition.js +0 -357
- package/dist/helpers/condition.js.map +0 -1
- package/dist/helpers/cookies.d.ts.map +0 -1
- package/dist/helpers/cookies.js +0 -66
- package/dist/helpers/cookies.js.map +0 -1
- package/dist/helpers/coordinateResolver.d.ts.map +0 -1
- package/dist/helpers/coordinateResolver.js +0 -118
- package/dist/helpers/coordinateResolver.js.map +0 -1
- package/dist/helpers/coordinateResolverRead.d.ts.map +0 -1
- package/dist/helpers/coordinateResolverRead.js +0 -107
- package/dist/helpers/coordinateResolverRead.js.map +0 -1
- package/dist/helpers/credits.d.ts.map +0 -1
- package/dist/helpers/credits.js +0 -52
- package/dist/helpers/credits.js.map +0 -1
- package/dist/helpers/derive.d.ts.map +0 -1
- package/dist/helpers/derive.js +0 -87
- package/dist/helpers/derive.js.map +0 -1
- package/dist/helpers/devtools.d.ts.map +0 -1
- package/dist/helpers/devtools.js +0 -1215
- package/dist/helpers/devtools.js.map +0 -1
- package/dist/helpers/dialog.d.ts.map +0 -1
- package/dist/helpers/dialog.js.map +0 -1
- package/dist/helpers/drag.d.ts.map +0 -1
- package/dist/helpers/drag.js +0 -276
- package/dist/helpers/drag.js.map +0 -1
- package/dist/helpers/evaluation/colors.d.ts.map +0 -1
- package/dist/helpers/evaluation/colors.js.map +0 -1
- package/dist/helpers/evaluation/evaluate.d.ts.map +0 -1
- package/dist/helpers/evaluation/evaluate.js.map +0 -1
- package/dist/helpers/executeApi.d.ts.map +0 -1
- package/dist/helpers/executeApi.js +0 -377
- package/dist/helpers/executeApi.js.map +0 -1
- package/dist/helpers/executeDb.d.ts.map +0 -1
- package/dist/helpers/executeDb.js +0 -54
- package/dist/helpers/executeDb.js.map +0 -1
- package/dist/helpers/executeJs.d.ts.map +0 -1
- package/dist/helpers/executeJs.js +0 -117
- package/dist/helpers/executeJs.js.map +0 -1
- package/dist/helpers/gesture.d.ts.map +0 -1
- package/dist/helpers/gesture.js +0 -131
- package/dist/helpers/gesture.js.map +0 -1
- package/dist/helpers/healCascade.d.ts.map +0 -1
- package/dist/helpers/healCascade.js +0 -418
- package/dist/helpers/healCascade.js.map +0 -1
- package/dist/helpers/iframeA11y.d.ts.map +0 -1
- package/dist/helpers/iframeA11y.js +0 -128
- package/dist/helpers/iframeA11y.js.map +0 -1
- package/dist/helpers/kaneCli.d.ts.map +0 -1
- package/dist/helpers/kaneCli.js +0 -319
- package/dist/helpers/kaneCli.js.map +0 -1
- package/dist/helpers/loop.d.ts +0 -6
- package/dist/helpers/loop.d.ts.map +0 -1
- package/dist/helpers/loop.js +0 -9
- package/dist/helpers/loop.js.map +0 -1
- package/dist/helpers/math.d.ts.map +0 -1
- package/dist/helpers/math.js +0 -152
- package/dist/helpers/math.js.map +0 -1
- package/dist/helpers/network.d.ts.map +0 -1
- package/dist/helpers/network.js +0 -185
- package/dist/helpers/network.js.map +0 -1
- package/dist/helpers/pageReady.d.ts.map +0 -1
- package/dist/helpers/pageReady.js +0 -85
- package/dist/helpers/pageReady.js.map +0 -1
- package/dist/helpers/png.d.ts.map +0 -1
- package/dist/helpers/png.js.map +0 -1
- package/dist/helpers/queryResult.d.ts.map +0 -1
- package/dist/helpers/queryResult.js.map +0 -1
- package/dist/helpers/runtimeSnapshot.d.ts.map +0 -1
- package/dist/helpers/runtimeSnapshot.js +0 -204
- package/dist/helpers/runtimeSnapshot.js.map +0 -1
- package/dist/helpers/schemaAssertion.d.ts.map +0 -1
- package/dist/helpers/schemaAssertion.js +0 -117
- package/dist/helpers/schemaAssertion.js.map +0 -1
- package/dist/helpers/screenshot.d.ts +0 -45
- package/dist/helpers/screenshot.d.ts.map +0 -1
- package/dist/helpers/screenshot.js +0 -90
- package/dist/helpers/screenshot.js.map +0 -1
- package/dist/helpers/scrollUntil.d.ts.map +0 -1
- package/dist/helpers/scrollUntil.js +0 -90
- package/dist/helpers/scrollUntil.js.map +0 -1
- package/dist/helpers/smartui.d.ts.map +0 -1
- package/dist/helpers/smartui.js +0 -77
- package/dist/helpers/smartui.js.map +0 -1
- package/dist/helpers/sseParser.d.ts.map +0 -1
- package/dist/helpers/sseParser.js.map +0 -1
- package/dist/helpers/tabs.d.ts +0 -44
- package/dist/helpers/tabs.d.ts.map +0 -1
- package/dist/helpers/tabs.js +0 -270
- package/dist/helpers/tabs.js.map +0 -1
- package/dist/helpers/text.d.ts.map +0 -1
- package/dist/helpers/text.js.map +0 -1
- package/dist/helpers/textNormalize.d.ts.map +0 -1
- package/dist/helpers/textNormalize.js.map +0 -1
- package/dist/helpers/textualAnalyzer/domStructured.d.ts.map +0 -1
- package/dist/helpers/textualAnalyzer/domStructured.js +0 -242
- package/dist/helpers/textualAnalyzer/domStructured.js.map +0 -1
- package/dist/helpers/textualAnalyzer/evaluate.d.ts.map +0 -1
- package/dist/helpers/textualAnalyzer/evaluate.js.map +0 -1
- package/dist/helpers/textualAnalyzer/extractor.d.ts.map +0 -1
- package/dist/helpers/textualAnalyzer/extractor.js.map +0 -1
- package/dist/helpers/textualAnalyzer/heal.d.ts.map +0 -1
- package/dist/helpers/textualAnalyzer/heal.js +0 -120
- package/dist/helpers/textualAnalyzer/heal.js.map +0 -1
- package/dist/helpers/textualAnalyzer/index.d.ts.map +0 -1
- package/dist/helpers/textualAnalyzer/index.js +0 -60
- package/dist/helpers/textualAnalyzer/index.js.map +0 -1
- package/dist/helpers/textualAnalyzer/locatorEnrichment.d.ts.map +0 -1
- package/dist/helpers/textualAnalyzer/locatorEnrichment.js +0 -224
- package/dist/helpers/textualAnalyzer/locatorEnrichment.js.map +0 -1
- package/dist/helpers/textualRead.d.ts.map +0 -1
- package/dist/helpers/textualRead.js.map +0 -1
- package/dist/helpers/vision.d.ts.map +0 -1
- package/dist/helpers/vision.js +0 -498
- package/dist/helpers/vision.js.map +0 -1
- package/dist/helpers/visionFence.d.ts.map +0 -1
- package/dist/helpers/visionFence.js.map +0 -1
- package/dist/helpers/visionV3.d.ts +0 -52
- package/dist/helpers/visionV3.d.ts.map +0 -1
- package/dist/helpers/visionV3.js +0 -366
- package/dist/helpers/visionV3.js.map +0 -1
- package/dist/helpers/wait.d.ts.map +0 -1
- package/dist/helpers/wait.js +0 -48
- package/dist/helpers/wait.js.map +0 -1
- package/dist/http.d.ts.map +0 -1
- package/dist/http.js +0 -45
- package/dist/http.js.map +0 -1
- package/dist/httpClient.d.ts.map +0 -1
- package/dist/httpClient.js.map +0 -1
- package/dist/rankedLocator.d.ts.map +0 -1
- package/dist/rankedLocator.js +0 -85
- package/dist/rankedLocator.js.map +0 -1
- package/dist/relayProxy.d.ts.map +0 -1
- package/dist/relayProxy.js +0 -485
- package/dist/relayProxy.js.map +0 -1
- package/dist/reporters/index.d.ts.map +0 -1
- package/dist/reporters/index.js +0 -7
- package/dist/reporters/index.js.map +0 -1
- package/dist/reporters/local.d.ts.map +0 -1
- package/dist/reporters/local.js +0 -40
- package/dist/reporters/local.js.map +0 -1
- package/dist/reporters/lt.d.ts.map +0 -1
- package/dist/reporters/lt.js +0 -127
- package/dist/reporters/lt.js.map +0 -1
- package/dist/reporters/null.d.ts.map +0 -1
- package/dist/reporters/null.js.map +0 -1
- package/dist/routeFailure.d.ts.map +0 -1
- package/dist/routeFailure.js +0 -34
- package/dist/routeFailure.js.map +0 -1
- package/dist/session.d.ts.map +0 -1
- package/dist/session.js +0 -312
- package/dist/session.js.map +0 -1
- package/dist/step.d.ts +0 -61
- package/dist/step.d.ts.map +0 -1
- package/dist/step.js +0 -112
- package/dist/step.js.map +0 -1
- package/dist/stepVariables.d.ts.map +0 -1
- package/dist/stepVariables.js +0 -61
- package/dist/stepVariables.js.map +0 -1
- package/dist/test.d.ts.map +0 -1
- package/dist/test.js.map +0 -1
- package/dist/testConfig.d.ts.map +0 -1
- package/dist/testConfig.js.map +0 -1
- package/dist/testState.d.ts.map +0 -1
- package/dist/testState.js.map +0 -1
- package/dist/vars.d.ts +0 -78
- package/dist/vars.d.ts.map +0 -1
- package/dist/vars.js +0 -912
- package/dist/vars.js.map +0 -1
- package/dist/visionLocator.d.ts.map +0 -1
- package/dist/visionLocator.js +0 -117
- package/dist/visionLocator.js.map +0 -1
- /package/dist/{actionEngine.d.ts → v3/actionEngine.d.ts} +0 -0
- /package/dist/{actionSpecs.d.ts → v3/actionSpecs.d.ts} +0 -0
- /package/dist/{capability.d.ts → v3/capability.d.ts} +0 -0
- /package/dist/{downloadsPath.d.ts → v3/downloadsPath.d.ts} +0 -0
- /package/dist/{downloadsPath.js → v3/downloadsPath.js} +0 -0
- /package/dist/{healCache.d.ts → v3/healCache.d.ts} +0 -0
- /package/dist/{healCache.js → v3/healCache.js} +0 -0
- /package/dist/{helpers → v3/helpers}/a11yFlatten.d.ts +0 -0
- /package/dist/{helpers → v3/helpers}/apiCalls.d.ts +0 -0
- /package/dist/{helpers → v3/helpers}/assertion.d.ts +0 -0
- /package/dist/{helpers → v3/helpers}/autohealAx.d.ts +0 -0
- /package/dist/{helpers → v3/helpers}/axTree/actionable.d.ts +0 -0
- /package/dist/{helpers → v3/helpers}/axTree/captureAxTree.d.ts +0 -0
- /package/dist/{helpers → v3/helpers}/axTree/captureAxTree.js +0 -0
- /package/dist/{helpers → v3/helpers}/axTree/captureFrameForest.d.ts +0 -0
- /package/dist/{helpers → v3/helpers}/axTree/index.d.ts +0 -0
- /package/dist/{helpers → v3/helpers}/axTree/index.js +0 -0
- /package/dist/{helpers → v3/helpers}/axTree/serializeAxTree.d.ts +0 -0
- /package/dist/{helpers → v3/helpers}/axTree/serializeAxTree.js +0 -0
- /package/dist/{helpers → v3/helpers}/clipboard-intercept.d.ts +0 -0
- /package/dist/{helpers → v3/helpers}/clipboard-intercept.js +0 -0
- /package/dist/{helpers → v3/helpers}/clipboard.d.ts +0 -0
- /package/dist/{helpers → v3/helpers}/clipboard.js +0 -0
- /package/dist/{helpers → v3/helpers}/cookies.d.ts +0 -0
- /package/dist/{helpers → v3/helpers}/coordinateResolver.d.ts +0 -0
- /package/dist/{helpers → v3/helpers}/coordinateResolverRead.d.ts +0 -0
- /package/dist/{helpers → v3/helpers}/credits.d.ts +0 -0
- /package/dist/{helpers → v3/helpers}/derive.d.ts +0 -0
- /package/dist/{helpers → v3/helpers}/devtools.d.ts +0 -0
- /package/dist/{helpers → v3/helpers}/dialog.d.ts +0 -0
- /package/dist/{helpers → v3/helpers}/dialog.js +0 -0
- /package/dist/{helpers → v3/helpers}/drag.d.ts +0 -0
- /package/dist/{helpers → v3/helpers}/evaluation/colors.d.ts +0 -0
- /package/dist/{helpers → v3/helpers}/evaluation/colors.js +0 -0
- /package/dist/{helpers → v3/helpers}/evaluation/evaluate.d.ts +0 -0
- /package/dist/{helpers → v3/helpers}/evaluation/evaluate.js +0 -0
- /package/dist/{helpers → v3/helpers}/executeApi.d.ts +0 -0
- /package/dist/{helpers → v3/helpers}/executeDb.d.ts +0 -0
- /package/dist/{helpers → v3/helpers}/executeJs.d.ts +0 -0
- /package/dist/{helpers → v3/helpers}/gesture.d.ts +0 -0
- /package/dist/{helpers → v3/helpers}/healCascade.d.ts +0 -0
- /package/dist/{helpers → v3/helpers}/iframeA11y.d.ts +0 -0
- /package/dist/{helpers → v3/helpers}/kaneCli.d.ts +0 -0
- /package/dist/{helpers → v3/helpers}/math.d.ts +0 -0
- /package/dist/{helpers → v3/helpers}/network.d.ts +0 -0
- /package/dist/{helpers → v3/helpers}/pageReady.d.ts +0 -0
- /package/dist/{helpers → v3/helpers}/png.d.ts +0 -0
- /package/dist/{helpers → v3/helpers}/png.js +0 -0
- /package/dist/{helpers → v3/helpers}/queryResult.d.ts +0 -0
- /package/dist/{helpers → v3/helpers}/queryResult.js +0 -0
- /package/dist/{helpers → v3/helpers}/runtimeSnapshot.d.ts +0 -0
- /package/dist/{helpers → v3/helpers}/schemaAssertion.d.ts +0 -0
- /package/dist/{helpers → v3/helpers}/scrollUntil.d.ts +0 -0
- /package/dist/{helpers → v3/helpers}/smartui.d.ts +0 -0
- /package/dist/{helpers → v3/helpers}/sseParser.d.ts +0 -0
- /package/dist/{helpers → v3/helpers}/sseParser.js +0 -0
- /package/dist/{helpers → v3/helpers}/text.d.ts +0 -0
- /package/dist/{helpers → v3/helpers}/text.js +0 -0
- /package/dist/{helpers → v3/helpers}/textNormalize.d.ts +0 -0
- /package/dist/{helpers → v3/helpers}/textNormalize.js +0 -0
- /package/dist/{helpers → v3/helpers}/textualAnalyzer/domStructured.d.ts +0 -0
- /package/dist/{helpers → v3/helpers}/textualAnalyzer/evaluate.d.ts +0 -0
- /package/dist/{helpers → v3/helpers}/textualAnalyzer/evaluate.js +0 -0
- /package/dist/{helpers → v3/helpers}/textualAnalyzer/extractor.d.ts +0 -0
- /package/dist/{helpers → v3/helpers}/textualAnalyzer/extractor.js +0 -0
- /package/dist/{helpers → v3/helpers}/textualAnalyzer/heal.d.ts +0 -0
- /package/dist/{helpers → v3/helpers}/textualAnalyzer/index.d.ts +0 -0
- /package/dist/{helpers → v3/helpers}/textualAnalyzer/locatorEnrichment.d.ts +0 -0
- /package/dist/{helpers → v3/helpers}/textualRead.d.ts +0 -0
- /package/dist/{helpers → v3/helpers}/textualRead.js +0 -0
- /package/dist/{helpers → v3/helpers}/visionFence.d.ts +0 -0
- /package/dist/{helpers → v3/helpers}/visionFence.js +0 -0
- /package/dist/{helpers → v3/helpers}/wait.d.ts +0 -0
- /package/dist/{http.d.ts → v3/http.d.ts} +0 -0
- /package/dist/{httpClient.d.ts → v3/httpClient.d.ts} +0 -0
- /package/dist/{httpClient.js → v3/httpClient.js} +0 -0
- /package/dist/{rankedLocator.d.ts → v3/rankedLocator.d.ts} +0 -0
- /package/dist/{relayProxy.d.ts → v3/relayProxy.d.ts} +0 -0
- /package/dist/{reporters → v3/reporters}/index.d.ts +0 -0
- /package/dist/{reporters → v3/reporters}/local.d.ts +0 -0
- /package/dist/{reporters → v3/reporters}/lt.d.ts +0 -0
- /package/dist/{reporters → v3/reporters}/null.d.ts +0 -0
- /package/dist/{reporters → v3/reporters}/null.js +0 -0
- /package/dist/{routeFailure.d.ts → v3/routeFailure.d.ts} +0 -0
- /package/dist/{session.d.ts → v3/session.d.ts} +0 -0
- /package/dist/{stepVariables.d.ts → v3/stepVariables.d.ts} +0 -0
- /package/dist/{test.d.ts → v3/test.d.ts} +0 -0
- /package/dist/{test.js → v3/test.js} +0 -0
- /package/dist/{testConfig.d.ts → v3/testConfig.d.ts} +0 -0
- /package/dist/{testConfig.js → v3/testConfig.js} +0 -0
- /package/dist/{testState.d.ts → v3/testState.d.ts} +0 -0
- /package/dist/{testState.js → v3/testState.js} +0 -0
- /package/dist/{visionLocator.d.ts → v3/visionLocator.d.ts} +0 -0
- /package/dist/{helpers → v4/helpers}/assertionV3.d.ts +0 -0
- /package/dist/{helpers → v4/helpers}/assertionV3.js +0 -0
- /package/dist/{helpers → v4/helpers}/vision.d.ts +0 -0
package/dist/vars.js
DELETED
|
@@ -1,912 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Variable resolution for testmu.
|
|
3
|
-
*
|
|
4
|
-
* resolveVar(template) — single async entry point. Resolves:
|
|
5
|
-
* - Pure {{x}} → direct lookup from userStore (type-preserving); unresolved → ""
|
|
6
|
-
* - Embedded "prefix {{x}} suffix" → string interpolation; unresolved → ""
|
|
7
|
-
* - ${x} → testParams lookup, then userStore fallback
|
|
8
|
-
* - {{smart.X}} → local computation (no HTTP)
|
|
9
|
-
* - {{global.X}} → ATMS API or TESTMU_VAR_X env fallback
|
|
10
|
-
* - {{environment.X}} → ATMS API (with ENVIRONMENT_ID) or TESTMU_VAR_X env fallback
|
|
11
|
-
* - {{secrets.cat.KEY}} → process.env[KEY]
|
|
12
|
-
* - {{totp.X}} → ATMS seed + TOTP compute
|
|
13
|
-
* - Non-string / non-template values → returned as-is
|
|
14
|
-
*/
|
|
15
|
-
import { authenticator } from "otplib";
|
|
16
|
-
import { recordRead, recordVariable, resetStepVariables } from './stepVariables.js';
|
|
17
|
-
import { fetchWithAuth, ltAuthHeader } from "./http.js";
|
|
18
|
-
import { _registerConfigureHook, get as getConfig } from "./configure.js";
|
|
19
|
-
import { isV3 } from "./configure.js";
|
|
20
|
-
import { log, preview } from "./log.js";
|
|
21
|
-
/** Mirrors PY _is_sensitive_template: only secrets/totp warrant redaction. */
|
|
22
|
-
function _isSensitiveTemplate(templateStr) {
|
|
23
|
-
return templateStr.includes("{{secrets.") || templateStr.includes("{{totp.");
|
|
24
|
-
}
|
|
25
|
-
// ---------------------------------------------------------------------------
|
|
26
|
-
// Internal stores (module-level singletons, reset via _resetStore())
|
|
27
|
-
// ---------------------------------------------------------------------------
|
|
28
|
-
const userStore = new Map();
|
|
29
|
-
const testParamsStore = new Map();
|
|
30
|
-
const globalVariables = [];
|
|
31
|
-
const GLOBAL_PREFIX = "global.";
|
|
32
|
-
// Runtime-resolved global variables (bare name → value). Session-authoritative:
|
|
33
|
-
// seeded once per name from ATMS on first read, overwritten by every
|
|
34
|
-
// setVar("global.X", ...) — reads never go back to ATMS after that, matching
|
|
35
|
-
// the in-product runtime where session data always reflects the latest
|
|
36
|
-
// generated value and is_persist only gates the TMS write-back (PY parity:
|
|
37
|
-
// _vars.py _global_cache).
|
|
38
|
-
const globalCache = new Map();
|
|
39
|
-
// ---------------------------------------------------------------------------
|
|
40
|
-
// Regex — non-greedy, matches Python's re.compile(r"\{\{(.+?)\}\}")
|
|
41
|
-
// ---------------------------------------------------------------------------
|
|
42
|
-
const MUSTACHE_RE = /\{\{(.+?)\}\}/;
|
|
43
|
-
const MUSTACHE_RE_G = /\{\{(.+?)\}\}/g;
|
|
44
|
-
const DOLLAR_RE = /\$\{(.+?)\}/;
|
|
45
|
-
const DOLLAR_RE_G = /\$\{(.+?)\}/g;
|
|
46
|
-
// Backslash-escaped placeholder span: \{{...}} or \${...}. group(1) = literal.
|
|
47
|
-
const ESCAPED_RE = /\\(\{\{.+?\}\}|\$\{.+?\})/;
|
|
48
|
-
const ESCAPED_RE_G = /\\(\{\{.+?\}\}|\$\{.+?\})/g;
|
|
49
|
-
// Matches a single bracket segment like "[0]" or a mixed segment like "key[0]"
|
|
50
|
-
const BRACKET_RE = /^(\w+)\[(\d+)\]$/;
|
|
51
|
-
const BRACKET_ONLY_RE = /^\[(\d+)\]$/;
|
|
52
|
-
function applyTransform(value, t) {
|
|
53
|
-
switch (t) {
|
|
54
|
-
case "upper":
|
|
55
|
-
return String(value).toUpperCase();
|
|
56
|
-
case "lower":
|
|
57
|
-
return String(value).toLowerCase();
|
|
58
|
-
case "trim":
|
|
59
|
-
return String(value).trim();
|
|
60
|
-
case "str":
|
|
61
|
-
return String(value);
|
|
62
|
-
case "int": {
|
|
63
|
-
const n = Number(value);
|
|
64
|
-
if (!Number.isInteger(n) || isNaN(n))
|
|
65
|
-
throw new Error(`int transform: '${value}' is not an integer`);
|
|
66
|
-
return n;
|
|
67
|
-
}
|
|
68
|
-
case "float": {
|
|
69
|
-
const n = Number(value);
|
|
70
|
-
if (isNaN(n))
|
|
71
|
-
throw new Error(`float transform: '${value}' is not a number`);
|
|
72
|
-
return n;
|
|
73
|
-
}
|
|
74
|
-
// matches Python: str(value).lower() in ("true", "1", "yes")
|
|
75
|
-
case "bool": {
|
|
76
|
-
if (typeof value === "boolean")
|
|
77
|
-
return value;
|
|
78
|
-
return ["true", "1", "yes"].includes(String(value).toLowerCase());
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
/** Store a variable value into the given scope (default: user variables). */
|
|
83
|
-
export function setVar(name, value, opts = {}) {
|
|
84
|
-
// PY parity: _vars.py set_var → "[set_var] name=%r value=%s"
|
|
85
|
-
log.helper(`[set_var] name='${name}' value=${preview(value)}`);
|
|
86
|
-
const scope = opts.scope ?? "user";
|
|
87
|
-
if (scope === "testParams") {
|
|
88
|
-
testParamsStore.set(name, value);
|
|
89
|
-
recordVariable(name, value); // report on this step's end hook
|
|
90
|
-
return;
|
|
91
|
-
}
|
|
92
|
-
if (name.startsWith(GLOBAL_PREFIX)) {
|
|
93
|
-
// PY parity (_vars.py set_var): the canonical key is the BARE name —
|
|
94
|
-
// codegen writes setVar("global.X", v) but reads back with bare {{X}}.
|
|
95
|
-
// The cache write makes later {{global.X}} reads session-authoritative;
|
|
96
|
-
// is_persist only gates whether the ATMS write below survives beyond
|
|
97
|
-
// this run (the server answers 403 for persist-off variables).
|
|
98
|
-
const bare = name.slice(GLOBAL_PREFIX.length);
|
|
99
|
-
userStore.set(bare, value);
|
|
100
|
-
globalCache.set(bare, value);
|
|
101
|
-
recordVariable(bare, value); // report on this step's end hook
|
|
102
|
-
if (ltAuthHeader())
|
|
103
|
-
void atmsPersistGlobalVariable(bare, value);
|
|
104
|
-
return;
|
|
105
|
-
}
|
|
106
|
-
userStore.set(name, value);
|
|
107
|
-
recordVariable(name, value); // report on this step's end hook
|
|
108
|
-
}
|
|
109
|
-
/** Reset all stores (for testing). */
|
|
110
|
-
export function _resetStore() {
|
|
111
|
-
userStore.clear();
|
|
112
|
-
testParamsStore.clear();
|
|
113
|
-
resetStepVariables();
|
|
114
|
-
globalVariables.length = 0;
|
|
115
|
-
globalCache.clear();
|
|
116
|
-
}
|
|
117
|
-
/** Expose globalVariables for later tasks. */
|
|
118
|
-
export function _getGlobalVariables() {
|
|
119
|
-
return globalVariables;
|
|
120
|
-
}
|
|
121
|
-
/** Return the user variable store as a plain object (for executeJs injection). */
|
|
122
|
-
export function _getUserStore() {
|
|
123
|
-
return Object.fromEntries(userStore);
|
|
124
|
-
}
|
|
125
|
-
/** Append a global variable entry (called by configure() in Task 15). */
|
|
126
|
-
export function _addGlobalVariable(g) {
|
|
127
|
-
globalVariables.push(g);
|
|
128
|
-
}
|
|
129
|
-
/**
|
|
130
|
-
* Module-private synchronous resolver — used internally by resolveVar for
|
|
131
|
-
* non-ATMS fast paths. Not exported.
|
|
132
|
-
*
|
|
133
|
-
* - Non-string → returned as-is.
|
|
134
|
-
* - No {{...}} or ${...} → returned as-is.
|
|
135
|
-
* - Pure {{x}} → type-preserving lookup; unresolved → "".
|
|
136
|
-
* - Pure ${x} → testParams then userStore lookup; unresolved → "".
|
|
137
|
-
* - Embedded (contains other text) → string interpolation; unresolved → "".
|
|
138
|
-
*/
|
|
139
|
-
function _resolveSync(template, opts = {}) {
|
|
140
|
-
// Non-string: pass through unchanged (JS idiom — differs from Python's None→"")
|
|
141
|
-
if (typeof template !== "string")
|
|
142
|
-
return template;
|
|
143
|
-
// Fast-path: no template patterns at all
|
|
144
|
-
if (!MUSTACHE_RE.test(template) && !DOLLAR_RE.test(template)) {
|
|
145
|
-
return template;
|
|
146
|
-
}
|
|
147
|
-
let result;
|
|
148
|
-
// Pure {{x}} — type-preserving; unresolved → ""
|
|
149
|
-
const pureMustacheName = extractPure(template, MUSTACHE_RE);
|
|
150
|
-
if (pureMustacheName !== null) {
|
|
151
|
-
const smart = maybeSmart(pureMustacheName);
|
|
152
|
-
result = smart.isSmart ? smart.value : resolveUserName(pureMustacheName);
|
|
153
|
-
return (opts.transform ? applyTransform(result, opts.transform) : result);
|
|
154
|
-
}
|
|
155
|
-
// Pure ${x} — type-preserving; unresolved → ""
|
|
156
|
-
const pureDollarName = extractPure(template, DOLLAR_RE);
|
|
157
|
-
if (pureDollarName !== null) {
|
|
158
|
-
result = lookupTestParams(pureDollarName);
|
|
159
|
-
return (opts.transform ? applyTransform(result, opts.transform) : result);
|
|
160
|
-
}
|
|
161
|
-
// Embedded template — string interpolation
|
|
162
|
-
let out = template.replace(MUSTACHE_RE_G, (_m, name) => {
|
|
163
|
-
const trimmed = name.trim();
|
|
164
|
-
const smart = maybeSmart(trimmed);
|
|
165
|
-
if (smart.isSmart)
|
|
166
|
-
return smart.value;
|
|
167
|
-
const val = resolveUserName(trimmed);
|
|
168
|
-
return val === "" ? "" : String(val);
|
|
169
|
-
});
|
|
170
|
-
out = out.replace(DOLLAR_RE_G, (_m, name) => {
|
|
171
|
-
const val = lookupTestParams(name.trim());
|
|
172
|
-
return val === "" ? "" : String(val);
|
|
173
|
-
});
|
|
174
|
-
result = out;
|
|
175
|
-
return (opts.transform ? applyTransform(result, opts.transform) : result);
|
|
176
|
-
}
|
|
177
|
-
// ---------------------------------------------------------------------------
|
|
178
|
-
// Dot-path / bracket traversal helpers
|
|
179
|
-
// ---------------------------------------------------------------------------
|
|
180
|
-
/** Sentinel that means "key not found" — distinct from a stored undefined/null. */
|
|
181
|
-
const MISSING = Symbol("testmu-missing");
|
|
182
|
-
/**
|
|
183
|
-
* If val is a JSON-string that parses to a dict or list, return the parsed value.
|
|
184
|
-
* Otherwise return val unchanged. Mirrors Python's _parse_if_string.
|
|
185
|
-
*/
|
|
186
|
-
function parseIfJsonString(val) {
|
|
187
|
-
if (typeof val !== "string")
|
|
188
|
-
return val;
|
|
189
|
-
const s = val.trim();
|
|
190
|
-
if (s.startsWith("{") || s.startsWith("[")) {
|
|
191
|
-
try {
|
|
192
|
-
const parsed = JSON.parse(s);
|
|
193
|
-
if (typeof parsed === "object" && parsed !== null)
|
|
194
|
-
return parsed;
|
|
195
|
-
}
|
|
196
|
-
catch {
|
|
197
|
-
// not valid JSON — leave as string
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
return val;
|
|
201
|
-
}
|
|
202
|
-
/**
|
|
203
|
-
* Walk into `obj` using a dot/bracket path string.
|
|
204
|
-
*
|
|
205
|
-
* Examples:
|
|
206
|
-
* "address.city" on { address: { city: "Paris" } } → "Paris"
|
|
207
|
-
* "[1].id" on [{ id: 1 }, { id: 2 }] → 2
|
|
208
|
-
* "users[0].name" on { users: [{ name: "A" }] } → "A"
|
|
209
|
-
*
|
|
210
|
-
* Returns MISSING when the path cannot be fully navigated.
|
|
211
|
-
* Parses JSON strings at each step before descending.
|
|
212
|
-
*/
|
|
213
|
-
function applyPath(value, path) {
|
|
214
|
-
const rawSegments = path.split(".");
|
|
215
|
-
const segments = rawSegments.filter((s) => s.length > 0);
|
|
216
|
-
let obj = parseIfJsonString(value);
|
|
217
|
-
for (const seg of segments) {
|
|
218
|
-
obj = parseIfJsonString(obj);
|
|
219
|
-
if (obj === null || obj === undefined)
|
|
220
|
-
return MISSING;
|
|
221
|
-
// Bracket-only segment: "[N]"
|
|
222
|
-
const bracketOnly = BRACKET_ONLY_RE.exec(seg);
|
|
223
|
-
if (bracketOnly) {
|
|
224
|
-
const idx = Number(bracketOnly[1]);
|
|
225
|
-
if (!Array.isArray(obj))
|
|
226
|
-
return MISSING;
|
|
227
|
-
if (idx < 0 || idx >= obj.length)
|
|
228
|
-
return MISSING;
|
|
229
|
-
obj = obj[idx];
|
|
230
|
-
continue;
|
|
231
|
-
}
|
|
232
|
-
// Mixed segment: "key[N]"
|
|
233
|
-
const mixed = BRACKET_RE.exec(seg);
|
|
234
|
-
if (mixed) {
|
|
235
|
-
const key = mixed[1];
|
|
236
|
-
const idx = Number(mixed[2]);
|
|
237
|
-
if (typeof obj !== "object" || Array.isArray(obj))
|
|
238
|
-
return MISSING;
|
|
239
|
-
const record = obj;
|
|
240
|
-
if (key === undefined || !(key in record))
|
|
241
|
-
return MISSING;
|
|
242
|
-
const inner = parseIfJsonString(record[key]);
|
|
243
|
-
if (!Array.isArray(inner))
|
|
244
|
-
return MISSING;
|
|
245
|
-
if (idx < 0 || idx >= inner.length)
|
|
246
|
-
return MISSING;
|
|
247
|
-
obj = inner[idx];
|
|
248
|
-
continue;
|
|
249
|
-
}
|
|
250
|
-
// Plain key or integer index
|
|
251
|
-
if (Array.isArray(obj)) {
|
|
252
|
-
const idx = Number(seg);
|
|
253
|
-
if (!Number.isInteger(idx) || isNaN(idx))
|
|
254
|
-
return MISSING;
|
|
255
|
-
if (idx < 0 || idx >= obj.length)
|
|
256
|
-
return MISSING;
|
|
257
|
-
obj = obj[idx];
|
|
258
|
-
}
|
|
259
|
-
else if (typeof obj === "object") {
|
|
260
|
-
const record = obj;
|
|
261
|
-
if (!(seg in record))
|
|
262
|
-
return MISSING;
|
|
263
|
-
obj = record[seg];
|
|
264
|
-
}
|
|
265
|
-
else {
|
|
266
|
-
return MISSING;
|
|
267
|
-
}
|
|
268
|
-
}
|
|
269
|
-
return obj;
|
|
270
|
-
}
|
|
271
|
-
/**
|
|
272
|
-
* Resolve a variable name that may contain dot-paths or bracket notation.
|
|
273
|
-
*
|
|
274
|
-
* Matches Python's _resolve_single for plain variables:
|
|
275
|
-
* 1. If name contains "." or "[", attempt dot-path traversal first:
|
|
276
|
-
* - Extract root key (before first "." or "[")
|
|
277
|
-
* - If root exists in store, traverse the rest of the path
|
|
278
|
-
* - If traversal fails (MISSING), fall back to flat key lookup
|
|
279
|
-
* 2. Otherwise, direct flat key lookup.
|
|
280
|
-
*
|
|
281
|
-
* Returns the resolved value or "" when nothing found.
|
|
282
|
-
*/
|
|
283
|
-
function resolveUserName(name) {
|
|
284
|
-
const hasDot = name.includes(".");
|
|
285
|
-
const hasBracket = name.includes("[");
|
|
286
|
-
if (hasDot || hasBracket) {
|
|
287
|
-
// Extract root: everything before the first "." or "["
|
|
288
|
-
const firstDot = name.indexOf(".");
|
|
289
|
-
const firstBracket = name.indexOf("[");
|
|
290
|
-
let splitAt;
|
|
291
|
-
if (firstDot === -1)
|
|
292
|
-
splitAt = firstBracket;
|
|
293
|
-
else if (firstBracket === -1)
|
|
294
|
-
splitAt = firstDot;
|
|
295
|
-
else
|
|
296
|
-
splitAt = Math.min(firstDot, firstBracket);
|
|
297
|
-
const rootKey = name.slice(0, splitAt);
|
|
298
|
-
// Rest starts after "." or at "["; we pass the remainder including any "[" on the root
|
|
299
|
-
const afterRoot = name.slice(splitAt);
|
|
300
|
-
// Strip leading "." to get the path to pass to applyPath
|
|
301
|
-
const rest = afterRoot.startsWith(".") ? afterRoot.slice(1) : afterRoot;
|
|
302
|
-
if (userStore.has(rootKey) && rest.length > 0) {
|
|
303
|
-
const rootVal = userStore.get(rootKey);
|
|
304
|
-
const walked = applyPath(rootVal, rest);
|
|
305
|
-
if (walked !== MISSING)
|
|
306
|
-
return recordRead(name, walked);
|
|
307
|
-
}
|
|
308
|
-
}
|
|
309
|
-
// Flat key lookup (also the fallback when root is absent or traversal fails)
|
|
310
|
-
if (userStore.has(name))
|
|
311
|
-
return recordRead(name, userStore.get(name));
|
|
312
|
-
return "";
|
|
313
|
-
}
|
|
314
|
-
// ---------------------------------------------------------------------------
|
|
315
|
-
// Smart variables — {{smart.X}} — computed, matching Python _resolve_smart
|
|
316
|
-
// ---------------------------------------------------------------------------
|
|
317
|
-
const MONTH_NAMES = [
|
|
318
|
-
"January",
|
|
319
|
-
"February",
|
|
320
|
-
"March",
|
|
321
|
-
"April",
|
|
322
|
-
"May",
|
|
323
|
-
"June",
|
|
324
|
-
"July",
|
|
325
|
-
"August",
|
|
326
|
-
"September",
|
|
327
|
-
"October",
|
|
328
|
-
"November",
|
|
329
|
-
"December",
|
|
330
|
-
];
|
|
331
|
-
// JS getDay(): Sunday=0..Saturday=6
|
|
332
|
-
const DAY_NAMES = [
|
|
333
|
-
"Sunday",
|
|
334
|
-
"Monday",
|
|
335
|
-
"Tuesday",
|
|
336
|
-
"Wednesday",
|
|
337
|
-
"Thursday",
|
|
338
|
-
"Friday",
|
|
339
|
-
"Saturday",
|
|
340
|
-
];
|
|
341
|
-
// Python: ascii_letters + digits (a-z A-Z 0-9)
|
|
342
|
-
const ALPHANUM = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
|
|
343
|
-
// Python: ascii_lowercase + digits
|
|
344
|
-
const LOWERDIG = "abcdefghijklmnopqrstuvwxyz0123456789";
|
|
345
|
-
function pad2(n) {
|
|
346
|
-
return n < 10 ? `0${n}` : String(n);
|
|
347
|
-
}
|
|
348
|
-
function fmtDate(d) {
|
|
349
|
-
return `${d.getFullYear()}-${pad2(d.getMonth() + 1)}-${pad2(d.getDate())}`;
|
|
350
|
-
}
|
|
351
|
-
function randInt(lo, hi) {
|
|
352
|
-
return Math.floor(Math.random() * (hi - lo + 1)) + lo;
|
|
353
|
-
}
|
|
354
|
-
function randStr(len, chars) {
|
|
355
|
-
let s = "";
|
|
356
|
-
for (let i = 0; i < len; i++)
|
|
357
|
-
s += chars[randInt(0, chars.length - 1)];
|
|
358
|
-
return s;
|
|
359
|
-
}
|
|
360
|
-
function startOfWeek(d) {
|
|
361
|
-
// Python: now - timedelta(days=now.weekday()); weekday() is Mon=0..Sun=6
|
|
362
|
-
const jsDow = d.getDay(); // Sun=0..Sat=6
|
|
363
|
-
const pyDow = jsDow === 0 ? 6 : jsDow - 1; // Mon=0..Sun=6
|
|
364
|
-
const r = new Date(d);
|
|
365
|
-
r.setDate(d.getDate() - pyDow);
|
|
366
|
-
return r;
|
|
367
|
-
}
|
|
368
|
-
function endOfWeek(d) {
|
|
369
|
-
const jsDow = d.getDay();
|
|
370
|
-
const pyDow = jsDow === 0 ? 6 : jsDow - 1;
|
|
371
|
-
const r = new Date(d);
|
|
372
|
-
r.setDate(d.getDate() + (6 - pyDow));
|
|
373
|
-
return r;
|
|
374
|
-
}
|
|
375
|
-
function daysInMonth(year, month0) {
|
|
376
|
-
// month0 is 0-indexed; new Date(y, m+1, 0) gives last day of month m
|
|
377
|
-
return new Date(year, month0 + 1, 0).getDate();
|
|
378
|
-
}
|
|
379
|
-
/**
|
|
380
|
-
* Date/time smart variables must resolve in the TEST's timezone, not the runner
|
|
381
|
-
* VM's local clock. A test authored for a non-UTC org otherwise gets
|
|
382
|
-
* `{{smart.current_date}}` from wherever the worker happens to run — off by a day around
|
|
383
|
-
* midnight (the Jonas Club report).
|
|
384
|
-
*
|
|
385
|
-
* `KANE_SESSION_TIMEZONE` carries the session's zone; UTC is the default, matching the source.
|
|
386
|
-
*/
|
|
387
|
-
const DEFAULT_SESSION_TIMEZONE = 'UTC';
|
|
388
|
-
/**
|
|
389
|
-
* The session's EFFECTIVE timezone name. Returns the zone actually used, so
|
|
390
|
-
* `{{smart.current_timezone}}` can never disagree with the clock the other date/time variables
|
|
391
|
-
* were computed from — an unknown zone reports UTC because UTC is what it fell back to. A bad
|
|
392
|
-
* env var must not fail a step.
|
|
393
|
-
*/
|
|
394
|
-
function sessionTimeZone() {
|
|
395
|
-
const requested = process.env['KANE_SESSION_TIMEZONE'];
|
|
396
|
-
if (!requested)
|
|
397
|
-
return DEFAULT_SESSION_TIMEZONE;
|
|
398
|
-
try {
|
|
399
|
-
// Throws RangeError on an unknown zone.
|
|
400
|
-
new Intl.DateTimeFormat('en-US', { timeZone: requested }).format();
|
|
401
|
-
return requested;
|
|
402
|
-
}
|
|
403
|
-
catch {
|
|
404
|
-
log.warn(`Unknown KANE_SESSION_TIMEZONE '${requested}'; falling back to ${DEFAULT_SESSION_TIMEZONE}`);
|
|
405
|
-
return DEFAULT_SESSION_TIMEZONE;
|
|
406
|
-
}
|
|
407
|
-
}
|
|
408
|
-
/**
|
|
409
|
-
* Now, as a Date whose LOCAL getters read the session zone's wall clock.
|
|
410
|
-
*
|
|
411
|
-
* The whole smart-variable block below uses local getters (getFullYear, getHours, …), so
|
|
412
|
-
* shifting the value is far less invasive than rewriting each case. Built from
|
|
413
|
-
* `formatToParts` rather than parsing `toLocaleString`, which avoids depending on a locale's
|
|
414
|
-
* string format being round-trippable through `new Date(...)`.
|
|
415
|
-
*/
|
|
416
|
-
function sessionNow() {
|
|
417
|
-
const tz = sessionTimeZone();
|
|
418
|
-
const parts = new Intl.DateTimeFormat('en-US', {
|
|
419
|
-
timeZone: tz,
|
|
420
|
-
year: 'numeric', month: '2-digit', day: '2-digit',
|
|
421
|
-
hour: '2-digit', minute: '2-digit', second: '2-digit',
|
|
422
|
-
hour12: false,
|
|
423
|
-
}).formatToParts(new Date());
|
|
424
|
-
const get = (type) => Number(parts.find((p) => p.type === type)?.value ?? 0);
|
|
425
|
-
// hour can format as "24" at midnight in some ICU versions; normalise to 0.
|
|
426
|
-
const hour = get('hour') % 24;
|
|
427
|
-
return new Date(get('year'), get('month') - 1, get('day'), hour, get('minute'), get('second'));
|
|
428
|
-
}
|
|
429
|
-
function computeSmartVariable(name) {
|
|
430
|
-
const now = sessionNow();
|
|
431
|
-
switch (name) {
|
|
432
|
-
// Date/time (Python strftime format strings)
|
|
433
|
-
case "current_date":
|
|
434
|
-
return fmtDate(now); // %Y-%m-%d
|
|
435
|
-
case "current_day":
|
|
436
|
-
return DAY_NAMES[now.getDay()]; // %A e.g. "Monday"
|
|
437
|
-
case "current_month_number":
|
|
438
|
-
return pad2(now.getMonth() + 1); // %m e.g. "03"
|
|
439
|
-
case "current_year":
|
|
440
|
-
return String(now.getFullYear()); // %Y
|
|
441
|
-
case "current_month":
|
|
442
|
-
return MONTH_NAMES[now.getMonth()]; // %B e.g. "March"
|
|
443
|
-
case "current_hour":
|
|
444
|
-
return pad2(now.getHours()); // %H
|
|
445
|
-
case "current_minute":
|
|
446
|
-
return pad2(now.getMinutes()); // %M
|
|
447
|
-
case "current_timestamp":
|
|
448
|
-
return `${fmtDate(now)} ${pad2(now.getHours())}:${pad2(now.getMinutes())}:${pad2(now.getSeconds())}`; // %Y-%m-%d %H:%M:%S
|
|
449
|
-
case "current_timezone":
|
|
450
|
-
return sessionTimeZone();
|
|
451
|
-
// Date arithmetic
|
|
452
|
-
case "next_day": {
|
|
453
|
-
const d = new Date(now);
|
|
454
|
-
d.setDate(d.getDate() + 1);
|
|
455
|
-
return fmtDate(d);
|
|
456
|
-
}
|
|
457
|
-
case "previous_day": {
|
|
458
|
-
const d = new Date(now);
|
|
459
|
-
d.setDate(d.getDate() - 1);
|
|
460
|
-
return fmtDate(d);
|
|
461
|
-
}
|
|
462
|
-
case "start_of_week":
|
|
463
|
-
return fmtDate(startOfWeek(now));
|
|
464
|
-
case "end_of_week":
|
|
465
|
-
return fmtDate(endOfWeek(now));
|
|
466
|
-
case "start_of_month":
|
|
467
|
-
return fmtDate(new Date(now.getFullYear(), now.getMonth(), 1));
|
|
468
|
-
case "end_of_month":
|
|
469
|
-
return fmtDate(new Date(now.getFullYear(), now.getMonth(), daysInMonth(now.getFullYear(), now.getMonth())));
|
|
470
|
-
// Random (Python-exact ranges)
|
|
471
|
-
case "random_int":
|
|
472
|
-
return String(randInt(100, 999)); // randint(100, 999)
|
|
473
|
-
case "random_float":
|
|
474
|
-
return String(Math.round((Math.random() * 99 + 1) * 100) / 100); // round(uniform(1,100), 2)
|
|
475
|
-
case "random_string_8":
|
|
476
|
-
return randStr(8, ALPHANUM);
|
|
477
|
-
case "random_string_56":
|
|
478
|
-
return randStr(56, ALPHANUM);
|
|
479
|
-
case "random_email":
|
|
480
|
-
return `${randStr(10, LOWERDIG)}@example.com`;
|
|
481
|
-
case "random_phone":
|
|
482
|
-
return String(randInt(1_000_000_000, 9_999_999_999)); // randint(1e9, 9.999...e9)
|
|
483
|
-
// Static geo (exact literals from Python)
|
|
484
|
-
case "latitude":
|
|
485
|
-
return "13.2257";
|
|
486
|
-
case "longitude":
|
|
487
|
-
return "77.5750";
|
|
488
|
-
case "country":
|
|
489
|
-
return "India";
|
|
490
|
-
case "city":
|
|
491
|
-
return "Doddaballapura";
|
|
492
|
-
case "ip_address":
|
|
493
|
-
return "143.110.182.88";
|
|
494
|
-
// Env-backed system info (Python: os.getenv("LT_USERNAME", ""), etc.)
|
|
495
|
-
case "user_name":
|
|
496
|
-
return process.env["LT_USERNAME"] ?? "";
|
|
497
|
-
case "os_type":
|
|
498
|
-
// falls through
|
|
499
|
-
case "os":
|
|
500
|
-
return process.env["smart_os"] ?? "";
|
|
501
|
-
case "os_version":
|
|
502
|
-
return process.env["smart_os_version"] ?? "";
|
|
503
|
-
case "browser_name":
|
|
504
|
-
return process.env["smart_browser_name"] ?? "";
|
|
505
|
-
case "browser_version":
|
|
506
|
-
return process.env["smart_browser_version"] ?? "";
|
|
507
|
-
// The ACTUAL allocated device, never the selection regex it was
|
|
508
|
-
// chosen by.
|
|
509
|
-
case "device_name":
|
|
510
|
-
return resolveRealDeviceName();
|
|
511
|
-
default:
|
|
512
|
-
return "";
|
|
513
|
-
}
|
|
514
|
-
}
|
|
515
|
-
// A device-selection FILTER is not a device name. The caller may ask the hub for
|
|
516
|
-
// e.g. "^(?!.*(Tab|Fold)).*" or "iPhone.*"; the hub picks a concrete device and
|
|
517
|
-
// the test must assert against THAT, not against the filter it was chosen by.
|
|
518
|
-
// These tokens are the ones a selection regex actually uses in practice — a
|
|
519
|
-
// deliberately narrow list, since a false positive would suppress a real name.
|
|
520
|
-
const DEVICE_REGEX_TOKENS = ["(?!", ".*", "^(", "iPhone."];
|
|
521
|
-
/** True when `value` looks like a device-selection regex rather than a name. */
|
|
522
|
-
export function isValueRegex(value) {
|
|
523
|
-
if (value === null || value === undefined || value === "")
|
|
524
|
-
return false;
|
|
525
|
-
const s = String(value);
|
|
526
|
-
return DEVICE_REGEX_TOKENS.some((token) => s.includes(token));
|
|
527
|
-
}
|
|
528
|
-
/**
|
|
529
|
-
* Resolve `{{smart.device_name}}` to the ACTUAL allocated device.
|
|
530
|
-
*
|
|
531
|
-
* Order: a concrete device already in the environment (a live or pinned run)
|
|
532
|
-
* wins; otherwise the value captured from the session capabilities at session
|
|
533
|
-
* start (`smart_device_name`). If neither yields anything better, the
|
|
534
|
-
* environment value is returned unchanged — including a regex — so behaviour
|
|
535
|
-
* never regresses to empty.
|
|
536
|
-
*/
|
|
537
|
-
export function resolveRealDeviceName() {
|
|
538
|
-
const envValue = process.env["device_name"] || process.env["deviceName"] || "";
|
|
539
|
-
if (envValue !== "" && !isValueRegex(envValue))
|
|
540
|
-
return envValue;
|
|
541
|
-
const fromSession = process.env["smart_device_name"] ?? "";
|
|
542
|
-
if (fromSession !== "")
|
|
543
|
-
return fromSession;
|
|
544
|
-
return envValue;
|
|
545
|
-
}
|
|
546
|
-
/** If name starts with "smart.", compute the smart variable. */
|
|
547
|
-
function maybeSmart(name) {
|
|
548
|
-
if (!name.startsWith("smart."))
|
|
549
|
-
return { isSmart: false };
|
|
550
|
-
return {
|
|
551
|
-
isSmart: true,
|
|
552
|
-
value: recordRead(name, computeSmartVariable(name.slice("smart.".length))),
|
|
553
|
-
};
|
|
554
|
-
}
|
|
555
|
-
// ---------------------------------------------------------------------------
|
|
556
|
-
// Internal helpers
|
|
557
|
-
// ---------------------------------------------------------------------------
|
|
558
|
-
/**
|
|
559
|
-
* If `template` is exactly one placeholder matching `re`, return the captured
|
|
560
|
-
* group (trimmed). Otherwise return null.
|
|
561
|
-
*
|
|
562
|
-
* Uses an anchored regex so "{{a}} {{b}}" is NOT considered pure.
|
|
563
|
-
*
|
|
564
|
-
* The name class forbids braces ("[^{}]+") in EVERY kane version: a lazy
|
|
565
|
-
* ".+?" expands across interior "}" to satisfy the "$" anchor, so any template
|
|
566
|
-
* that both starts and ends with a delimiter collapses into ONE bogus name —
|
|
567
|
-
* "${A}?x=${B}" → "A}?x=${B", "{{smart.random_int}}.{{smart.random_int}}" →
|
|
568
|
-
* "smart.random_int}}.{{smart.random_int" — which no store or smart handler
|
|
569
|
-
* knows, yielding "" instead of interpolating each placeholder. Mirrors PY
|
|
570
|
-
* _vars.py.
|
|
571
|
-
*
|
|
572
|
-
* noUncheckedIndexedAccess: m[1] is string|undefined — use `m[1] ?? null`.
|
|
573
|
-
*/
|
|
574
|
-
function extractPure(template, re) {
|
|
575
|
-
const source = re.source.replace("(.+?)", "([^{}]+)");
|
|
576
|
-
const anchored = new RegExp(`^${source}$`);
|
|
577
|
-
const m = template.match(anchored);
|
|
578
|
-
if (!m)
|
|
579
|
-
return null;
|
|
580
|
-
const captured = m[1];
|
|
581
|
-
return captured !== undefined ? captured.trim() : null;
|
|
582
|
-
}
|
|
583
|
-
/** Look up a name from userStore. Returns "" if not found. */
|
|
584
|
-
function lookupUser(name) {
|
|
585
|
-
if (userStore.has(name))
|
|
586
|
-
return recordRead(name, userStore.get(name));
|
|
587
|
-
return "";
|
|
588
|
-
}
|
|
589
|
-
/**
|
|
590
|
-
* Look up a name from testParamsStore, falling back to userStore.
|
|
591
|
-
* Returns "" if not found in either (matches Python: _test_params.get(name, _variable_store.get(name, ""))).
|
|
592
|
-
*/
|
|
593
|
-
function lookupTestParams(name) {
|
|
594
|
-
if (testParamsStore.has(name))
|
|
595
|
-
return recordRead(name, testParamsStore.get(name));
|
|
596
|
-
if (userStore.has(name))
|
|
597
|
-
return recordRead(name, userStore.get(name));
|
|
598
|
-
return "";
|
|
599
|
-
}
|
|
600
|
-
/** Regular-variable scope for the ATMS lookup. */
|
|
601
|
-
const ATMS_VARIABLE_TYPE = 'variable';
|
|
602
|
-
/**
|
|
603
|
-
* GET {ATMS_URL}/api/v1/variables/{name}?environment_id={id}
|
|
604
|
-
*
|
|
605
|
-
* Matches Python _atms_get_variable: always includes environment_id (0 for global).
|
|
606
|
-
* Response: resp.json()["data"] — then .value from that dict.
|
|
607
|
-
* ATMS_URL defaults to https://test-manager-api.lambdatest.com when env var
|
|
608
|
-
* unset (matches Python _vars.py:391,405). Cloud (HE) overrides via injection.
|
|
609
|
-
*/
|
|
610
|
-
async function atmsGetVariable(name, environmentId = 0) {
|
|
611
|
-
const base = (process.env["ATMS_URL"] ?? "https://test-manager-api.lambdatest.com").replace(/\/$/, "");
|
|
612
|
-
// variable_type disambiguates same-named variables across scopes; without it
|
|
613
|
-
// ATMS can resolve a name to the wrong scope's value. "variable" is the regular-variable
|
|
614
|
-
// scope and the only value the runtime sends today.
|
|
615
|
-
const url = `${base}/api/v1/variables/${encodeURIComponent(name)}` +
|
|
616
|
-
`?environment_id=${environmentId}&variable_type=${ATMS_VARIABLE_TYPE}`;
|
|
617
|
-
const resp = await fetchWithAuth(url, { method: "GET" });
|
|
618
|
-
if (!resp.ok)
|
|
619
|
-
throw new Error(`ATMS variable fetch failed for '${name}': ${resp.status}`);
|
|
620
|
-
const body = (await resp.json());
|
|
621
|
-
return body.data.value;
|
|
622
|
-
}
|
|
623
|
-
/**
|
|
624
|
-
* PY parity (_vars.py _atms_persist_global_variable): PUT the new value back
|
|
625
|
-
* to the ATMS variables backend so a persist-enabled global updates on the
|
|
626
|
-
* variables page when this runs standalone. The server decides persistence
|
|
627
|
-
* (403/500 = persist-off, session value only). Failures are swallowed — a
|
|
628
|
-
* backend hiccup never breaks the running test.
|
|
629
|
-
*/
|
|
630
|
-
async function atmsPersistGlobalVariable(name, value) {
|
|
631
|
-
const base = (process.env["ATMS_URL"] ?? "").replace(/\/$/, "");
|
|
632
|
-
if (!base)
|
|
633
|
-
return;
|
|
634
|
-
const url = `${base}/api/v1/variables/name/${encodeURIComponent(name)}`;
|
|
635
|
-
try {
|
|
636
|
-
const resp = await fetchWithAuth(url, {
|
|
637
|
-
method: "PUT",
|
|
638
|
-
headers: { "Content-Type": "application/json" },
|
|
639
|
-
body: JSON.stringify({
|
|
640
|
-
value: value == null ? "" : String(value),
|
|
641
|
-
value_type: "string",
|
|
642
|
-
type: "variable",
|
|
643
|
-
environment_id: 0,
|
|
644
|
-
}),
|
|
645
|
-
});
|
|
646
|
-
if (resp.ok)
|
|
647
|
-
log.helper(`global.${name} persisted to ATMS`);
|
|
648
|
-
else if (resp.status === 403 || resp.status === 500)
|
|
649
|
-
log.helper(`global.${name} variable persistence is off — session value only`);
|
|
650
|
-
else
|
|
651
|
-
log.helper(`ATMS persist for global.${name} failed (${resp.status})`);
|
|
652
|
-
}
|
|
653
|
-
catch (err) {
|
|
654
|
-
log.helper(`ATMS persist for global.${name} failed: ${err}`);
|
|
655
|
-
}
|
|
656
|
-
}
|
|
657
|
-
/**
|
|
658
|
-
* Resolve a special async variable prefix: global., environment., secrets.
|
|
659
|
-
* Throws a descriptive error when resolution fails.
|
|
660
|
-
*/
|
|
661
|
-
async function resolveSpecialAsync(name) {
|
|
662
|
-
// {{global.X}} → ATMS (environment_id=0) or TESTMU_VAR_X fallback
|
|
663
|
-
if (name.startsWith("global.")) {
|
|
664
|
-
const varName = name.slice("global.".length);
|
|
665
|
-
// Cache check BEFORE the auth check: a no-auth run must read back its own
|
|
666
|
-
// setVar("global.X") without demanding TESTMU_VAR_X (PY parity).
|
|
667
|
-
const cached = globalCache.get(varName);
|
|
668
|
-
if (cached !== undefined)
|
|
669
|
-
return String(cached);
|
|
670
|
-
if (!ltAuthHeader()) {
|
|
671
|
-
const envVal = process.env[`TESTMU_VAR_${varName}`];
|
|
672
|
-
if (envVal === undefined) {
|
|
673
|
-
throw new Error(`Cannot resolve {{global.${varName}}}: no LT credentials and no TESTMU_VAR_${varName} env var set`);
|
|
674
|
-
}
|
|
675
|
-
return recordRead(name, envVal);
|
|
676
|
-
}
|
|
677
|
-
// First read of this name: fetch once and cache. A failed fetch is NOT
|
|
678
|
-
// negative-cached — the env fallback / throw runs per read.
|
|
679
|
-
try {
|
|
680
|
-
const v = await atmsGetVariable(varName, 0);
|
|
681
|
-
globalCache.set(varName, v);
|
|
682
|
-
return recordRead(name, v);
|
|
683
|
-
}
|
|
684
|
-
catch (err) {
|
|
685
|
-
const envVal = process.env[`TESTMU_VAR_${varName}`];
|
|
686
|
-
if (envVal !== undefined)
|
|
687
|
-
return recordRead(name, envVal);
|
|
688
|
-
throw new Error(`Cannot resolve {{global.${varName}}}: ATMS failed and no TESTMU_VAR_${varName} env var set`);
|
|
689
|
-
}
|
|
690
|
-
}
|
|
691
|
-
// {{environment.X}} → ATMS with ENVIRONMENT_ID or TESTMU_VAR_X fallback
|
|
692
|
-
if (name.startsWith("environment.")) {
|
|
693
|
-
const varName = name.slice("environment.".length);
|
|
694
|
-
if (!ltAuthHeader()) {
|
|
695
|
-
const envVal = process.env[`TESTMU_VAR_${varName}`];
|
|
696
|
-
if (envVal === undefined) {
|
|
697
|
-
throw new Error(`Cannot resolve {{environment.${varName}}}: no LT credentials and no TESTMU_VAR_${varName} env var set`);
|
|
698
|
-
}
|
|
699
|
-
return recordRead(name, envVal);
|
|
700
|
-
}
|
|
701
|
-
try {
|
|
702
|
-
// env var wins, then configure(environmentId), then 0 — matches PY _vars.py:227.
|
|
703
|
-
const envFromProc = process.env["ENVIRONMENT_ID"];
|
|
704
|
-
const envId = (envFromProc !== undefined && envFromProc !== "")
|
|
705
|
-
? parseInt(envFromProc, 10)
|
|
706
|
-
: Number(getConfig("environmentId") || 0);
|
|
707
|
-
return recordRead(name, await atmsGetVariable(varName, envId));
|
|
708
|
-
}
|
|
709
|
-
catch (err) {
|
|
710
|
-
const envVal = process.env[`TESTMU_VAR_${varName}`];
|
|
711
|
-
if (envVal !== undefined)
|
|
712
|
-
return recordRead(name, envVal);
|
|
713
|
-
throw new Error(`Cannot resolve {{environment.${varName}}}: ATMS failed and no TESTMU_VAR_${varName} env var set`);
|
|
714
|
-
}
|
|
715
|
-
}
|
|
716
|
-
// The two branches below are the ONLY resolution paths with no
|
|
717
|
-
// recordRead — secrets resolve to a live credential and totp to a one-time
|
|
718
|
-
// code, and the step-variable buffer is shipped to the hub and written into
|
|
719
|
-
// the run's artefacts. Keep it that way.
|
|
720
|
-
// {{secrets.cat.KEY}} → process.env[KEY]. V3 fails SOFT to '' — PY parity
|
|
721
|
-
// (_vars.py:200: os.getenv(key, "")). V4 keeps the loud throw untouched.
|
|
722
|
-
if (name.startsWith("secrets.")) {
|
|
723
|
-
const parts = name.split(".");
|
|
724
|
-
const key = parts[parts.length - 1];
|
|
725
|
-
if (!key)
|
|
726
|
-
throw new Error(`Invalid secrets path: ${name}`);
|
|
727
|
-
const val = process.env[key];
|
|
728
|
-
if (val === undefined) {
|
|
729
|
-
if (isV3())
|
|
730
|
-
return "";
|
|
731
|
-
throw new Error(`Cannot resolve {{${name}}}: env var '${key}' not set`);
|
|
732
|
-
}
|
|
733
|
-
return val;
|
|
734
|
-
}
|
|
735
|
-
// {{totp.X}} → ATMS seed + otplib generate, or TESTMU_TOTP_X env fallback (also a seed)
|
|
736
|
-
if (name.startsWith("totp.")) {
|
|
737
|
-
const varName = name.slice("totp.".length);
|
|
738
|
-
let seed;
|
|
739
|
-
if (!ltAuthHeader()) {
|
|
740
|
-
const envVal = process.env[`TESTMU_TOTP_${varName}`];
|
|
741
|
-
if (envVal === undefined) {
|
|
742
|
-
throw new Error(`Cannot resolve {{totp.${varName}}}: no LT credentials and no TESTMU_TOTP_${varName} env var set`);
|
|
743
|
-
}
|
|
744
|
-
seed = envVal;
|
|
745
|
-
}
|
|
746
|
-
else {
|
|
747
|
-
// GET {ATMS_URL}/api/v1/variables/totp/{name} — resp.json()["data"] is the seed string
|
|
748
|
-
const base = (process.env["ATMS_URL"] ?? "https://test-manager-api.lambdatest.com").replace(/\/$/, "");
|
|
749
|
-
const url = `${base}/api/v1/variables/totp/${encodeURIComponent(varName)}`;
|
|
750
|
-
const resp = await fetchWithAuth(url, { method: "GET" });
|
|
751
|
-
if (!resp.ok)
|
|
752
|
-
throw new Error(`TOTP seed fetch failed for '${varName}': ${resp.status}`);
|
|
753
|
-
const body = (await resp.json());
|
|
754
|
-
seed = body.data;
|
|
755
|
-
}
|
|
756
|
-
return authenticator.generate(seed);
|
|
757
|
-
}
|
|
758
|
-
throw new Error(`Unknown special variable prefix: ${name}`);
|
|
759
|
-
}
|
|
760
|
-
/**
|
|
761
|
-
* Resolve a template value (async — handles both local and HTTP-backed lookups).
|
|
762
|
-
*
|
|
763
|
-
* - {{global.X}} → ATMS or TESTMU_VAR_X fallback
|
|
764
|
-
* - {{environment.X}} → ATMS (with ENVIRONMENT_ID) or TESTMU_VAR_X fallback
|
|
765
|
-
* - {{secrets.cat.KEY}} → process.env[KEY]
|
|
766
|
-
* - {{totp.X}} → ATMS seed + TOTP compute
|
|
767
|
-
* - {{smart.X}} → local computation (no HTTP)
|
|
768
|
-
* - plain {{x}} / ${x} / no template → delegates to module-private _resolveSync
|
|
769
|
-
*/
|
|
770
|
-
/**
|
|
771
|
-
* Public resolver. Escaped placeholders (`\{{x}}` / `\${x}`) are masked before
|
|
772
|
-
* resolution and restored — without the backslash — afterward, so they type
|
|
773
|
-
* literally and never resolve. Masking touches only template spans, never
|
|
774
|
-
* resolved values. (TS has no kane_version fork; this is v4 behavior.)
|
|
775
|
-
*/
|
|
776
|
-
export async function resolveVar(template, opts = {}) {
|
|
777
|
-
if (typeof template !== "string" || !ESCAPED_RE.test(template)) {
|
|
778
|
-
return resolveVarCore(template, opts);
|
|
779
|
-
}
|
|
780
|
-
const masks = [];
|
|
781
|
-
const masked = template.replace(ESCAPED_RE_G, (_m, lit) => {
|
|
782
|
-
masks.push(lit);
|
|
783
|
-
return `\x00ESC${masks.length - 1}\x00`;
|
|
784
|
-
});
|
|
785
|
-
const resolved = await resolveVarCore(masked, opts);
|
|
786
|
-
if (typeof resolved !== "string")
|
|
787
|
-
return resolved;
|
|
788
|
-
let out = resolved;
|
|
789
|
-
masks.forEach((lit, i) => {
|
|
790
|
-
out = out.split(`\x00ESC${i}\x00`).join(lit);
|
|
791
|
-
});
|
|
792
|
-
return out;
|
|
793
|
-
}
|
|
794
|
-
async function resolveVarCore(template, opts = {}) {
|
|
795
|
-
if (typeof template !== "string") {
|
|
796
|
-
// PY parity: _log.info(" [var] template=None → ''") — JS emits typeof
|
|
797
|
-
log.helper(`[var] template=${template === null ? "null" : typeof template} → passthrough`);
|
|
798
|
-
return template;
|
|
799
|
-
}
|
|
800
|
-
const sensitive = _isSensitiveTemplate(template);
|
|
801
|
-
let result;
|
|
802
|
-
// Pure single-placeholder: {{name}}
|
|
803
|
-
const pureName = extractPure(template, MUSTACHE_RE);
|
|
804
|
-
if (pureName !== null) {
|
|
805
|
-
if (pureName.startsWith("smart.")) {
|
|
806
|
-
result = recordRead(pureName, computeSmartVariable(pureName.slice("smart.".length)));
|
|
807
|
-
}
|
|
808
|
-
else if (pureName.startsWith("global.") ||
|
|
809
|
-
pureName.startsWith("environment.") ||
|
|
810
|
-
pureName.startsWith("secrets.") ||
|
|
811
|
-
pureName.startsWith("totp.")) {
|
|
812
|
-
result = await resolveSpecialAsync(pureName);
|
|
813
|
-
}
|
|
814
|
-
else {
|
|
815
|
-
// Delegate to sync path for plain variables (transform applied below).
|
|
816
|
-
result = _resolveSync(template);
|
|
817
|
-
}
|
|
818
|
-
{
|
|
819
|
-
const finalResult = opts.transform ? applyTransform(result, opts.transform) : result;
|
|
820
|
-
const resolvedPreview = sensitive ? "[REDACTED]" : preview(finalResult);
|
|
821
|
-
const transformSuffix = opts.transform !== undefined ? ` transform=${opts.transform}` : "";
|
|
822
|
-
log.helper(`[var] ${preview(template)} → ${resolvedPreview}${transformSuffix}`);
|
|
823
|
-
return finalResult;
|
|
824
|
-
}
|
|
825
|
-
}
|
|
826
|
-
// Pure ${x} — delegate sync (transform applied below).
|
|
827
|
-
const pureDollar = extractPure(template, DOLLAR_RE);
|
|
828
|
-
if (pureDollar !== null) {
|
|
829
|
-
result = _resolveSync(template);
|
|
830
|
-
{
|
|
831
|
-
const finalResult = opts.transform ? applyTransform(result, opts.transform) : result;
|
|
832
|
-
const resolvedPreview = sensitive ? "[REDACTED]" : preview(finalResult);
|
|
833
|
-
const transformSuffix = opts.transform !== undefined ? ` transform=${opts.transform}` : "";
|
|
834
|
-
log.helper(`[var] ${preview(template)} → ${resolvedPreview}${transformSuffix}`);
|
|
835
|
-
return finalResult;
|
|
836
|
-
}
|
|
837
|
-
}
|
|
838
|
-
// Embedded template — resolve {{...}} placeholders asynchronously
|
|
839
|
-
if (!MUSTACHE_RE.test(template) && !DOLLAR_RE.test(template)) {
|
|
840
|
-
// No placeholders → passthrough, no log (PY parity: PY's resolveVar
|
|
841
|
-
// early-returns before logging when there's nothing to resolve).
|
|
842
|
-
return template;
|
|
843
|
-
}
|
|
844
|
-
const matches = [...template.matchAll(MUSTACHE_RE_G)];
|
|
845
|
-
const replacements = [];
|
|
846
|
-
for (const match of matches) {
|
|
847
|
-
const inner = (match[1] ?? "").trim();
|
|
848
|
-
if (inner.startsWith("smart.")) {
|
|
849
|
-
replacements.push(recordRead(inner, computeSmartVariable(inner.slice("smart.".length))));
|
|
850
|
-
}
|
|
851
|
-
else if (inner.startsWith("global.") ||
|
|
852
|
-
inner.startsWith("environment.") ||
|
|
853
|
-
inner.startsWith("secrets.") ||
|
|
854
|
-
inner.startsWith("totp.")) {
|
|
855
|
-
replacements.push(await resolveSpecialAsync(inner));
|
|
856
|
-
}
|
|
857
|
-
else {
|
|
858
|
-
const sync = _resolveSync(`{{${inner}}}`);
|
|
859
|
-
replacements.push(sync === "" ? "" : String(sync));
|
|
860
|
-
}
|
|
861
|
-
}
|
|
862
|
-
let out = template;
|
|
863
|
-
for (let i = 0; i < matches.length; i++) {
|
|
864
|
-
out = out.replace(matches[i][0], replacements[i]);
|
|
865
|
-
}
|
|
866
|
-
// ${...} through sync path
|
|
867
|
-
out = out.replace(DOLLAR_RE_G, (_m, name) => {
|
|
868
|
-
const val = lookupTestParams(name.trim());
|
|
869
|
-
return val === "" ? "" : String(val);
|
|
870
|
-
});
|
|
871
|
-
result = out;
|
|
872
|
-
{
|
|
873
|
-
const finalResult = opts.transform ? applyTransform(result, opts.transform) : result;
|
|
874
|
-
const resolvedPreview = sensitive ? "[REDACTED]" : preview(finalResult);
|
|
875
|
-
const transformSuffix = opts.transform !== undefined ? ` transform=${opts.transform}` : "";
|
|
876
|
-
log.helper(`[var] ${preview(template)} → ${resolvedPreview}${transformSuffix}`);
|
|
877
|
-
return finalResult;
|
|
878
|
-
}
|
|
879
|
-
}
|
|
880
|
-
// ---------------------------------------------------------------------------
|
|
881
|
-
// configure() → vars store wiring (registered once at module load)
|
|
882
|
-
// ---------------------------------------------------------------------------
|
|
883
|
-
_registerConfigureHook((opts) => {
|
|
884
|
-
if (opts.variables) {
|
|
885
|
-
for (const [k, val] of Object.entries(opts.variables))
|
|
886
|
-
setVar(k, val);
|
|
887
|
-
}
|
|
888
|
-
if (opts.testParams) {
|
|
889
|
-
for (const [k, val] of Object.entries(opts.testParams))
|
|
890
|
-
setVar(k, val, { scope: "testParams" });
|
|
891
|
-
}
|
|
892
|
-
if (opts.globalVariables) {
|
|
893
|
-
for (const g of opts.globalVariables)
|
|
894
|
-
_addGlobalVariable(g);
|
|
895
|
-
}
|
|
896
|
-
});
|
|
897
|
-
// ---------------------------------------------------------------------------
|
|
898
|
-
// Condition/Assertion resolver adapter (V3 local-eval)
|
|
899
|
-
// ---------------------------------------------------------------------------
|
|
900
|
-
/**
|
|
901
|
-
* Resolve a template against the testmu variable store.
|
|
902
|
-
*
|
|
903
|
-
* Adapter for the Condition/Assertion `.evaluate(variables, getVariableValue)`
|
|
904
|
-
* callback shape (PY parity: _vars.get_variable_value). Those classes invoke
|
|
905
|
-
* `getVariableValue(template, variables, ...)`; extra args are ignored and
|
|
906
|
-
* substitution delegates to resolveVar. Named export — the generator emits it
|
|
907
|
-
* bare inside condition expressions.
|
|
908
|
-
*/
|
|
909
|
-
export function getVariableValue(template, _variables, ..._args) {
|
|
910
|
-
return resolveVar(template);
|
|
911
|
-
}
|
|
912
|
-
//# sourceMappingURL=vars.js.map
|