@e2edev/e2e 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +104 -0
- package/dist/agent/act-validation.d.ts +27 -0
- package/dist/agent/act-validation.d.ts.map +1 -0
- package/dist/agent/act-validation.js +121 -0
- package/dist/agent/act-validation.js.map +1 -0
- package/dist/agent/act.d.ts +27 -0
- package/dist/agent/act.d.ts.map +1 -0
- package/dist/agent/act.js +775 -0
- package/dist/agent/act.js.map +1 -0
- package/dist/agent/actions.d.ts +66 -0
- package/dist/agent/actions.d.ts.map +1 -0
- package/dist/agent/actions.js +82 -0
- package/dist/agent/actions.js.map +1 -0
- package/dist/agent/ai-sdk.d.ts +16 -0
- package/dist/agent/ai-sdk.d.ts.map +1 -0
- package/dist/agent/ai-sdk.js +59 -0
- package/dist/agent/ai-sdk.js.map +1 -0
- package/dist/agent/call-options.d.ts +10 -0
- package/dist/agent/call-options.d.ts.map +1 -0
- package/dist/agent/call-options.js +28 -0
- package/dist/agent/call-options.js.map +1 -0
- package/dist/agent/default-agent.d.ts +22 -0
- package/dist/agent/default-agent.d.ts.map +1 -0
- package/dist/agent/default-agent.js +354 -0
- package/dist/agent/default-agent.js.map +1 -0
- package/dist/agent/error.d.ts +53 -0
- package/dist/agent/error.d.ts.map +1 -0
- package/dist/agent/error.js +94 -0
- package/dist/agent/error.js.map +1 -0
- package/dist/agent/executor.d.ts +238 -0
- package/dist/agent/executor.d.ts.map +1 -0
- package/dist/agent/executor.js +56 -0
- package/dist/agent/executor.js.map +1 -0
- package/dist/agent/index.d.ts +15 -0
- package/dist/agent/index.d.ts.map +1 -0
- package/dist/agent/index.js +304 -0
- package/dist/agent/index.js.map +1 -0
- package/dist/agent/invocation.d.ts +194 -0
- package/dist/agent/invocation.d.ts.map +1 -0
- package/dist/agent/invocation.js +389 -0
- package/dist/agent/invocation.js.map +1 -0
- package/dist/agent/ledger.d.ts +24 -0
- package/dist/agent/ledger.d.ts.map +1 -0
- package/dist/agent/ledger.js +48 -0
- package/dist/agent/ledger.js.map +1 -0
- package/dist/agent/loop-guards.d.ts +35 -0
- package/dist/agent/loop-guards.d.ts.map +1 -0
- package/dist/agent/loop-guards.js +110 -0
- package/dist/agent/loop-guards.js.map +1 -0
- package/dist/agent/model/adapter.d.ts +97 -0
- package/dist/agent/model/adapter.d.ts.map +1 -0
- package/dist/agent/model/adapter.js +40 -0
- package/dist/agent/model/adapter.js.map +1 -0
- package/dist/agent/model/router.d.ts +36 -0
- package/dist/agent/model/router.d.ts.map +1 -0
- package/dist/agent/model/router.js +45 -0
- package/dist/agent/model/router.js.map +1 -0
- package/dist/agent/model/schema.d.ts +16 -0
- package/dist/agent/model/schema.d.ts.map +1 -0
- package/dist/agent/model/schema.js +37 -0
- package/dist/agent/model/schema.js.map +1 -0
- package/dist/agent/model/sdk.d.ts +28 -0
- package/dist/agent/model/sdk.d.ts.map +1 -0
- package/dist/agent/model/sdk.js +258 -0
- package/dist/agent/model/sdk.js.map +1 -0
- package/dist/agent/observation.d.ts +70 -0
- package/dist/agent/observation.d.ts.map +1 -0
- package/dist/agent/observation.js +174 -0
- package/dist/agent/observation.js.map +1 -0
- package/dist/agent/phases.d.ts +71 -0
- package/dist/agent/phases.d.ts.map +1 -0
- package/dist/agent/phases.js +124 -0
- package/dist/agent/phases.js.map +1 -0
- package/dist/agent/prompts.d.ts +40 -0
- package/dist/agent/prompts.d.ts.map +1 -0
- package/dist/agent/prompts.js +104 -0
- package/dist/agent/prompts.js.map +1 -0
- package/dist/agent/protocol.d.ts +31 -0
- package/dist/agent/protocol.d.ts.map +1 -0
- package/dist/agent/protocol.js +67 -0
- package/dist/agent/protocol.js.map +1 -0
- package/dist/agent/public.d.ts +12 -0
- package/dist/agent/public.d.ts.map +1 -0
- package/dist/agent/public.js +12 -0
- package/dist/agent/public.js.map +1 -0
- package/dist/agent/replay.d.ts +61 -0
- package/dist/agent/replay.d.ts.map +1 -0
- package/dist/agent/replay.js +185 -0
- package/dist/agent/replay.js.map +1 -0
- package/dist/agent/secrets.d.ts +22 -0
- package/dist/agent/secrets.d.ts.map +1 -0
- package/dist/agent/secrets.js +63 -0
- package/dist/agent/secrets.js.map +1 -0
- package/dist/agent/step-cache.d.ts +156 -0
- package/dist/agent/step-cache.d.ts.map +1 -0
- package/dist/agent/step-cache.js +301 -0
- package/dist/agent/step-cache.js.map +1 -0
- package/dist/agent/tool-loop.d.ts +51 -0
- package/dist/agent/tool-loop.d.ts.map +1 -0
- package/dist/agent/tool-loop.js +331 -0
- package/dist/agent/tool-loop.js.map +1 -0
- package/dist/agent/tool.d.ts +39 -0
- package/dist/agent/tool.d.ts.map +1 -0
- package/dist/agent/tool.js +52 -0
- package/dist/agent/tool.js.map +1 -0
- package/dist/backend/contract.d.ts +186 -0
- package/dist/backend/contract.d.ts.map +1 -0
- package/dist/backend/contract.js +65 -0
- package/dist/backend/contract.js.map +1 -0
- package/dist/backend/index.d.ts +316 -0
- package/dist/backend/index.d.ts.map +1 -0
- package/dist/backend/index.js +219 -0
- package/dist/backend/index.js.map +1 -0
- package/dist/backend/session.d.ts +23 -0
- package/dist/backend/session.d.ts.map +1 -0
- package/dist/backend/session.js +213 -0
- package/dist/backend/session.js.map +1 -0
- package/dist/backend/surface.d.ts +83 -0
- package/dist/backend/surface.d.ts.map +1 -0
- package/dist/backend/surface.js +11 -0
- package/dist/backend/surface.js.map +1 -0
- package/dist/cache/anchors.d.ts +37 -0
- package/dist/cache/anchors.d.ts.map +1 -0
- package/dist/cache/anchors.js +89 -0
- package/dist/cache/anchors.js.map +1 -0
- package/dist/cache/context.d.ts +74 -0
- package/dist/cache/context.d.ts.map +1 -0
- package/dist/cache/context.js +82 -0
- package/dist/cache/context.js.map +1 -0
- package/dist/cache/decide.d.ts +42 -0
- package/dist/cache/decide.d.ts.map +1 -0
- package/dist/cache/decide.js +47 -0
- package/dist/cache/decide.js.map +1 -0
- package/dist/cache/identity.d.ts +113 -0
- package/dist/cache/identity.d.ts.map +1 -0
- package/dist/cache/identity.js +109 -0
- package/dist/cache/identity.js.map +1 -0
- package/dist/cache/recorder.d.ts +76 -0
- package/dist/cache/recorder.d.ts.map +1 -0
- package/dist/cache/recorder.js +143 -0
- package/dist/cache/recorder.js.map +1 -0
- package/dist/cache/relocate.d.ts +69 -0
- package/dist/cache/relocate.d.ts.map +1 -0
- package/dist/cache/relocate.js +125 -0
- package/dist/cache/relocate.js.map +1 -0
- package/dist/cache/store.d.ts +68 -0
- package/dist/cache/store.d.ts.map +1 -0
- package/dist/cache/store.js +106 -0
- package/dist/cache/store.js.map +1 -0
- package/dist/cache/trace.d.ts +146 -0
- package/dist/cache/trace.d.ts.map +1 -0
- package/dist/cache/trace.js +249 -0
- package/dist/cache/trace.js.map +1 -0
- package/dist/cli/bin.d.ts +3 -0
- package/dist/cli/bin.d.ts.map +1 -0
- package/dist/cli/bin.js +4 -0
- package/dist/cli/bin.js.map +1 -0
- package/dist/cli/index.d.ts +4 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +108 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cli/init.d.ts +6 -0
- package/dist/cli/init.d.ts.map +1 -0
- package/dist/cli/init.js +101 -0
- package/dist/cli/init.js.map +1 -0
- package/dist/collect/collect.d.ts +44 -0
- package/dist/collect/collect.d.ts.map +1 -0
- package/dist/collect/collect.js +89 -0
- package/dist/collect/collect.js.map +1 -0
- package/dist/collect/registry.d.ts +47 -0
- package/dist/collect/registry.d.ts.map +1 -0
- package/dist/collect/registry.js +262 -0
- package/dist/collect/registry.js.map +1 -0
- package/dist/collect/select.d.ts +54 -0
- package/dist/collect/select.d.ts.map +1 -0
- package/dist/collect/select.js +230 -0
- package/dist/collect/select.js.map +1 -0
- package/dist/config/agent.d.ts +91 -0
- package/dist/config/agent.d.ts.map +1 -0
- package/dist/config/agent.js +232 -0
- package/dist/config/agent.js.map +1 -0
- package/dist/config/load.d.ts +23 -0
- package/dist/config/load.d.ts.map +1 -0
- package/dist/config/load.js +75 -0
- package/dist/config/load.js.map +1 -0
- package/dist/config/resolve.d.ts +94 -0
- package/dist/config/resolve.d.ts.map +1 -0
- package/dist/config/resolve.js +500 -0
- package/dist/config/resolve.js.map +1 -0
- package/dist/config/validate.d.ts +6 -0
- package/dist/config/validate.d.ts.map +1 -0
- package/dist/config/validate.js +21 -0
- package/dist/config/validate.js.map +1 -0
- package/dist/credentials.d.ts +7 -0
- package/dist/credentials.d.ts.map +1 -0
- package/dist/credentials.js +42 -0
- package/dist/credentials.js.map +1 -0
- package/dist/expect/async.d.ts +5 -0
- package/dist/expect/async.d.ts.map +1 -0
- package/dist/expect/async.js +186 -0
- package/dist/expect/async.js.map +1 -0
- package/dist/expect/index.d.ts +7 -0
- package/dist/expect/index.d.ts.map +1 -0
- package/dist/expect/index.js +23 -0
- package/dist/expect/index.js.map +1 -0
- package/dist/expect/values.d.ts +4 -0
- package/dist/expect/values.d.ts.map +1 -0
- package/dist/expect/values.js +108 -0
- package/dist/expect/values.js.map +1 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +15 -0
- package/dist/index.js.map +1 -0
- package/dist/internal/ai-trace.d.ts +151 -0
- package/dist/internal/ai-trace.d.ts.map +1 -0
- package/dist/internal/ai-trace.js +360 -0
- package/dist/internal/ai-trace.js.map +1 -0
- package/dist/internal/brands.d.ts +9 -0
- package/dist/internal/brands.d.ts.map +1 -0
- package/dist/internal/brands.js +9 -0
- package/dist/internal/brands.js.map +1 -0
- package/dist/internal/debug.d.ts +43 -0
- package/dist/internal/debug.d.ts.map +1 -0
- package/dist/internal/debug.js +102 -0
- package/dist/internal/debug.js.map +1 -0
- package/dist/internal/errors.d.ts +98 -0
- package/dist/internal/errors.d.ts.map +1 -0
- package/dist/internal/errors.js +212 -0
- package/dist/internal/errors.js.map +1 -0
- package/dist/internal/globs.d.ts +29 -0
- package/dist/internal/globs.d.ts.map +1 -0
- package/dist/internal/globs.js +126 -0
- package/dist/internal/globs.js.map +1 -0
- package/dist/internal/ids.d.ts +32 -0
- package/dist/internal/ids.d.ts.map +1 -0
- package/dist/internal/ids.js +124 -0
- package/dist/internal/ids.js.map +1 -0
- package/dist/internal/json-value.d.ts +15 -0
- package/dist/internal/json-value.d.ts.map +1 -0
- package/dist/internal/json-value.js +61 -0
- package/dist/internal/json-value.js.map +1 -0
- package/dist/internal/package-version.d.ts +6 -0
- package/dist/internal/package-version.d.ts.map +1 -0
- package/dist/internal/package-version.js +14 -0
- package/dist/internal/package-version.js.map +1 -0
- package/dist/internal/realm-slot.d.ts +13 -0
- package/dist/internal/realm-slot.d.ts.map +1 -0
- package/dist/internal/realm-slot.js +23 -0
- package/dist/internal/realm-slot.js.map +1 -0
- package/dist/internal/redact.d.ts +33 -0
- package/dist/internal/redact.d.ts.map +1 -0
- package/dist/internal/redact.js +56 -0
- package/dist/internal/redact.js.map +1 -0
- package/dist/internal/regexp.d.ts +10 -0
- package/dist/internal/regexp.d.ts.map +1 -0
- package/dist/internal/regexp.js +27 -0
- package/dist/internal/regexp.js.map +1 -0
- package/dist/internal/text.d.ts +39 -0
- package/dist/internal/text.d.ts.map +1 -0
- package/dist/internal/text.js +66 -0
- package/dist/internal/text.js.map +1 -0
- package/dist/internal/time.d.ts +37 -0
- package/dist/internal/time.d.ts.map +1 -0
- package/dist/internal/time.js +91 -0
- package/dist/internal/time.js.map +1 -0
- package/dist/internal/trace.d.ts +18 -0
- package/dist/internal/trace.d.ts.map +1 -0
- package/dist/internal/trace.js +46 -0
- package/dist/internal/trace.js.map +1 -0
- package/dist/internal/urls.d.ts +31 -0
- package/dist/internal/urls.d.ts.map +1 -0
- package/dist/internal/urls.js +95 -0
- package/dist/internal/urls.js.map +1 -0
- package/dist/locator/engine.d.ts +65 -0
- package/dist/locator/engine.d.ts.map +1 -0
- package/dist/locator/engine.js +164 -0
- package/dist/locator/engine.js.map +1 -0
- package/dist/locator/expression.d.ts +19 -0
- package/dist/locator/expression.d.ts.map +1 -0
- package/dist/locator/expression.js +85 -0
- package/dist/locator/expression.js.map +1 -0
- package/dist/locator/screen.d.ts +36 -0
- package/dist/locator/screen.d.ts.map +1 -0
- package/dist/locator/screen.js +281 -0
- package/dist/locator/screen.js.map +1 -0
- package/dist/report/build.d.ts +214 -0
- package/dist/report/build.d.ts.map +1 -0
- package/dist/report/build.js +346 -0
- package/dist/report/build.js.map +1 -0
- package/dist/report/code-frame.d.ts +20 -0
- package/dist/report/code-frame.d.ts.map +1 -0
- package/dist/report/code-frame.js +73 -0
- package/dist/report/code-frame.js.map +1 -0
- package/dist/report/debug-steps.d.ts +14 -0
- package/dist/report/debug-steps.d.ts.map +1 -0
- package/dist/report/debug-steps.js +85 -0
- package/dist/report/debug-steps.js.map +1 -0
- package/dist/report/list.d.ts +80 -0
- package/dist/report/list.d.ts.map +1 -0
- package/dist/report/list.js +372 -0
- package/dist/report/list.js.map +1 -0
- package/dist/report/live-status.d.ts +51 -0
- package/dist/report/live-status.d.ts.map +1 -0
- package/dist/report/live-status.js +162 -0
- package/dist/report/live-status.js.map +1 -0
- package/dist/report/write.d.ts +4 -0
- package/dist/report/write.d.ts.map +1 -0
- package/dist/report/write.js +13 -0
- package/dist/report/write.js.map +1 -0
- package/dist/run/app-process.d.ts +18 -0
- package/dist/run/app-process.d.ts.map +1 -0
- package/dist/run/app-process.js +112 -0
- package/dist/run/app-process.js.map +1 -0
- package/dist/run/artifacts.d.ts +51 -0
- package/dist/run/artifacts.d.ts.map +1 -0
- package/dist/run/artifacts.js +114 -0
- package/dist/run/artifacts.js.map +1 -0
- package/dist/run/events.d.ts +100 -0
- package/dist/run/events.d.ts.map +1 -0
- package/dist/run/events.js +59 -0
- package/dist/run/events.js.map +1 -0
- package/dist/run/execute.d.ts +119 -0
- package/dist/run/execute.d.ts.map +1 -0
- package/dist/run/execute.js +555 -0
- package/dist/run/execute.js.map +1 -0
- package/dist/run/fixtures.d.ts +40 -0
- package/dist/run/fixtures.d.ts.map +1 -0
- package/dist/run/fixtures.js +408 -0
- package/dist/run/fixtures.js.map +1 -0
- package/dist/run/in-process.d.ts +24 -0
- package/dist/run/in-process.d.ts.map +1 -0
- package/dist/run/in-process.js +120 -0
- package/dist/run/in-process.js.map +1 -0
- package/dist/run/public.d.ts +19 -0
- package/dist/run/public.d.ts.map +1 -0
- package/dist/run/public.js +11 -0
- package/dist/run/public.js.map +1 -0
- package/dist/run/realm.d.ts +52 -0
- package/dist/run/realm.d.ts.map +1 -0
- package/dist/run/realm.js +101 -0
- package/dist/run/realm.js.map +1 -0
- package/dist/run/records.d.ts +87 -0
- package/dist/run/records.d.ts.map +1 -0
- package/dist/run/records.js +3 -0
- package/dist/run/records.js.map +1 -0
- package/dist/run/retry.d.ts +18 -0
- package/dist/run/retry.d.ts.map +1 -0
- package/dist/run/retry.js +33 -0
- package/dist/run/retry.js.map +1 -0
- package/dist/run/runner.d.ts +49 -0
- package/dist/run/runner.d.ts.map +1 -0
- package/dist/run/runner.js +375 -0
- package/dist/run/runner.js.map +1 -0
- package/dist/run/scheduler.d.ts +45 -0
- package/dist/run/scheduler.d.ts.map +1 -0
- package/dist/run/scheduler.js +512 -0
- package/dist/run/scheduler.js.map +1 -0
- package/dist/run/serial.d.ts +52 -0
- package/dist/run/serial.d.ts.map +1 -0
- package/dist/run/serial.js +247 -0
- package/dist/run/serial.js.map +1 -0
- package/dist/run/sessions.d.ts +54 -0
- package/dist/run/sessions.d.ts.map +1 -0
- package/dist/run/sessions.js +221 -0
- package/dist/run/sessions.js.map +1 -0
- package/dist/run/steps.d.ts +196 -0
- package/dist/run/steps.d.ts.map +1 -0
- package/dist/run/steps.js +151 -0
- package/dist/run/steps.js.map +1 -0
- package/dist/run/unit-runner.d.ts +30 -0
- package/dist/run/unit-runner.d.ts.map +1 -0
- package/dist/run/unit-runner.js +11 -0
- package/dist/run/unit-runner.js.map +1 -0
- package/dist/run/units.d.ts +50 -0
- package/dist/run/units.d.ts.map +1 -0
- package/dist/run/units.js +103 -0
- package/dist/run/units.js.map +1 -0
- package/dist/run/worker/entry.d.ts +8 -0
- package/dist/run/worker/entry.d.ts.map +1 -0
- package/dist/run/worker/entry.js +137 -0
- package/dist/run/worker/entry.js.map +1 -0
- package/dist/run/worker/handle.d.ts +10 -0
- package/dist/run/worker/handle.d.ts.map +1 -0
- package/dist/run/worker/handle.js +74 -0
- package/dist/run/worker/handle.js.map +1 -0
- package/dist/run/worker/protocol.d.ts +129 -0
- package/dist/run/worker/protocol.d.ts.map +1 -0
- package/dist/run/worker/protocol.js +18 -0
- package/dist/run/worker/protocol.js.map +1 -0
- package/dist/run/worker/session.d.ts +69 -0
- package/dist/run/worker/session.d.ts.map +1 -0
- package/dist/run/worker/session.js +123 -0
- package/dist/run/worker/session.js.map +1 -0
- package/dist/types.d.ts +630 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +6 -0
- package/dist/types.js.map +1 -0
- package/package.json +91 -0
|
@@ -0,0 +1,281 @@
|
|
|
1
|
+
/** Public Screen and Locator surfaces bound to one attempt. */
|
|
2
|
+
import nodePath from 'node:path';
|
|
3
|
+
import { locatorBrand, secretBrand } from '../internal/brands.js';
|
|
4
|
+
import { ConfigurationError, TestError } from '../internal/errors.js';
|
|
5
|
+
import { realmSlot } from '../internal/realm-slot.js';
|
|
6
|
+
import { normalizeText } from '../internal/text.js';
|
|
7
|
+
import { isNodeVisible } from './engine.js';
|
|
8
|
+
import { describeExpression, filterExpression, indexExpression, roleQuery, testIdQuery, textQuery, } from './expression.js';
|
|
9
|
+
import { Deadline, POLL_INTERVAL_MS, pollCondition, sleep } from '../internal/time.js';
|
|
10
|
+
export function isSecret(value) {
|
|
11
|
+
return (typeof value === 'object' &&
|
|
12
|
+
value !== null &&
|
|
13
|
+
value[secretBrand] === true);
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Internals hang off the locator object itself under a global symbol so that
|
|
17
|
+
* an expect() imported in an isolated test-module realm can still reach them.
|
|
18
|
+
*/
|
|
19
|
+
const internalsSlot = realmSlot('e2e.locatorInternals.v1');
|
|
20
|
+
export function locatorInternals(locator) {
|
|
21
|
+
if (typeof locator !== 'object' || locator === null)
|
|
22
|
+
return undefined;
|
|
23
|
+
if (locator[locatorBrand] !== true)
|
|
24
|
+
return undefined;
|
|
25
|
+
return internalsSlot.get(locator);
|
|
26
|
+
}
|
|
27
|
+
/** Creates the screen fixture for one attempt. */
|
|
28
|
+
export function createScreen(context) {
|
|
29
|
+
return new ScreenImpl(context, undefined);
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Creates a screen scope whose every query is wrapped by `wrap` - a
|
|
33
|
+
* contributed fixture scoping queries into a nested document, for example.
|
|
34
|
+
*/
|
|
35
|
+
export function createScopedScreen(context, wrap) {
|
|
36
|
+
return new ScreenImpl(context, undefined, wrap);
|
|
37
|
+
}
|
|
38
|
+
/** Creates a public locator from a raw expression (a contributed fixture's platform selector). */
|
|
39
|
+
export function createLocator(context, expression) {
|
|
40
|
+
return new LocatorImpl(context, expression);
|
|
41
|
+
}
|
|
42
|
+
class ScreenImpl {
|
|
43
|
+
context;
|
|
44
|
+
scope;
|
|
45
|
+
wrap;
|
|
46
|
+
constructor(context, scope,
|
|
47
|
+
/** When set, every query expression is passed through it before use. */
|
|
48
|
+
wrap = undefined) {
|
|
49
|
+
this.context = context;
|
|
50
|
+
this.scope = scope;
|
|
51
|
+
this.wrap = wrap;
|
|
52
|
+
}
|
|
53
|
+
build(expression) {
|
|
54
|
+
return this.wrap === undefined ? expression : this.wrap(expression);
|
|
55
|
+
}
|
|
56
|
+
getByRole(role, options) {
|
|
57
|
+
return new LocatorImpl(this.context, this.build(roleQuery(role, options, this.scope)));
|
|
58
|
+
}
|
|
59
|
+
getByLabel(text, options) {
|
|
60
|
+
return new LocatorImpl(this.context, this.build(textQuery('label', text, options, this.scope)));
|
|
61
|
+
}
|
|
62
|
+
getByPlaceholder(text, options) {
|
|
63
|
+
return new LocatorImpl(this.context, this.build(textQuery('placeholder', text, options, this.scope)));
|
|
64
|
+
}
|
|
65
|
+
getByText(text, options) {
|
|
66
|
+
return new LocatorImpl(this.context, this.build(textQuery('text', text, options, this.scope)));
|
|
67
|
+
}
|
|
68
|
+
getByDisplayValue(value, options) {
|
|
69
|
+
return new LocatorImpl(this.context, this.build(textQuery('displayValue', value, options, this.scope)));
|
|
70
|
+
}
|
|
71
|
+
getByTestId(id) {
|
|
72
|
+
return new LocatorImpl(this.context, this.build(testIdQuery(id, this.scope)));
|
|
73
|
+
}
|
|
74
|
+
async swipe(options) {
|
|
75
|
+
await this.context.steps.run('screen', 'screen.swipe', options.direction, async () => {
|
|
76
|
+
const { engine } = this.context;
|
|
77
|
+
await engine.session.swipe(options.direction, options.momentum, engine.operation());
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
async scrollUntilVisible(target, options) {
|
|
81
|
+
const internals = locatorInternals(target);
|
|
82
|
+
if (internals === undefined) {
|
|
83
|
+
throw new TestError('INVALID_LOCATOR', 'scrollUntilVisible requires an e2e locator');
|
|
84
|
+
}
|
|
85
|
+
const direction = options?.direction ?? 'down';
|
|
86
|
+
await this.context.steps.run('screen', 'screen.scrollUntilVisible', describeExpression(internals.expression), async () => {
|
|
87
|
+
const { engine } = this.context;
|
|
88
|
+
const deadline = engine.deadline(options?.timeout ?? 30_000);
|
|
89
|
+
for (;;) {
|
|
90
|
+
const { node } = await engine.tryRead(internals.expression, deadline);
|
|
91
|
+
if (isNodeVisible(node))
|
|
92
|
+
return;
|
|
93
|
+
if (deadline.expired()) {
|
|
94
|
+
throw new TestError('LOCATOR_NOT_FOUND', `target did not become visible while scrolling: ${describeExpression(internals.expression)}`);
|
|
95
|
+
}
|
|
96
|
+
await engine.session.swipe(direction, 'slow', engine.operation());
|
|
97
|
+
await sleep(POLL_INTERVAL_MS, engine.signal);
|
|
98
|
+
}
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
class LocatorImpl extends ScreenImpl {
|
|
103
|
+
expression;
|
|
104
|
+
[locatorBrand] = true;
|
|
105
|
+
constructor(context, expression) {
|
|
106
|
+
super(context, expression);
|
|
107
|
+
this.expression = expression;
|
|
108
|
+
internalsSlot.set(this, { expression, context });
|
|
109
|
+
}
|
|
110
|
+
get label() {
|
|
111
|
+
return describeExpression(this.expression);
|
|
112
|
+
}
|
|
113
|
+
action(api, body) {
|
|
114
|
+
return this.context.steps.run('locator', api, this.label, body);
|
|
115
|
+
}
|
|
116
|
+
tap(options) {
|
|
117
|
+
return this.action('locator.tap', () => this.context.engine.perform(this.expression, { kind: 'tap' }, options?.timeout));
|
|
118
|
+
}
|
|
119
|
+
click(options) {
|
|
120
|
+
return this.action('locator.click', () => this.context.engine.perform(this.expression, { kind: 'tap' }, options?.timeout));
|
|
121
|
+
}
|
|
122
|
+
doubleTap(options) {
|
|
123
|
+
return this.action('locator.doubleTap', () => this.context.engine.perform(this.expression, { kind: 'doubleTap' }, options?.timeout));
|
|
124
|
+
}
|
|
125
|
+
longPress(options) {
|
|
126
|
+
const durationMs = validateLongPress(options?.durationMs);
|
|
127
|
+
return this.action('locator.longPress', () => this.context.engine.perform(this.expression, { kind: 'longPress', durationMs }, options?.timeout));
|
|
128
|
+
}
|
|
129
|
+
fill(value, options) {
|
|
130
|
+
const sensitive = isSecret(value);
|
|
131
|
+
// Resolved inside the recorded step, so a failing provider fails the fill.
|
|
132
|
+
return this.action('locator.fill', async () => this.context.engine.perform(this.expression, {
|
|
133
|
+
kind: 'fill',
|
|
134
|
+
value: sensitive ? await this.context.secrets.resolve(value) : value,
|
|
135
|
+
sensitive,
|
|
136
|
+
}, options?.timeout));
|
|
137
|
+
}
|
|
138
|
+
clear(options) {
|
|
139
|
+
return this.action('locator.clear', () => this.context.engine.perform(this.expression, { kind: 'clear' }, options?.timeout));
|
|
140
|
+
}
|
|
141
|
+
press(key, options) {
|
|
142
|
+
return this.action('locator.press', () => this.context.engine.perform(this.expression, { kind: 'press', key }, options?.timeout));
|
|
143
|
+
}
|
|
144
|
+
check(options) {
|
|
145
|
+
return this.action('locator.check', () => this.context.engine.perform(this.expression, { kind: 'check' }, options?.timeout));
|
|
146
|
+
}
|
|
147
|
+
uncheck(options) {
|
|
148
|
+
return this.action('locator.uncheck', () => this.context.engine.perform(this.expression, { kind: 'uncheck' }, options?.timeout));
|
|
149
|
+
}
|
|
150
|
+
selectOption(value, options) {
|
|
151
|
+
return this.action('locator.selectOption', () => this.context.engine.perform(this.expression, { kind: 'selectOption', value }, options?.timeout));
|
|
152
|
+
}
|
|
153
|
+
focus(options) {
|
|
154
|
+
return this.action('locator.focus', () => this.context.engine.perform(this.expression, { kind: 'focus' }, options?.timeout));
|
|
155
|
+
}
|
|
156
|
+
hover(options) {
|
|
157
|
+
return this.action('locator.hover', () => this.context.engine.perform(this.expression, { kind: 'hover' }, options?.timeout));
|
|
158
|
+
}
|
|
159
|
+
setInputFiles(paths, options) {
|
|
160
|
+
const list = typeof paths === 'string' ? [paths] : [...paths];
|
|
161
|
+
if (list.length === 0 || list.some((entry) => typeof entry !== 'string' || entry.trim() === '')) {
|
|
162
|
+
throw new TestError('INVALID_ARGUMENT', 'setInputFiles requires one or more non-empty paths');
|
|
163
|
+
}
|
|
164
|
+
const base = this.context.projectRoot;
|
|
165
|
+
const resolved = list.map((entry) => (base === undefined ? entry : nodePath.resolve(base, entry)));
|
|
166
|
+
return this.action('locator.setInputFiles', () => this.context.engine.perform(this.expression, { kind: 'setInputFiles', paths: resolved }, options?.timeout));
|
|
167
|
+
}
|
|
168
|
+
dragTo(target, options) {
|
|
169
|
+
const internals = locatorInternals(target);
|
|
170
|
+
if (internals === undefined) {
|
|
171
|
+
throw new TestError('INVALID_LOCATOR', 'dragTo requires an e2e locator target');
|
|
172
|
+
}
|
|
173
|
+
// The drop target resolves inside the retry, so a superseded target ref
|
|
174
|
+
// is re-resolved along with the source instead of looping until timeout.
|
|
175
|
+
return this.action('locator.dragTo', () => this.context.engine.perform(this.expression, async (deadline) => ({
|
|
176
|
+
kind: 'dragTo',
|
|
177
|
+
target: await this.context.engine.resolveExactlyOne(internals.expression, deadline),
|
|
178
|
+
}), options?.timeout));
|
|
179
|
+
}
|
|
180
|
+
scrollIntoView(options) {
|
|
181
|
+
return this.action('locator.scrollIntoView', () => this.context.engine.perform(this.expression, { kind: 'scrollIntoView' }, options?.timeout));
|
|
182
|
+
}
|
|
183
|
+
swipe(options) {
|
|
184
|
+
return this.action('locator.swipe', () => this.context.engine.perform(this.expression, { kind: 'swipe', direction: options.direction, ...(options.momentum !== undefined ? { momentum: options.momentum } : {}) }, options.timeout));
|
|
185
|
+
}
|
|
186
|
+
async textContent() {
|
|
187
|
+
const node = await this.readGuarded();
|
|
188
|
+
if (node.text === undefined)
|
|
189
|
+
return null;
|
|
190
|
+
return normalizeText(node.text);
|
|
191
|
+
}
|
|
192
|
+
async inputValue() {
|
|
193
|
+
const node = await this.readGuarded();
|
|
194
|
+
return node.value ?? '';
|
|
195
|
+
}
|
|
196
|
+
async getAttribute(name) {
|
|
197
|
+
const node = await this.readGuarded();
|
|
198
|
+
return node.attributes?.[name] ?? null;
|
|
199
|
+
}
|
|
200
|
+
async isVisible() {
|
|
201
|
+
return isNodeVisible(await this.readOptional());
|
|
202
|
+
}
|
|
203
|
+
async isEnabled() {
|
|
204
|
+
const node = await this.readGuarded(false);
|
|
205
|
+
return node.states?.disabled !== true;
|
|
206
|
+
}
|
|
207
|
+
async isChecked() {
|
|
208
|
+
const node = await this.readGuarded(false);
|
|
209
|
+
return node.states?.checked === true;
|
|
210
|
+
}
|
|
211
|
+
async boundingBox() {
|
|
212
|
+
const node = await this.readGuarded(false);
|
|
213
|
+
return node.rect ?? null;
|
|
214
|
+
}
|
|
215
|
+
async count() {
|
|
216
|
+
const refs = await this.context.engine.resolveAll(this.expression);
|
|
217
|
+
return refs.length;
|
|
218
|
+
}
|
|
219
|
+
async waitFor(options) {
|
|
220
|
+
const state = options?.state ?? 'visible';
|
|
221
|
+
await this.context.steps.run('locator', 'locator.waitFor', `${this.label} → ${state}`, async () => {
|
|
222
|
+
const { engine } = this.context;
|
|
223
|
+
const deadline = engine.deadline(options?.timeout);
|
|
224
|
+
await pollCondition({
|
|
225
|
+
deadline,
|
|
226
|
+
signal: engine.signal,
|
|
227
|
+
negated: false,
|
|
228
|
+
evaluate: async () => {
|
|
229
|
+
const { node } = await engine.tryRead(this.expression, deadline);
|
|
230
|
+
const visible = isNodeVisible(node);
|
|
231
|
+
return state === 'visible' ? visible : !visible;
|
|
232
|
+
},
|
|
233
|
+
onTimeout: () => new TestError('LOCATOR_NOT_FOUND', `locator did not become ${state}: ${this.label}`),
|
|
234
|
+
});
|
|
235
|
+
}, { verifies: true });
|
|
236
|
+
}
|
|
237
|
+
filter(options) {
|
|
238
|
+
let hasExpression;
|
|
239
|
+
if (options.has !== undefined) {
|
|
240
|
+
const internals = locatorInternals(options.has);
|
|
241
|
+
if (internals === undefined) {
|
|
242
|
+
throw new TestError('INVALID_LOCATOR', 'filter({ has }) requires an e2e locator');
|
|
243
|
+
}
|
|
244
|
+
hasExpression = internals.expression;
|
|
245
|
+
}
|
|
246
|
+
return new LocatorImpl(this.context, filterExpression(this.expression, {
|
|
247
|
+
...(options.hasText !== undefined ? { hasText: options.hasText } : {}),
|
|
248
|
+
...(hasExpression !== undefined ? { has: hasExpression } : {}),
|
|
249
|
+
}));
|
|
250
|
+
}
|
|
251
|
+
first() {
|
|
252
|
+
return new LocatorImpl(this.context, indexExpression(this.expression, 'first'));
|
|
253
|
+
}
|
|
254
|
+
last() {
|
|
255
|
+
return new LocatorImpl(this.context, indexExpression(this.expression, 'last'));
|
|
256
|
+
}
|
|
257
|
+
nth(index) {
|
|
258
|
+
return new LocatorImpl(this.context, indexExpression(this.expression, index));
|
|
259
|
+
}
|
|
260
|
+
async readGuarded(guardSecure = true) {
|
|
261
|
+
const node = await this.context.engine.read(this.expression);
|
|
262
|
+
if (guardSecure && node.states?.secure === true) {
|
|
263
|
+
throw new ConfigurationError('POLICY_DENIED', `reading values from a secure field is denied: ${this.label}`);
|
|
264
|
+
}
|
|
265
|
+
return node;
|
|
266
|
+
}
|
|
267
|
+
async readOptional() {
|
|
268
|
+
const deadline = new Deadline(0);
|
|
269
|
+
const { node } = await this.context.engine.tryRead(this.expression, deadline);
|
|
270
|
+
return node;
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
/** Validates the shared long-press duration bound (spec 02-test-api.md). */
|
|
274
|
+
function validateLongPress(durationMs) {
|
|
275
|
+
const value = durationMs ?? 500;
|
|
276
|
+
if (!Number.isInteger(value) || value < 100 || value > 10_000) {
|
|
277
|
+
throw new TestError('INVALID_ARGUMENT', `longPress durationMs must be an integer from 100 through 10000, got ${String(durationMs)}`);
|
|
278
|
+
}
|
|
279
|
+
return value;
|
|
280
|
+
}
|
|
281
|
+
//# sourceMappingURL=screen.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"screen.js","sourceRoot":"","sources":["../../src/locator/screen.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAE/D,OAAO,QAAQ,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAClE,OAAO,EAAE,kBAAkB,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AACtE,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAcpD,OAAO,EAAE,aAAa,EAAsB,MAAM,aAAa,CAAC;AAChE,OAAO,EACL,kBAAkB,EAClB,gBAAgB,EAChB,eAAe,EACf,SAAS,EACT,WAAW,EACX,SAAS,GACV,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,QAAQ,EAAE,gBAAgB,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAkBvF,MAAM,UAAU,QAAQ,CAAC,KAAc;IACrC,OAAO,CACL,OAAO,KAAK,KAAK,QAAQ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CAAC,IAAI,CAAC,UAAU,EAAE,KAAK,CAAC,CAAC,CAAC;IAChF,CAAC;IAEO,KAAK,CAAC,WAAW,CAAC,WAAW,GAAG,IAAI;QAC1C,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QAC7D,IAAI,WAAW,IAAI,IAAI,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,EAAE,CAAC;YAChD,MAAM,IAAI,kBAAkB,CAC1B,eAAe,EACf,iDAAiD,IAAI,CAAC,KAAK,EAAE,CAC9D,CAAC;QACJ,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IAEO,KAAK,CAAC,YAAY;QACxB,MAAM,QAAQ,GAAG,IAAI,QAAQ,CAAC,CAAC,CAAC,CAAC;QACjC,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;QAC9E,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AAED,4EAA4E;AAC5E,SAAS,iBAAiB,CAAC,UAA8B;IACvD,MAAM,KAAK,GAAG,UAAU,IAAI,GAAG,CAAC;IAChC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,KAAK,GAAG,GAAG,IAAI,KAAK,GAAG,MAAM,EAAE,CAAC;QAC9D,MAAM,IAAI,SAAS,CACjB,kBAAkB,EAClB,uEAAuE,MAAM,CAAC,UAAU,CAAC,EAAE,CAC5F,CAAC;IACJ,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC"}
|
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
/** report-1 document construction (spec 13-reporting.md). */
|
|
2
|
+
import { type BackendSpiVersion } from '../backend/contract.ts';
|
|
3
|
+
import type { ResolvedConfig, ResolvedLimits, ResolvedTarget } from '../config/resolve.ts';
|
|
4
|
+
import type { ErrorCategory, ErrorPhase } from '../internal/errors.ts';
|
|
5
|
+
import type { SkipInfo } from '../collect/select.ts';
|
|
6
|
+
import type { ArtifactRecord, AttemptRecord, ResultRecord, RunError, SerialGroupRecord, SerialMemberRecord } from '../run/records.ts';
|
|
7
|
+
import type { StepCacheInfo, StepEvent, StepMetrics, StepModelInfo, StepRecord, VisionDegradation } from '../run/steps.ts';
|
|
8
|
+
export interface ReportSource {
|
|
9
|
+
file: string;
|
|
10
|
+
line: number;
|
|
11
|
+
column: number;
|
|
12
|
+
}
|
|
13
|
+
export interface TargetProvenance {
|
|
14
|
+
backend: {
|
|
15
|
+
name: string;
|
|
16
|
+
version: string;
|
|
17
|
+
spiVersion: BackendSpiVersion;
|
|
18
|
+
};
|
|
19
|
+
capabilities: string[];
|
|
20
|
+
artifactCapabilities: ('screenshot' | 'trace')[];
|
|
21
|
+
stateCapability: boolean;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* What a target's backend declaration says about it: the one description the
|
|
25
|
+
* runner grades against and the report records. A target without a backend is
|
|
26
|
+
* agent-tools-only and honestly reports no capabilities.
|
|
27
|
+
*/
|
|
28
|
+
export declare function describeTarget(target: ResolvedTarget): TargetProvenance;
|
|
29
|
+
export interface BuildReportOptions {
|
|
30
|
+
runId: string;
|
|
31
|
+
config: ResolvedConfig | undefined;
|
|
32
|
+
startedAt: string;
|
|
33
|
+
status: 'passed' | 'failed' | 'error' | 'interrupted';
|
|
34
|
+
exitCode: 0 | 1 | 2 | 3 | 4 | 130;
|
|
35
|
+
results: readonly ResultRecord[];
|
|
36
|
+
serialGroups: readonly SerialGroupRecord[];
|
|
37
|
+
runErrors: readonly RunError[];
|
|
38
|
+
targetProvenance: ReadonlyMap<string, TargetProvenance>;
|
|
39
|
+
}
|
|
40
|
+
/** SerializedError minus the stack, which never enters the report. */
|
|
41
|
+
export interface ReportError {
|
|
42
|
+
category: ErrorCategory;
|
|
43
|
+
code: string;
|
|
44
|
+
message: string;
|
|
45
|
+
retryable: boolean;
|
|
46
|
+
phase?: ErrorPhase | undefined;
|
|
47
|
+
scopeId?: string | undefined;
|
|
48
|
+
}
|
|
49
|
+
export interface ReportStep {
|
|
50
|
+
id: string;
|
|
51
|
+
index: number;
|
|
52
|
+
kind: StepRecord['kind'];
|
|
53
|
+
api: string;
|
|
54
|
+
label: string;
|
|
55
|
+
source: ReportSource;
|
|
56
|
+
status: StepRecord['status'];
|
|
57
|
+
startedAt: string;
|
|
58
|
+
durationMs: number;
|
|
59
|
+
observationRevision?: string | undefined;
|
|
60
|
+
explanation?: string | undefined;
|
|
61
|
+
visionInput?: boolean | undefined;
|
|
62
|
+
visionDegraded?: VisionDegradation | undefined;
|
|
63
|
+
visionOnly?: boolean | undefined;
|
|
64
|
+
viewport?: {
|
|
65
|
+
width: number;
|
|
66
|
+
height: number;
|
|
67
|
+
scale: number;
|
|
68
|
+
} | undefined;
|
|
69
|
+
metrics?: StepMetrics | undefined;
|
|
70
|
+
cache?: StepCacheInfo | undefined;
|
|
71
|
+
events: readonly StepEvent[];
|
|
72
|
+
model?: StepModelInfo | undefined;
|
|
73
|
+
error?: ReportError | undefined;
|
|
74
|
+
artifacts: readonly string[];
|
|
75
|
+
}
|
|
76
|
+
interface ReportAttemptBase {
|
|
77
|
+
id: string;
|
|
78
|
+
index: number;
|
|
79
|
+
status: AttemptRecord['status'];
|
|
80
|
+
startedAt: string;
|
|
81
|
+
durationMs: number;
|
|
82
|
+
artifacts: readonly ArtifactRecord[];
|
|
83
|
+
error?: ReportError | undefined;
|
|
84
|
+
secondaryErrors: readonly ReportError[];
|
|
85
|
+
cleanup: AttemptRecord['cleanup'];
|
|
86
|
+
}
|
|
87
|
+
export interface ReportAttempt extends ReportAttemptBase {
|
|
88
|
+
steps: readonly ReportStep[];
|
|
89
|
+
}
|
|
90
|
+
export interface ReportSerialMember {
|
|
91
|
+
id: string;
|
|
92
|
+
index: number;
|
|
93
|
+
testId: string;
|
|
94
|
+
status: SerialMemberRecord['status'];
|
|
95
|
+
startedAt: string;
|
|
96
|
+
durationMs: number;
|
|
97
|
+
steps: readonly ReportStep[];
|
|
98
|
+
error?: ReportError | undefined;
|
|
99
|
+
skip?: SkipInfo | undefined;
|
|
100
|
+
secondaryErrors: readonly ReportError[];
|
|
101
|
+
}
|
|
102
|
+
export interface ReportSerialAttempt extends ReportAttemptBase {
|
|
103
|
+
members: readonly ReportSerialMember[];
|
|
104
|
+
}
|
|
105
|
+
export interface ReportSerialGroup {
|
|
106
|
+
id: string;
|
|
107
|
+
serialId: string;
|
|
108
|
+
declarationIndex: number;
|
|
109
|
+
file: string;
|
|
110
|
+
source: ReportSource;
|
|
111
|
+
titlePath: readonly string[];
|
|
112
|
+
targetId: string;
|
|
113
|
+
platform: string;
|
|
114
|
+
memberTestIds: readonly string[];
|
|
115
|
+
status: SerialGroupRecord['status'];
|
|
116
|
+
skip?: SkipInfo | undefined;
|
|
117
|
+
attempts: readonly ReportSerialAttempt[];
|
|
118
|
+
}
|
|
119
|
+
export interface ReportResult {
|
|
120
|
+
id: string;
|
|
121
|
+
testId: string;
|
|
122
|
+
kind: 'test' | 'setup';
|
|
123
|
+
declarationIndex: number;
|
|
124
|
+
titlePath: readonly string[];
|
|
125
|
+
file: string;
|
|
126
|
+
source: ReportSource;
|
|
127
|
+
targetId: string;
|
|
128
|
+
platform: string;
|
|
129
|
+
serialGroupId?: string | undefined;
|
|
130
|
+
status: ResultRecord['status'];
|
|
131
|
+
skip?: SkipInfo | undefined;
|
|
132
|
+
attempts: readonly ReportAttempt[];
|
|
133
|
+
}
|
|
134
|
+
export interface ReportTarget {
|
|
135
|
+
id: string;
|
|
136
|
+
index: number;
|
|
137
|
+
platform: string;
|
|
138
|
+
baseOrigin: string;
|
|
139
|
+
environment: string;
|
|
140
|
+
allowProduction: boolean;
|
|
141
|
+
testIdAttribute: string;
|
|
142
|
+
backend: {
|
|
143
|
+
name: string;
|
|
144
|
+
version: string;
|
|
145
|
+
spiVersion: BackendSpiVersion;
|
|
146
|
+
};
|
|
147
|
+
capabilities: readonly string[];
|
|
148
|
+
artifactCapabilities: readonly string[];
|
|
149
|
+
stateCapability: boolean;
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* The report's `limits` block is the resolved limits verbatim; JSON
|
|
153
|
+
* serialization drops the absent cost ceiling.
|
|
154
|
+
*/
|
|
155
|
+
export type ReportLimits = ResolvedLimits;
|
|
156
|
+
export interface ReportUsage {
|
|
157
|
+
discoveredResults: number;
|
|
158
|
+
maxAgentContextBytes: number;
|
|
159
|
+
maxLedgerBytes: number;
|
|
160
|
+
maxObservationBytes: number;
|
|
161
|
+
artifactBytes: number;
|
|
162
|
+
downloads: number;
|
|
163
|
+
events: number;
|
|
164
|
+
modelTokens: number;
|
|
165
|
+
maxModelCallsInStep: number;
|
|
166
|
+
maxActionStepsInStep: number;
|
|
167
|
+
estimatedCostUsd?: number;
|
|
168
|
+
}
|
|
169
|
+
export interface ReportSummary {
|
|
170
|
+
discovered: number;
|
|
171
|
+
selected: number;
|
|
172
|
+
executed: number;
|
|
173
|
+
passed: number;
|
|
174
|
+
failed: number;
|
|
175
|
+
flaky: number;
|
|
176
|
+
skipped: number;
|
|
177
|
+
}
|
|
178
|
+
export interface Report1Document {
|
|
179
|
+
schemaVersion: 'report-1';
|
|
180
|
+
run: {
|
|
181
|
+
id: string;
|
|
182
|
+
specVersion: '0.1';
|
|
183
|
+
runner: {
|
|
184
|
+
name: 'e2e';
|
|
185
|
+
version: string;
|
|
186
|
+
};
|
|
187
|
+
status: BuildReportOptions['status'] | 'blocked';
|
|
188
|
+
exitCode: BuildReportOptions['exitCode'];
|
|
189
|
+
startedAt: string;
|
|
190
|
+
finishedAt: string;
|
|
191
|
+
project: {
|
|
192
|
+
id: string;
|
|
193
|
+
configDigest: string;
|
|
194
|
+
};
|
|
195
|
+
environment: {
|
|
196
|
+
ci: boolean;
|
|
197
|
+
trustNoticeShown: boolean;
|
|
198
|
+
os: string;
|
|
199
|
+
arch: string;
|
|
200
|
+
runtime: string;
|
|
201
|
+
};
|
|
202
|
+
targets: readonly ReportTarget[];
|
|
203
|
+
serialGroups: readonly ReportSerialGroup[];
|
|
204
|
+
results: readonly ReportResult[];
|
|
205
|
+
errors: readonly ReportError[];
|
|
206
|
+
summary: ReportSummary;
|
|
207
|
+
limits: ReportLimits;
|
|
208
|
+
usage: ReportUsage;
|
|
209
|
+
};
|
|
210
|
+
}
|
|
211
|
+
/** Builds the complete report-1 document. */
|
|
212
|
+
export declare function buildReport(options: BuildReportOptions): Report1Document;
|
|
213
|
+
export {};
|
|
214
|
+
//# sourceMappingURL=build.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../src/report/build.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAG7D,OAAO,EAAuB,KAAK,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAGrF,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAE3F,OAAO,KAAK,EAAE,aAAa,EAAE,UAAU,EAAmB,MAAM,uBAAuB,CAAC;AAGxF,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,KAAK,EACV,cAAc,EACd,aAAa,EACb,YAAY,EACZ,QAAQ,EAER,iBAAiB,EACjB,kBAAkB,EACnB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EACV,aAAa,EACb,SAAS,EACT,WAAW,EACX,aAAa,EACb,UAAU,EACV,iBAAiB,EAClB,MAAM,iBAAiB,CAAC;AAEzB,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,M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