doc-detective 4.36.0 → 4.37.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.
- package/bin/runner-entrypoint.js +25 -4
- package/dist/cli.js +9 -0
- package/dist/cli.js.map +1 -1
- package/dist/common/src/schemas/schemas.json +6365 -56
- package/dist/common/src/types/generated/annotate_v3.d.ts +48 -0
- package/dist/common/src/types/generated/annotate_v3.d.ts.map +1 -1
- package/dist/common/src/types/generated/annotation_v3.d.ts +24 -0
- package/dist/common/src/types/generated/annotation_v3.d.ts.map +1 -1
- package/dist/common/src/types/generated/config_v3.d.ts +12 -0
- package/dist/common/src/types/generated/config_v3.d.ts.map +1 -1
- package/dist/common/src/types/generated/context_v3.d.ts +4 -0
- package/dist/common/src/types/generated/context_v3.d.ts.map +1 -1
- package/dist/common/src/types/generated/report_v3.d.ts +12 -0
- package/dist/common/src/types/generated/report_v3.d.ts.map +1 -1
- package/dist/common/src/types/generated/resolvedTests_v3.d.ts +20 -0
- package/dist/common/src/types/generated/resolvedTests_v3.d.ts.map +1 -1
- package/dist/common/src/types/generated/screenshot_v3.d.ts +24 -0
- package/dist/common/src/types/generated/screenshot_v3.d.ts.map +1 -1
- package/dist/common/src/types/generated/spec_v3.d.ts +8 -0
- package/dist/common/src/types/generated/spec_v3.d.ts.map +1 -1
- package/dist/common/src/types/generated/step_v3.d.ts +156 -0
- package/dist/common/src/types/generated/step_v3.d.ts.map +1 -1
- package/dist/common/src/types/generated/test_v3.d.ts +324 -0
- package/dist/common/src/types/generated/test_v3.d.ts.map +1 -1
- package/dist/core/annotations/geometry.d.ts +2 -1
- package/dist/core/annotations/geometry.d.ts.map +1 -1
- package/dist/core/annotations/geometry.js +11 -1
- package/dist/core/annotations/geometry.js.map +1 -1
- package/dist/core/tests.d.ts +6 -1
- package/dist/core/tests.d.ts.map +1 -1
- package/dist/core/tests.js +219 -6
- package/dist/core/tests.js.map +1 -1
- package/dist/core/utils.d.ts +7 -1
- package/dist/core/utils.d.ts.map +1 -1
- package/dist/core/utils.js +141 -2
- package/dist/core/utils.js.map +1 -1
- package/dist/hints/context.d.ts +12 -0
- package/dist/hints/context.d.ts.map +1 -1
- package/dist/hints/context.js +90 -0
- package/dist/hints/context.js.map +1 -1
- package/dist/hints/hints.d.ts.map +1 -1
- package/dist/hints/hints.js +19 -0
- package/dist/hints/hints.js.map +1 -1
- package/dist/hints/types.d.ts +8 -0
- package/dist/hints/types.d.ts.map +1 -1
- package/dist/index.cjs +7056 -589
- package/dist/reporters/htmlReporter.js +3 -3
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +8 -0
- package/dist/utils.js.map +1 -1
- package/package.json +2 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ResolvedAnnotation } from "./model.js";
|
|
2
2
|
import type { PlacedAnnotation, Rect } from "./svg.js";
|
|
3
|
-
export { computeScale, toCanvasRect, positionTargetRect, appCriteriaError, allTargetError, appWindowOrigin, resolveAnnotationRects, APP_UNSUPPORTED_CRITERIA, APP_SUPPORTED_CRITERIA, };
|
|
3
|
+
export { computeScale, toCanvasRect, positionTargetRect, appCriteriaError, allTargetError, appWindowOrigin, criteriaFromTarget, resolveAnnotationRects, APP_UNSUPPORTED_CRITERIA, APP_SUPPORTED_CRITERIA, };
|
|
4
4
|
type Point = {
|
|
5
5
|
x: number;
|
|
6
6
|
y: number;
|
|
@@ -40,6 +40,7 @@ declare function appWindowOrigin(platform: string | undefined, windowRect: {
|
|
|
40
40
|
} | null | undefined): Point;
|
|
41
41
|
declare function appCriteriaError(target: any): string | null;
|
|
42
42
|
declare function allTargetError(target: any, all: boolean, isAppCapture?: boolean): string | null;
|
|
43
|
+
declare function criteriaFromTarget(target: any): any;
|
|
43
44
|
/**
|
|
44
45
|
* Resolve every annotation's target into a rect in the final image.
|
|
45
46
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"geometry.d.ts","sourceRoot":"","sources":["../../../src/core/annotations/geometry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CACrB,MAAM,EAAE,GAAG,EACX,GAAG,EAAE,OAAO,EACZ,YAAY,UAAQ,GACnB,MAAM,GAAG,IAAI,CASf;AAaD,iBAAS,kBAAkB,CAAC,MAAM,EAAE,GAAG,GAAG,GAAG,CAY5C;AAsCD;;;;;;;GAOG;AACH,iBAAe,sBAAsB,CAAC,EACpC,MAAM,EACN,WAAW,EACX,MAAM,EACN,OAAO,EACP,UAAU,EACV,YAAY,EACZ,SAAS,EACT,YAAY,EACZ,MAAM,EACN,KAAK,EACL,UAAU,GACX,EAAE;IACD,MAAM,EAAE,GAAG,CAAC;IACZ,WAAW,EAAE,kBAAkB,EAAE,CAAC;IAClC,MAAM,EAAE,GAAG,CAAC;IACZ,OAAO,CAAC,EAAE,GAAG,CAAC;IAId,UAAU,CAAC,EAAE,GAAG,CAAC;IACjB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,SAAS,CAAC,EAAE,GAAG,CAAC;IAChB,YAAY,CAAC,EAAE,KAAK,CAAC;IACrB,MAAM,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IAC1C,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,KAAK,CAAC;CACpB,GAAG,OAAO,CAAC;IAAE,MAAM,EAAE,gBAAgB,EAAE,CAAC;IAAC,MAAM,EAAE,MAAM,EAAE,CAAA;CAAE,CAAC,CA0G5D"}
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
import { findElement } from "../tests/findElement.js";
|
|
33
33
|
import { findElementByCriteria } from "../tests/findStrategies.js";
|
|
34
34
|
import { anchorPoint } from "./svg.js";
|
|
35
|
-
export { computeScale, toCanvasRect, positionTargetRect, appCriteriaError, allTargetError, appWindowOrigin, resolveAnnotationRects, APP_UNSUPPORTED_CRITERIA, APP_SUPPORTED_CRITERIA, };
|
|
35
|
+
export { computeScale, toCanvasRect, positionTargetRect, appCriteriaError, allTargetError, appWindowOrigin, criteriaFromTarget, resolveAnnotationRects, APP_UNSUPPORTED_CRITERIA, APP_SUPPORTED_CRITERIA, };
|
|
36
36
|
// Criteria with no native-locator equivalent. appSurface.ts maps the semantic
|
|
37
37
|
// fields onto UIA / AX / UiAutomator2 / XCUITest locators, but a CSS selector,
|
|
38
38
|
// a DOM class list, and arbitrary DOM attributes have nothing to map to.
|
|
@@ -159,6 +159,15 @@ function allTargetError(target, all, isAppCapture = false) {
|
|
|
159
159
|
}
|
|
160
160
|
// Turn an annotation target into the criteria object findElement expects.
|
|
161
161
|
// A string target passes straight through as find's selector-or-text shorthand.
|
|
162
|
+
//
|
|
163
|
+
// `timeout` rides along with the finding fields rather than being handled
|
|
164
|
+
// separately, because every consumer below already knows what to do with it:
|
|
165
|
+
// findElement reads `step.find.timeout` on both its browser and app paths, and
|
|
166
|
+
// findElementByCriteria takes it as a parameter. Leaving it out of this list
|
|
167
|
+
// was the only reason annotation targets were pinned to the hardcoded 5000 ms
|
|
168
|
+
// while `find` could ask for longer. Deliberately NOT defaulted here — the
|
|
169
|
+
// number belongs to find, and a copy of it here would be a second thing to
|
|
170
|
+
// keep in sync.
|
|
162
171
|
function criteriaFromTarget(target) {
|
|
163
172
|
if (typeof target === "string")
|
|
164
173
|
return target;
|
|
@@ -170,6 +179,7 @@ function criteriaFromTarget(target) {
|
|
|
170
179
|
elementClass: target?.elementClass,
|
|
171
180
|
elementAttribute: target?.elementAttribute,
|
|
172
181
|
elementAria: target?.elementAria,
|
|
182
|
+
timeout: target?.timeout,
|
|
173
183
|
};
|
|
174
184
|
}
|
|
175
185
|
// Read a browser element's viewport-relative rect. Mirrors the crop path's
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"geometry.js","sourceRoot":"","sources":["../../../src/core/annotations/geometry.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,EAAE;AACF,wEAAwE;AACxE,8EAA8E;AAC9E,wEAAwE;AACxE,aAAa;AACb,EAAE;AACF,gGAAgG;AAChG,0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AK,CAAC,QAAQ,CAAC;QAC5B,CAAC;aAAM,CAAC;YACN,MAAM,UAAU,GAAG,MAAM,WAAW,CAAC;gBACnC,MAAM;gBACN,IAAI,EAAE,EAAE,IAAI,EAAE,kBAAkB,CAAC,MAAM,CAAC,EAAE;gBAC1C,MAAM;aACP,CAAC,CAAC;YACH,MAAM,OAAO,GAAG,UAAU,CAAC,OAAO,EAAE,UAAU,CAAC;YAC/C,IAAI,UAAU,CAAC,MAAM,KAAK,MAAM,IAAI,CAAC,OAAO,EAAE,CAAC;gBAC7C,MAAM,CAAC,IAAI,CACT,0CACE,OAAO,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAC7D,GAAG,CACJ,CAAC;gBACF,SAAS;YACX,CAAC;YACD,QAAQ,GAAG,CAAC,OAAO,CAAC,CAAC;QACvB,CAAC;QAED,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;YAC/B,MAAM,OAAO,GAAG,MAAM,kBAAkB,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;YAC1D,MAAM,CAAC,IAAI,CAAC;gBACV,GAAG,UAAU;gBACb,IAAI,EAAE,YAAY,CAAC,OAAO,EAAE,KAAK,EAAE,UAAU,CAAC;gBAC9C,+DAA+D;gBAC/D,kEAAkE;gBAClE,kEAAkE;gBAClE,+DAA+D;gBAC/D,oDAAoD;gBACpD,OAAO;aACR,CAAC,CAAC;QACL,CAAC;IACH,CAAC;IAED,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC;AAC5B,CAAC"}
|
package/dist/core/tests.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { appSurfacePreflight, type AppSessionState } from "./tests/appSurface.js
|
|
|
3
3
|
import { type ActiveSurfaceTracker } from "./tests/activeSurface.js";
|
|
4
4
|
import { type WarmPlanDeps, type WarmOutcome } from "./warmPhase.js";
|
|
5
5
|
import { acquireDevice, type DeviceRegistry } from "./tests/androidEmulator.js";
|
|
6
|
-
export { runSpecs, runViaApi, getRunner, ensureChromeAvailable, ensureContextBrowserInstalled, combinationKey, warmUpDecision, selectWarmUpTargets, getDriverCapabilities, withChromedriverPort, getDefaultBrowser, buildFallbackCandidates, driverSkipDiagnostic, resolveBrowserFallbackPolicy, shouldRepairBeforeFallback, isSupportedContext, contextRequirementsSkipMessage, resolveAutoScreenshot, resolveAutoRecord, buildAutoRecordStep, specIsRouted, killTree, jobDisplayResources, buildWarmPlanDeps, warmBrowserInstall, prefetchMobileChromedriver, appiumIsReady, };
|
|
6
|
+
export { runSpecs, runViaApi, getRunner, ensureChromeAvailable, ensureContextBrowserInstalled, combinationKey, warmUpDecision, selectWarmUpTargets, getDriverCapabilities, withChromedriverPort, getDefaultBrowser, buildFallbackCandidates, driverSkipDiagnostic, resolveBrowserFallbackPolicy, resolveRetryPolicy, runContextWithRetries, shouldRepairBeforeFallback, isSupportedContext, contextRequirementsSkipMessage, resolveAutoScreenshot, resolveAutoRecord, buildAutoRecordStep, specIsRouted, killTree, jobDisplayResources, buildWarmPlanDeps, warmBrowserInstall, prefetchMobileChromedriver, appiumIsReady, };
|
|
7
7
|
declare function killTree(pid?: number, timeoutMs?: number): Promise<void>;
|
|
8
8
|
/**
|
|
9
9
|
* Stable identity for a "context combination" — the platform + browser pairing
|
|
@@ -92,6 +92,10 @@ declare function resolveBrowserFallbackPolicy({ context, config, }: {
|
|
|
92
92
|
context: any;
|
|
93
93
|
config: any;
|
|
94
94
|
}): string;
|
|
95
|
+
declare function resolveRetryPolicy({ context, config, }: {
|
|
96
|
+
context: any;
|
|
97
|
+
config: any;
|
|
98
|
+
}): number;
|
|
95
99
|
/**
|
|
96
100
|
* Whether to attempt a driver repair before falling back away from a browser
|
|
97
101
|
* whose session just failed to start. We only repair the *requested* engine
|
|
@@ -249,6 +253,7 @@ declare function buildAutoRecordStep({ config, spec, test, context, }: {
|
|
|
249
253
|
test: any;
|
|
250
254
|
context: any;
|
|
251
255
|
}): any | null;
|
|
256
|
+
declare function runContextWithRetries(args: any, runContextFn?: (a: any) => Promise<any>, delayMs?: (attempt: number) => number): Promise<any>;
|
|
252
257
|
declare function runStep({ config, context, step, driver, metaValues, options, processRegistry, appSession, surfaceTracker, }: {
|
|
253
258
|
config?: any;
|
|
254
259
|
context?: any;
|
package/dist/core/tests.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tests.d.ts","sourceRoot":"","sources":["../../src/core/tests.ts"],"names":[],"mappings":"AAcA,OAAO,EAGL,KAAK,gBAAgB,EACtB,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"tests.d.ts","sourceRoot":"","sources":["../../src/core/tests.ts"],"names":[],"mappings":"AAcA,OAAO,EAGL,KAAK,gBAAgB,EACtB,MAAM,wBAAwB,CAAC;AAyEhC,OAAO,EAEL,mBAAmB,EAMnB,KAAK,eAAe,EACrB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAEL,KAAK,oBAAoB,EAC1B,MAAM,0BAA0B,CAAC;AAOlC,OAAO,EAML,KAAK,YAAY,EAEjB,KAAK,WAAW,EACjB,MAAM,gBAAgB,CAAC;AASxB,OAAO,EAOL,aAAa,EAGb,KAAK,cAAc,EACpB,MAAM,4BAA4B,CAAC;AAiDpC,OAAO,EACL,QAAQ,EACR,SAAS,EACT,SAAS,EACT,qBAAqB,EACrB,6BAA6B,EAC7B,cAAc,EACd,cAAc,EACd,mBAAmB,EACnB,qBAAqB,EACrB,oBAAoB,EACpB,iBAAiB,EACjB,uBAAuB,EACvB,oBAAoB,EACpB,4BAA4B,EAC5B,kBAAkB,EAClB,qBAAqB,EACrB,0BAA0B,EAC1B,kBAAkB,EAClB,8BAA8B,EAC9B,qBAAqB,EACrB,iBAAiB,EACjB,mBAAmB,EACnB,YAAY,EACZ,QAAQ,EACR,mBAAmB,EACnB,iBAAiB,EACjB,kBAAkB,EAClB,0BAA0B,EAC1B,aAAa,GACd,CA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AW,EACX,MAAM,EACN,eAAe,EACf,IAAI,EACJ,MAAc,GACf,EAAE;IACD,WAAW,EAAE,MAAM,GAAG,SAAS,CAAC;IAChC,MAAM,EAAE,GAAG,CAAC;IACZ,eAAe,EAAE,GAAG,CAAC,MAAM,EAAE,WAAW,GAAG,QAAQ,GAAG,gBAAgB,CAAC,CAAC;IACxE,IAAI,EAAE;QACJ,aAAa,EAAE,CAAC,KAAK,EAAE,gBAAgB,EAAE,OAAO,EAAE,GAAG,KAAK,OAAO,CAAC,GAAG,CAAC,CAAC;QACvE,GAAG,CAAC,EAAE,CAAC,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;KACzD,CAAC;IAOF,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB,GAAG,OAAO,CAAC,WAAW,GAAG,QAAQ,GAAG,gBAAgB,CAAC,CA4CrD;AAED,iBAAe,SAAS,CAAC,OAAO,GAAE,GAAQ;;;;;GAoHzC"}
|
package/dist/core/tests.js
CHANGED
|
@@ -15,7 +15,7 @@ import { requiredBrowserAssets, ensureBrowserInstalled, } from "../runtime/brows
|
|
|
15
15
|
// Single source of truth for browser/driver-requiring step keys.
|
|
16
16
|
import { BROWSER_STEP_KEYS as driverActions, startSurfaceDescriptors, stepOpensBrowserSurface, stepTargetsProcessSurface, stepIsSurfacelessInteraction, testHasNonBrowserSurfaceSignal, } from "../runtime/browserStepKeys.js";
|
|
17
17
|
import os from "node:os";
|
|
18
|
-
import { log, logLevelEnabled, replaceEnvs, selectSpecsForRun, findFreePort, runConcurrent, runResourceAware, createResourceRegistry, rollUpResults, createAppiumPool, getRunOutputDir, runArchivesArtifacts, sanitizeFilesystemName, evaluateContextRequirements, isRetryableSessionError, realizeViewport, isViewportFloored, } from "./utils.js";
|
|
18
|
+
import { log, logLevelEnabled, replaceEnvs, selectSpecsForRun, findFreePort, runConcurrent, runResourceAware, createResourceRegistry, rollUpResults, createAppiumPool, getRunOutputDir, runArchivesArtifacts, sanitizeFilesystemName, evaluateContextRequirements, isRetryableSessionError, classifyContextRetry, realizeViewport, isViewportFloored, } from "./utils.js";
|
|
19
19
|
import axios from "axios";
|
|
20
20
|
import { instantiateCursor } from "./tests/moveTo.js";
|
|
21
21
|
import { goTo } from "./tests/goTo.js";
|
|
@@ -65,7 +65,7 @@ import http from "node:http";
|
|
|
65
65
|
import https from "node:https";
|
|
66
66
|
import { fileURLToPath } from "node:url";
|
|
67
67
|
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
68
|
-
export { runSpecs, runViaApi, getRunner, ensureChromeAvailable, ensureContextBrowserInstalled, combinationKey, warmUpDecision, selectWarmUpTargets, getDriverCapabilities, withChromedriverPort, getDefaultBrowser, buildFallbackCandidates, driverSkipDiagnostic, resolveBrowserFallbackPolicy, shouldRepairBeforeFallback, isSupportedContext, contextRequirementsSkipMessage, resolveAutoScreenshot, resolveAutoRecord, buildAutoRecordStep, specIsRouted, killTree, jobDisplayResources, buildWarmPlanDeps, warmBrowserInstall, prefetchMobileChromedriver, appiumIsReady, };
|
|
68
|
+
export { runSpecs, runViaApi, getRunner, ensureChromeAvailable, ensureContextBrowserInstalled, combinationKey, warmUpDecision, selectWarmUpTargets, getDriverCapabilities, withChromedriverPort, getDefaultBrowser, buildFallbackCandidates, driverSkipDiagnostic, resolveBrowserFallbackPolicy, resolveRetryPolicy, runContextWithRetries, shouldRepairBeforeFallback, isSupportedContext, contextRequirementsSkipMessage, resolveAutoScreenshot, resolveAutoRecord, buildAutoRecordStep, specIsRouted, killTree, jobDisplayResources, buildWarmPlanDeps, warmBrowserInstall, prefetchMobileChromedriver, appiumIsReady, };
|
|
69
69
|
// exports.driverStart = driverStart;
|
|
70
70
|
// Browser names getDriverCapabilities knows how to build caps for. `safari` is
|
|
71
71
|
// rewritten to `webkit` during context resolution, so both appear here.
|
|
@@ -859,6 +859,14 @@ function buildFallbackCandidates({ requestedName, explicit, policy, availableApp
|
|
|
859
859
|
function resolveBrowserFallbackPolicy({ context, config, }) {
|
|
860
860
|
return context?.browserFallback || config?.browserFallback || "auto";
|
|
861
861
|
}
|
|
862
|
+
// Resolve the mid-run session-death context-retry budget (the `retries` policy):
|
|
863
|
+
// how many times to re-run a whole context on a fresh session when its session
|
|
864
|
+
// dies mid-run. Context overrides config; default 1. Uses `??` (NOT `||`) so an
|
|
865
|
+
// explicit `retries: 0` (disable) is preserved instead of falling through to the
|
|
866
|
+
// default the way a falsy `||` would. Pure and exported for unit testing.
|
|
867
|
+
function resolveRetryPolicy({ context, config, }) {
|
|
868
|
+
return context?.retries ?? config?.retries ?? 1;
|
|
869
|
+
}
|
|
862
870
|
/**
|
|
863
871
|
* Whether to attempt a driver repair before falling back away from a browser
|
|
864
872
|
* whose session just failed to start. We only repair the *requested* engine
|
|
@@ -967,6 +975,8 @@ async function runViaApi({ resolvedTests, apiKey, config = {} }) {
|
|
|
967
975
|
contexts: { pass: 0, fail: 0, warning: 0, skipped: 0 },
|
|
968
976
|
steps: { pass: 0, fail: 0, warning: 0, skipped: 0 },
|
|
969
977
|
},
|
|
978
|
+
// Nothing ran, but the shape stays parity with runSpecs' short-circuit.
|
|
979
|
+
durationMs: 0,
|
|
970
980
|
specs: [],
|
|
971
981
|
};
|
|
972
982
|
}
|
|
@@ -1084,6 +1094,14 @@ async function runViaApi({ resolvedTests, apiKey, config = {} }) {
|
|
|
1084
1094
|
*/
|
|
1085
1095
|
async function runSpecs({ resolvedTests }) {
|
|
1086
1096
|
const config = resolvedTests.config;
|
|
1097
|
+
// Run-level wall clock, scoped to the EXECUTION phase — detection,
|
|
1098
|
+
// resolution, and JIT dependency installs happen in runTests before this
|
|
1099
|
+
// point and are deliberately excluded (see ADR 01083). Started before the
|
|
1100
|
+
// filter short-circuit so a zero-spec run reports a real (tiny) duration
|
|
1101
|
+
// rather than omitting the field. Unlike the spec/test sums, this IS elapsed
|
|
1102
|
+
// time — so under concurrency it can be LESS than the sum of the per-spec
|
|
1103
|
+
// durations.
|
|
1104
|
+
const runStart = Date.now();
|
|
1087
1105
|
// Narrow the spec set to what specFilter / testFilter allow before running.
|
|
1088
1106
|
// Filtered-out specs / tests do not appear in the report (true filter, not
|
|
1089
1107
|
// skip). Pass-through when neither filter is set.
|
|
@@ -1104,6 +1122,7 @@ async function runSpecs({ resolvedTests }) {
|
|
|
1104
1122
|
contexts: { pass: 0, fail: 0, warning: 0, skipped: 0 },
|
|
1105
1123
|
steps: { pass: 0, fail: 0, warning: 0, skipped: 0 },
|
|
1106
1124
|
},
|
|
1125
|
+
durationMs: Date.now() - runStart,
|
|
1107
1126
|
specs: [],
|
|
1108
1127
|
};
|
|
1109
1128
|
}
|
|
@@ -1632,7 +1651,7 @@ async function runSpecs({ resolvedTests }) {
|
|
|
1632
1651
|
// ordering to a single pool over input-ordered jobs.
|
|
1633
1652
|
const runJob = async (job) => {
|
|
1634
1653
|
try {
|
|
1635
|
-
job.contexts[job.slot] = await
|
|
1654
|
+
job.contexts[job.slot] = await runContextWithRetries({
|
|
1636
1655
|
config,
|
|
1637
1656
|
spec: job.spec,
|
|
1638
1657
|
test: job.test,
|
|
@@ -1738,7 +1757,9 @@ async function runSpecs({ resolvedTests }) {
|
|
|
1738
1757
|
// Phase 3: roll results up the tree and count the summary in one
|
|
1739
1758
|
// deterministic pass after all contexts have finished.
|
|
1740
1759
|
for (const specReport of report.specs) {
|
|
1760
|
+
let specDurationMs = 0;
|
|
1741
1761
|
for (const testReport of specReport.tests) {
|
|
1762
|
+
let testDurationMs = 0;
|
|
1742
1763
|
for (const contextReport of testReport.contexts) {
|
|
1743
1764
|
// Every slot is assigned by the pool callback (even on crash), so
|
|
1744
1765
|
// this guard should never fire — it documents the invariant and
|
|
@@ -1747,13 +1768,30 @@ async function runSpecs({ resolvedTests }) {
|
|
|
1747
1768
|
continue;
|
|
1748
1769
|
for (const stepReport of contextReport.steps) {
|
|
1749
1770
|
report.summary.steps[stepReport.result.toLowerCase()]++;
|
|
1771
|
+
// Default here rather than at each construction site: this pass is
|
|
1772
|
+
// the only place that sees EVERY node from both execution paths
|
|
1773
|
+
// (flat pool and routed sequencer), real and synthetic alike. A
|
|
1774
|
+
// node that never ran — a guard-skipped context, a routing marker
|
|
1775
|
+
// — has no clock, and a future synthetic site can't forget the
|
|
1776
|
+
// field. Nodes that ran keep their measured value (ADR 01083).
|
|
1777
|
+
stepReport.durationMs ??= 0;
|
|
1750
1778
|
}
|
|
1751
1779
|
report.summary.contexts[contextReport.result.toLowerCase()]++;
|
|
1780
|
+
contextReport.durationMs ??= 0;
|
|
1781
|
+
testDurationMs += contextReport.durationMs;
|
|
1752
1782
|
}
|
|
1753
1783
|
testReport.result = rollUpResults(testReport.contexts.filter(Boolean));
|
|
1784
|
+
// Test and spec durations are SUMS of their children, not wall-clock
|
|
1785
|
+
// spans: contexts from every test and spec share one concurrent pool,
|
|
1786
|
+
// so a span would count idle time while unrelated specs ran. The sum
|
|
1787
|
+
// is total work — what slow-test triage and JUnit's `<testsuite time>`
|
|
1788
|
+
// both want. See ADR 01083.
|
|
1789
|
+
testReport.durationMs = testDurationMs;
|
|
1790
|
+
specDurationMs += testDurationMs;
|
|
1754
1791
|
report.summary.tests[testReport.result.toLowerCase()]++;
|
|
1755
1792
|
}
|
|
1756
1793
|
specReport.result = rollUpResults(specReport.tests);
|
|
1794
|
+
specReport.durationMs = specDurationMs;
|
|
1757
1795
|
report.summary.specs[specReport.result.toLowerCase()]++;
|
|
1758
1796
|
}
|
|
1759
1797
|
}
|
|
@@ -1830,6 +1868,9 @@ async function runSpecs({ resolvedTests }) {
|
|
|
1830
1868
|
};
|
|
1831
1869
|
}
|
|
1832
1870
|
}
|
|
1871
|
+
// Stamped last, after teardown and any Heretto upload, so the number matches
|
|
1872
|
+
// the elapsed time a user actually observes.
|
|
1873
|
+
report.durationMs = Date.now() - runStart;
|
|
1833
1874
|
return report;
|
|
1834
1875
|
}
|
|
1835
1876
|
/**
|
|
@@ -2017,7 +2058,7 @@ async function runRoutedSpec({ spec, specReport, specGuardSkip, config, runnerDe
|
|
|
2017
2058
|
// limit===1 keep the byte-identical runConcurrent path.
|
|
2018
2059
|
const runRoutedJob = async (job) => {
|
|
2019
2060
|
try {
|
|
2020
|
-
job.contexts[job.slot] = await
|
|
2061
|
+
job.contexts[job.slot] = await runContextWithRetries({
|
|
2021
2062
|
config,
|
|
2022
2063
|
spec: job.spec,
|
|
2023
2064
|
test: job.test,
|
|
@@ -3300,6 +3341,10 @@ async function runContext({ config, spec, test, context, runnerDetails, appiumPo
|
|
|
3300
3341
|
// WARNING when an explicitly pinned engine was substituted.
|
|
3301
3342
|
let fellBackNote = "";
|
|
3302
3343
|
let fellBackPinned = false;
|
|
3344
|
+
// Set by the post-loop liveness probe: true when the context failed AND its
|
|
3345
|
+
// session was found dead mid-run. The caller (runContextWithRetries) reads
|
|
3346
|
+
// this off the returned report to decide whether to retry on a fresh session.
|
|
3347
|
+
let sessionDiedMidRun = false;
|
|
3303
3348
|
if (driverRequired && !appiumPool) {
|
|
3304
3349
|
throw new Error("Browser driver requested but no Appium server pool was created; " +
|
|
3305
3350
|
"the pool sizing (browserJobCount) and this context's isBrowserRequired " +
|
|
@@ -3864,6 +3909,7 @@ async function runContext({ config, spec, test, context, runnerDetails, appiumPo
|
|
|
3864
3909
|
// it. Surface-less browser steps in that (pathological) state fail on the
|
|
3865
3910
|
// dead session — acceptable; the run closed its own browser mid-test.
|
|
3866
3911
|
const runStepOnce = async () => {
|
|
3912
|
+
const stepStart = Date.now();
|
|
3867
3913
|
const r = await runStep({
|
|
3868
3914
|
config: config,
|
|
3869
3915
|
context: context,
|
|
@@ -3884,7 +3930,12 @@ async function runContext({ config, spec, test, context, runnerDetails, appiumPo
|
|
|
3884
3930
|
r.resultDescription = r.description;
|
|
3885
3931
|
delete r.status;
|
|
3886
3932
|
delete r.description;
|
|
3887
|
-
|
|
3933
|
+
// Stamp AFTER the spread: `step` may carry an authored `duration`
|
|
3934
|
+
// input (a click's press duration, an annotation's display duration),
|
|
3935
|
+
// and `r` is the runStep result — neither may clobber the timing.
|
|
3936
|
+
// On retry the loop below discards this report wholesale, so the
|
|
3937
|
+
// surviving value is the FINAL attempt's, per ADR 01083.
|
|
3938
|
+
return { ...step, ...r, durationMs: Date.now() - stepStart };
|
|
3888
3939
|
};
|
|
3889
3940
|
// Run the step, then resolve routing. A `retry` decision re-runs the step
|
|
3890
3941
|
// (up to `limit` retries — so `limit + 1` total runs — waiting `delay`
|
|
@@ -4055,6 +4106,59 @@ async function runContext({ config, spec, test, context, runnerDetails, appiumPo
|
|
|
4055
4106
|
contextReport,
|
|
4056
4107
|
});
|
|
4057
4108
|
}
|
|
4109
|
+
// Mid-run session-death detection for the `retries` context-retry policy.
|
|
4110
|
+
// A dead session's step FAIL is indistinguishable from a real assertion FAIL
|
|
4111
|
+
// at the result level (handlers catch driver errors and return FAIL), so if
|
|
4112
|
+
// any step failed we probe the session directly here — while it is still
|
|
4113
|
+
// registered, before the finally tears it down. A dead session means the
|
|
4114
|
+
// FAIL is spurious and the whole context can be retried on a fresh session; a
|
|
4115
|
+
// live session means the FAIL is real and stands. Recording sweeps already
|
|
4116
|
+
// ran above, so the probe never races an in-flight capture.
|
|
4117
|
+
if (contextReport.steps.some((s) => s.result === "FAIL")) {
|
|
4118
|
+
// Collect EVERY session the context holds — a multi-surface browser
|
|
4119
|
+
// context plus an app session — not just the first, so a dead app/native
|
|
4120
|
+
// session behind a live browser (or vice versa) is still caught. Which of
|
|
4121
|
+
// these each check applies to differs, and classifyContextRetry owns that
|
|
4122
|
+
// distinction. Primary session first (Map values() is insertion-ordered).
|
|
4123
|
+
const probeDrivers = sessionDrivers(browserSessions, driver);
|
|
4124
|
+
if (appSession?.recordingHost)
|
|
4125
|
+
probeDrivers.push(appSession.recordingHost);
|
|
4126
|
+
// Which sessions each probe applies to, and how they rank, lives in
|
|
4127
|
+
// classifyContextRetry so it can be unit tested without a real context.
|
|
4128
|
+
// A dead session is the silent case: it needs no explanation beyond the
|
|
4129
|
+
// retry warning the wrapper already logs. The alive-but-unusable cases do,
|
|
4130
|
+
// because "the session responded and we retried anyway" is otherwise
|
|
4131
|
+
// surprising in a log.
|
|
4132
|
+
const retryReason = await classifyContextRetry(probeDrivers);
|
|
4133
|
+
if (retryReason) {
|
|
4134
|
+
sessionDiedMidRun = true;
|
|
4135
|
+
if (retryReason === "page-broken") {
|
|
4136
|
+
clog("debug", "Context session is alive but on a browser error page; treating it as a broken context for retry.");
|
|
4137
|
+
}
|
|
4138
|
+
else if (retryReason === "unnavigated") {
|
|
4139
|
+
clog("debug", "Context session is alive but still on its initial blank document (never navigated); treating it as a broken context for retry.");
|
|
4140
|
+
}
|
|
4141
|
+
}
|
|
4142
|
+
if (!sessionDiedMidRun &&
|
|
4143
|
+
probeDrivers.length > 0 &&
|
|
4144
|
+
logLevelEnabled(config, "debug") &&
|
|
4145
|
+
typeof probeDrivers[0].getUrl === "function") {
|
|
4146
|
+
// Diagnostic for whatever live-session modes remain uncovered: log the
|
|
4147
|
+
// page URL of a live-session FAIL that was NOT retried. This is how the
|
|
4148
|
+
// long-running `windows-chrome` flake was characterized — every
|
|
4149
|
+
// occurrence, across both the recording and nav-capture bundles, logged
|
|
4150
|
+
// `url=data:,`, which ADR 01084 now retries. What's left for it to catch
|
|
4151
|
+
// is the same-URL-blank mode (page blanks without changing URL), which
|
|
4152
|
+
// stays unretried because it can't be told apart from a genuine
|
|
4153
|
+
// element-not-found on a correctly-loaded page.
|
|
4154
|
+
try {
|
|
4155
|
+
clog("debug", `Context FAILed on a live, non-error-page session (url=${await probeDrivers[0].getUrl()}); not retried.`);
|
|
4156
|
+
}
|
|
4157
|
+
catch {
|
|
4158
|
+
/* best-effort diagnostic */
|
|
4159
|
+
}
|
|
4160
|
+
}
|
|
4161
|
+
}
|
|
4058
4162
|
}
|
|
4059
4163
|
finally {
|
|
4060
4164
|
// Safety net: if the context threw before the normal sweep above, recordings
|
|
@@ -4140,8 +4244,108 @@ async function runContext({ config, spec, test, context, runnerDetails, appiumPo
|
|
|
4140
4244
|
? `${fellBackNote} ${contextReport.resultDescription}`
|
|
4141
4245
|
: fellBackNote;
|
|
4142
4246
|
}
|
|
4247
|
+
// Internal hint for runContextWithRetries — a FAIL whose session died mid-run
|
|
4248
|
+
// is retryable. Non-enumerable so it never leaks into the serialized report,
|
|
4249
|
+
// and only set on the retryable case so the wrapper's check is a plain read.
|
|
4250
|
+
if (contextReport.result === "FAIL" && sessionDiedMidRun) {
|
|
4251
|
+
Object.defineProperty(contextReport, "_sessionDied", {
|
|
4252
|
+
value: true,
|
|
4253
|
+
enumerable: false,
|
|
4254
|
+
configurable: true,
|
|
4255
|
+
});
|
|
4256
|
+
}
|
|
4143
4257
|
return contextReport;
|
|
4144
4258
|
}
|
|
4259
|
+
// Context fields runContext mutates non-idempotently: `openApi` appends the
|
|
4260
|
+
// config's definitions, and `browser` narrows to a fallback engine/headless
|
|
4261
|
+
// mode. A retry re-invokes runContext, so these are snapshotted and restored
|
|
4262
|
+
// before each attempt (`__display`/`__displaySize` too, so a retry re-resolves
|
|
4263
|
+
// them rather than reusing a stale display) — everything else runContext derives
|
|
4264
|
+
// fresh (contextReport is rebuilt each call; step IDs assign idempotently).
|
|
4265
|
+
const RUN_CONTEXT_MUTATED_KEYS = ["openApi", "browser", "__display", "__displaySize"];
|
|
4266
|
+
// SHALLOW clone — one level. Sufficient for the current RUN_CONTEXT_MUTATED_KEYS
|
|
4267
|
+
// (`openApi` entries are appended, never mutated in place; `browser`/`__display*`
|
|
4268
|
+
// are flat). If a future mutated field nests a value that runContext mutates *in
|
|
4269
|
+
// place*, the snapshot and the live context would share that nested reference and
|
|
4270
|
+
// restore wouldn't protect it — deepen this (or that key's snapshot) then.
|
|
4271
|
+
function cloneMutable(value) {
|
|
4272
|
+
if (Array.isArray(value))
|
|
4273
|
+
return [...value];
|
|
4274
|
+
if (value && typeof value === "object")
|
|
4275
|
+
return { ...value };
|
|
4276
|
+
return value;
|
|
4277
|
+
}
|
|
4278
|
+
// Runs a context and retries the WHOLE context on a fresh session when its
|
|
4279
|
+
// session dies mid-run — an early step passes, then a later step fails on a
|
|
4280
|
+
// now-dead session (WebDriver ECONNREFUSED / invalid session id, or an element
|
|
4281
|
+
// that can't be found because the DOM is dead). Bounded by the resolved
|
|
4282
|
+
// `retries` policy (config/context, default 1). Detection is runContext's active
|
|
4283
|
+
// liveness probe, surfaced as the non-enumerable `_sessionDied` flag on a FAIL
|
|
4284
|
+
// report, so a live-session assertion FAIL is NEVER retried — a real bug still
|
|
4285
|
+
// fails all attempts. Retrying re-invokes runContext, which re-runs setup,
|
|
4286
|
+
// re-provisions every session, and restarts recordings cleanly; the job keeps
|
|
4287
|
+
// its concurrency slot and any exclusive resource (display / native-app-driver /
|
|
4288
|
+
// android-emulator), so only the Appium pool port churns. `runContextFn` is
|
|
4289
|
+
// injectable for unit testing. Exported for that test.
|
|
4290
|
+
async function runContextWithRetries(args, runContextFn = runContext,
|
|
4291
|
+
// Backoff before each retry. Injectable so unit tests pass `() => 0` instead
|
|
4292
|
+
// of paying the real 500ms-per-attempt sleep.
|
|
4293
|
+
delayMs = (attempt) => 500 * (attempt + 1)) {
|
|
4294
|
+
const { context, config } = args;
|
|
4295
|
+
// Time each attempt here rather than inside runContext: runContext has a
|
|
4296
|
+
// dozen exits (eleven early `requires`/preflight SKIPPED returns plus the
|
|
4297
|
+
// normal one), and this wrapper is its only caller, so one clock here stamps
|
|
4298
|
+
// every one of them. A retried context keeps the FINAL attempt's elapsed
|
|
4299
|
+
// time — the attempt the reported `result` describes (ADR 01083).
|
|
4300
|
+
const timedRunContext = async (a) => {
|
|
4301
|
+
const start = Date.now();
|
|
4302
|
+
const report = await runContextFn(a);
|
|
4303
|
+
if (report && typeof report === "object") {
|
|
4304
|
+
report.durationMs = Date.now() - start;
|
|
4305
|
+
}
|
|
4306
|
+
return report;
|
|
4307
|
+
};
|
|
4308
|
+
const retries = resolveRetryPolicy({ context, config });
|
|
4309
|
+
if (!(retries > 0))
|
|
4310
|
+
return timedRunContext(args);
|
|
4311
|
+
// Snapshot the non-idempotent context fields so each retry starts from the
|
|
4312
|
+
// originally-requested state instead of the prior attempt's narrowed one.
|
|
4313
|
+
const had = {};
|
|
4314
|
+
const snapshot = {};
|
|
4315
|
+
for (const key of RUN_CONTEXT_MUTATED_KEYS) {
|
|
4316
|
+
had[key] = key in context;
|
|
4317
|
+
if (had[key])
|
|
4318
|
+
snapshot[key] = cloneMutable(context[key]);
|
|
4319
|
+
}
|
|
4320
|
+
const restore = () => {
|
|
4321
|
+
for (const key of RUN_CONTEXT_MUTATED_KEYS) {
|
|
4322
|
+
if (!had[key])
|
|
4323
|
+
delete context[key];
|
|
4324
|
+
else
|
|
4325
|
+
context[key] = cloneMutable(snapshot[key]);
|
|
4326
|
+
}
|
|
4327
|
+
};
|
|
4328
|
+
let report;
|
|
4329
|
+
let attempt = 0;
|
|
4330
|
+
for (;; attempt++) {
|
|
4331
|
+
report = await timedRunContext(args);
|
|
4332
|
+
const retryable = report?.result === "FAIL" && report?._sessionDied === true;
|
|
4333
|
+
if (!retryable || attempt >= retries)
|
|
4334
|
+
break;
|
|
4335
|
+
log(config, "warning", `Context '${context?.contextId}' session died mid-run; retrying on a fresh session (attempt ${attempt + 2} of ${retries + 1}).`);
|
|
4336
|
+
restore();
|
|
4337
|
+
// Linear backoff (mirrors driverStart's session-creation retry) so a
|
|
4338
|
+
// transient runner blip has a moment to clear before the fresh session.
|
|
4339
|
+
await new Promise((resolve) => setTimeout(resolve, delayMs(attempt)));
|
|
4340
|
+
}
|
|
4341
|
+
// Surface how many retries were spent, so a report consumer can tell a clean
|
|
4342
|
+
// PASS from one recovered after a mid-run session death (the warning log alone
|
|
4343
|
+
// isn't machine-readable). Stamped only when a retry actually happened.
|
|
4344
|
+
if (attempt > 0 && report && typeof report === "object") {
|
|
4345
|
+
report.retries = attempt;
|
|
4346
|
+
}
|
|
4347
|
+
return report;
|
|
4348
|
+
}
|
|
4145
4349
|
// Every live session driver in the context, falling back to the lone default
|
|
4146
4350
|
// driver when no registry exists (driver-start throw, or a driverless
|
|
4147
4351
|
// context). Recording sweeps iterate this — recordings live per session.
|
|
@@ -4177,6 +4381,10 @@ async function stopAllRecordings({ config, context, driver, contextReport, }) {
|
|
|
4177
4381
|
description: "Stopping recording",
|
|
4178
4382
|
stepId: randomUUID(),
|
|
4179
4383
|
};
|
|
4384
|
+
// These sweep steps really execute, so they carry a measured duration
|
|
4385
|
+
// rather than the Phase-3 zero default. Timed in both the success and the
|
|
4386
|
+
// failure path, so a stop that hangs before throwing still shows its cost.
|
|
4387
|
+
const stopStart = Date.now();
|
|
4180
4388
|
try {
|
|
4181
4389
|
const stepResult = await runStep({
|
|
4182
4390
|
config,
|
|
@@ -4191,7 +4399,11 @@ async function stopAllRecordings({ config, context, driver, contextReport, }) {
|
|
|
4191
4399
|
delete stepResult.description;
|
|
4192
4400
|
// Don't leak the internal routing marker into the report.
|
|
4193
4401
|
delete stopRecordStep.__stopAny;
|
|
4194
|
-
contextReport.steps.push({
|
|
4402
|
+
contextReport.steps.push({
|
|
4403
|
+
...stopRecordStep,
|
|
4404
|
+
...stepResult,
|
|
4405
|
+
durationMs: Date.now() - stopStart,
|
|
4406
|
+
});
|
|
4195
4407
|
}
|
|
4196
4408
|
catch (error) {
|
|
4197
4409
|
// A throw from runStep would otherwise strand the remaining handles.
|
|
@@ -4202,6 +4414,7 @@ async function stopAllRecordings({ config, context, driver, contextReport, }) {
|
|
|
4202
4414
|
...stopRecordStep,
|
|
4203
4415
|
result: "FAIL",
|
|
4204
4416
|
resultDescription: `Couldn't stop recording. ${error?.message ?? error}`,
|
|
4417
|
+
durationMs: Date.now() - stopStart,
|
|
4205
4418
|
});
|
|
4206
4419
|
}
|
|
4207
4420
|
}
|