@delacour/warden-e2e 0.6.0 → 0.8.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.
Files changed (151) hide show
  1. package/{chunk-yb1hcjqm.mjs → chunk-vs5npy59.mjs} +3370 -218
  2. package/index.mjs +247 -16
  3. package/package.json +2 -2
  4. package/preload.mjs +8264 -2387
  5. package/types/core/src/a11y/a11y.config.d.ts +47 -0
  6. package/types/core/src/affected/affected.schema.d.ts +142 -1
  7. package/types/core/src/allocate.d.ts +2 -1
  8. package/types/core/src/android-keyguard.d.ts +36 -0
  9. package/types/core/src/batch/preset.schema.d.ts +13 -1
  10. package/types/core/src/biometrics.d.ts +15 -0
  11. package/types/core/src/builds/app-option.schema.d.ts +1 -1
  12. package/types/core/src/builds/builds.defaults.d.ts +15 -0
  13. package/types/core/src/builds/config.d.ts +5 -1
  14. package/types/core/src/builds/config.schema.d.ts +275 -2
  15. package/types/core/src/builds/define-config.d.ts +159 -0
  16. package/types/core/src/builds/install-device.d.ts +37 -0
  17. package/types/core/src/builds/install.d.ts +17 -3
  18. package/types/core/src/builds/kinds.d.ts +21 -3
  19. package/types/core/src/builds/lock.d.ts +38 -0
  20. package/types/core/src/builds/resolve.d.ts +12 -2
  21. package/types/core/src/camera-mode.d.ts +17 -0
  22. package/types/core/src/camera-placeholder.d.ts +9 -0
  23. package/types/core/src/camera-profile.d.ts +12 -0
  24. package/types/core/src/claim-errors.d.ts +34 -0
  25. package/types/core/src/conditions/a11y-keys.d.ts +45 -0
  26. package/types/core/src/conditions/camera-media.d.ts +30 -0
  27. package/types/core/src/conditions/conditions.config.d.ts +141 -0
  28. package/types/core/src/conditions/conditions.d.ts +22 -0
  29. package/types/core/src/conditions/conditions.types.d.ts +171 -0
  30. package/types/core/src/conditions/inject-state.d.ts +13 -0
  31. package/types/core/src/conditions/launch-settings.d.ts +14 -0
  32. package/types/core/src/conditions/network.presets.d.ts +42 -0
  33. package/types/core/src/conditions/text-size.d.ts +19 -0
  34. package/types/core/src/golden/android-biometrics.d.ts +35 -0
  35. package/types/core/src/ios-runner/build.d.ts +28 -0
  36. package/types/core/src/ios-runner/cache.d.ts +44 -0
  37. package/types/core/src/ios-runner/classify.d.ts +7 -0
  38. package/types/core/src/ios-runner/pack.d.ts +17 -0
  39. package/types/core/src/ios-runner/runner-build.types.d.ts +76 -0
  40. package/types/core/src/ios-runner/signing.d.ts +40 -0
  41. package/types/core/src/ios-runner/sim-build.d.ts +36 -0
  42. package/types/core/src/ios-runner/stage.d.ts +26 -0
  43. package/types/core/src/lease-events.d.ts +126 -0
  44. package/types/core/src/netproxy/control.d.ts +75 -0
  45. package/types/core/src/netproxy/decide.d.ts +22 -0
  46. package/types/core/src/netproxy/handle-file.d.ts +12 -0
  47. package/types/core/src/netproxy/lease-proxy.d.ts +53 -0
  48. package/types/core/src/netproxy/netproxy.main.d.ts +40 -0
  49. package/types/core/src/netproxy/pipe.d.ts +37 -0
  50. package/types/core/src/netproxy/proxy.d.ts +48 -0
  51. package/types/core/src/netproxy/shaping.d.ts +43 -0
  52. package/types/core/src/ownership.d.ts +44 -0
  53. package/types/core/src/providers/android.d.ts +46 -2
  54. package/types/core/src/providers/provider.types.d.ts +9 -0
  55. package/types/core/src/queue.d.ts +43 -0
  56. package/types/core/src/store.d.ts +61 -5
  57. package/types/core/src/types.d.ts +57 -0
  58. package/types/core/src/xcode.d.ts +22 -0
  59. package/types/e2e/src/a11y/a11y-target.d.ts +23 -0
  60. package/types/e2e/src/a11y/a11y.types.d.ts +81 -0
  61. package/types/e2e/src/a11y/announcements.d.ts +24 -0
  62. package/types/e2e/src/a11y/audit.d.ts +22 -0
  63. package/types/e2e/src/a11y/native/atf.d.ts +51 -0
  64. package/types/e2e/src/a11y/native/xcuitest.d.ts +60 -0
  65. package/types/e2e/src/a11y/order.d.ts +5 -0
  66. package/types/e2e/src/a11y/rules/duplicate-name.d.ts +6 -0
  67. package/types/e2e/src/a11y/rules/hidden-focusable.d.ts +3 -0
  68. package/types/e2e/src/a11y/rules/image-no-name.d.ts +6 -0
  69. package/types/e2e/src/a11y/rules/label-in-name.d.ts +7 -0
  70. package/types/e2e/src/a11y/rules/missing-name.d.ts +3 -0
  71. package/types/e2e/src/a11y/rules/role-in-name.d.ts +3 -0
  72. package/types/e2e/src/a11y/rules/rule.context.d.ts +22 -0
  73. package/types/e2e/src/a11y/rules/target-size.d.ts +21 -0
  74. package/types/e2e/src/a11y/rules/text-clipped.d.ts +9 -0
  75. package/types/e2e/src/a11y/speech.d.ts +26 -0
  76. package/types/e2e/src/a11y/talkback-log.d.ts +13 -0
  77. package/types/e2e/src/alert-buttons.d.ts +9 -0
  78. package/types/e2e/src/app.d.ts +3 -2
  79. package/types/e2e/src/conditions/condition-events.d.ts +68 -0
  80. package/types/e2e/src/conditions/device-conditions.d.ts +198 -0
  81. package/types/e2e/src/conditions/geo.d.ts +15 -0
  82. package/types/e2e/src/conditions/gpx.d.ts +8 -0
  83. package/types/e2e/src/conditions/lease-recorder.d.ts +27 -0
  84. package/types/e2e/src/conditions/lease-store.d.ts +9 -0
  85. package/types/e2e/src/conditions/location-plan.d.ts +17 -0
  86. package/types/e2e/src/conditions/location-scenarios.data.d.ts +17 -0
  87. package/types/e2e/src/conditions/route-ticker.d.ts +53 -0
  88. package/types/e2e/src/conditions/scheduler.d.ts +83 -0
  89. package/types/e2e/src/device-a11y.d.ts +97 -0
  90. package/types/e2e/src/device.d.ts +67 -4
  91. package/types/e2e/src/driver/a11y-events.d.ts +30 -0
  92. package/types/e2e/src/driver/a11y-read.d.ts +12 -0
  93. package/types/e2e/src/driver/android/android-animations.d.ts +7 -0
  94. package/types/e2e/src/driver/android/android-app.d.ts +4 -0
  95. package/types/e2e/src/driver/android/android-argv.d.ts +21 -0
  96. package/types/e2e/src/driver/android/android-camera-host.d.ts +23 -0
  97. package/types/e2e/src/driver/android/android-camera.d.ts +28 -0
  98. package/types/e2e/src/driver/android/android-clock.d.ts +28 -0
  99. package/types/e2e/src/driver/android/android-device.d.ts +8 -0
  100. package/types/e2e/src/driver/android/android-driver.d.ts +22 -0
  101. package/types/e2e/src/driver/android/android-network.d.ts +66 -0
  102. package/types/e2e/src/driver/android/android-phone.d.ts +47 -0
  103. package/types/e2e/src/driver/android/android-screen-reader.d.ts +23 -0
  104. package/types/e2e/src/driver/android/android-settings.d.ts +41 -0
  105. package/types/e2e/src/driver/android/android-spoken.d.ts +18 -0
  106. package/types/e2e/src/driver/android/android-state.d.ts +10 -0
  107. package/types/e2e/src/driver/android/android-talkback.d.ts +57 -0
  108. package/types/e2e/src/driver/android/atf-device.d.ts +23 -0
  109. package/types/e2e/src/driver/android/atf-dex.generated.d.ts +7 -0
  110. package/types/e2e/src/driver/android/uiad-dex.generated.d.ts +5 -5
  111. package/types/e2e/src/driver/android/uiad-ops.d.ts +27 -1
  112. package/types/e2e/src/driver/android/uiad-protocol.d.ts +8 -0
  113. package/types/e2e/src/driver/android/uiad-screen-reader.d.ts +33 -0
  114. package/types/e2e/src/driver/clock-recorder.d.ts +9 -0
  115. package/types/e2e/src/driver/device-settings.d.ts +10 -0
  116. package/types/e2e/src/driver/driver.types.d.ts +242 -1
  117. package/types/e2e/src/driver/element-actions.d.ts +16 -0
  118. package/types/e2e/src/driver/ios/device/capabilities.d.ts +3 -0
  119. package/types/e2e/src/driver/ios/device/device-driver.d.ts +49 -0
  120. package/types/e2e/src/driver/ios/device/devicectl.d.ts +38 -0
  121. package/types/e2e/src/driver/ios/device/runner-protocol.d.ts +21 -0
  122. package/types/e2e/src/driver/ios/hid-recovery.d.ts +15 -0
  123. package/types/e2e/src/driver/ios/inject.d.ts +124 -0
  124. package/types/e2e/src/driver/ios/ios-a11y.d.ts +73 -0
  125. package/types/e2e/src/driver/ios/ios-audit.d.ts +36 -0
  126. package/types/e2e/src/driver/ios/ios-driver.d.ts +50 -1
  127. package/types/e2e/src/driver/ios/ios-network.d.ts +51 -0
  128. package/types/e2e/src/driver/ios/ios-settings.d.ts +44 -0
  129. package/types/e2e/src/driver/ios/sim-runner.d.ts +41 -0
  130. package/types/e2e/src/driver/ios/simctl.d.ts +41 -1
  131. package/types/e2e/src/driver/ios/simd-transport.d.ts +11 -2
  132. package/types/e2e/src/driver/ios/type-budget.d.ts +6 -1
  133. package/types/e2e/src/driver/native-audit.d.ts +26 -0
  134. package/types/e2e/src/driver/network-proxy.d.ts +52 -0
  135. package/types/e2e/src/driver/open.d.ts +20 -0
  136. package/types/e2e/src/driver/physical-conditions.d.ts +11 -0
  137. package/types/e2e/src/driver/requirements.d.ts +14 -0
  138. package/types/e2e/src/driver/screen-reader.d.ts +26 -0
  139. package/types/e2e/src/driver/typing.d.ts +1 -1
  140. package/types/e2e/src/env.d.ts +47 -0
  141. package/types/e2e/src/expect/a11y-matchers.d.ts +33 -0
  142. package/types/e2e/src/expect/expect.d.ts +7 -2
  143. package/types/e2e/src/expect/matchers.d.ts +14 -0
  144. package/types/e2e/src/fixture-session.d.ts +4 -0
  145. package/types/e2e/src/fixtures.d.ts +6 -1
  146. package/types/e2e/src/index.d.ts +6 -0
  147. package/types/e2e/src/runner/callsite.d.ts +3 -1
  148. package/types/e2e/src/runner/scope.d.ts +1 -0
  149. package/types/e2e/src/runner/test.d.ts +6 -0
  150. package/types/e2e/src/screen/render.d.ts +8 -0
  151. package/types/e2e/src/traced-device.d.ts +2 -1
@@ -1,3 +1,5 @@
1
+ import { type A11yAuditConfig } from "../../core/src/a11y/a11y.config";
2
+ import { type CameraSuiteFeeds, type ConditionsConfig } from "../../core/src/conditions/conditions.config";
1
3
  import type { Result } from "../../types/src/result";
2
4
  /**
3
5
  * The env names `warden e2e` writes and the spec process reads (`apps/cli` imports these). `WARDEN_HEADLESS` and
@@ -12,6 +14,8 @@ export declare const ENV_NAMES: {
12
14
  readonly appPath: "WARDEN_APP_PATH";
13
15
  readonly metroUrl: "WARDEN_METRO_URL";
14
16
  readonly launchArgs: "WARDEN_LAUNCH_ARGS";
17
+ /** the dev client's url scheme (`exp+<slug>`): an Android launch has no args, so Metro's `--initialUrl` becomes a deep link on this scheme */
18
+ readonly devClientScheme: "WARDEN_DEV_CLIENT_SCHEME";
15
19
  readonly out: "WARDEN_E2E_OUT";
16
20
  readonly timeout: "WARDEN_E2E_TIMEOUT";
17
21
  readonly actionTimeout: "WARDEN_E2E_ACTION_TIMEOUT";
@@ -20,7 +24,16 @@ export declare const ENV_NAMES: {
20
24
  readonly helperDir: "WARDEN_HELPER_DIR";
21
25
  readonly simd: "WARDEN_SIMD";
22
26
  readonly simdSocket: "WARDEN_SIMD_SOCKET";
27
+ /** unix socket of a physical iPhone's resident runner host (`warden __ios-runner-host`): the iOS device driver connects there instead of to `warden-simd` */
28
+ readonly iosRunnerSocket: "WARDEN_IOS_RUNNER_SOCKET";
23
29
  readonly logTimestamps: "WARDEN_LOG_TIMESTAMPS";
30
+ /** `physical` when the job's device is a real phone/tablet (set by `warden e2e` / `batch`; absent for a simulator or emulator) */
31
+ readonly deviceKind: "WARDEN_DEVICE_KIND";
32
+ /**
33
+ * JSON argv (`{udid}` is replaced) that restarts a physical iPhone's runner host (`warden __ios-runner-restart`); the
34
+ * session runs it once when the runner connection is lost, and never reboots the phone
35
+ */
36
+ readonly iosRunnerRestart: "WARDEN_IOS_RUNNER_RESTART";
24
37
  /**
25
38
  * JSON argv (`{udid}` is replaced) the session runs after it rebooted the sim following a lost HID connection;
26
39
  * `warden` sets it for non-headless runs so the sim's viewer window comes back (packages/e2e cannot import apps/cli)
@@ -34,6 +47,20 @@ export declare const ENV_NAMES: {
34
47
  readonly perf: "WARDEN_PERF";
35
48
  /** JSON of the suite's `perf.budgets`; a breach fails the test with `PERF_BUDGET` */
36
49
  readonly perfBudgets: "WARDEN_PERF_BUDGETS";
50
+ /** JSON of the suite's `conditions` (network / location / clock applied before each spec, the rest reported as not applied) */
51
+ readonly conditions: "WARDEN_CONDITIONS";
52
+ /** the id of the lease holding `WARDEN_UDID`: conditions a spec sets are recorded on it and its shaping proxy hangs off it */
53
+ readonly leaseId: "WARDEN_LEASE_ID";
54
+ /** JSON argv that runs the shaping proxy (`warden __netproxy`) when specs run from a compiled `warden`; the JSON argument is appended */
55
+ readonly netproxyCommand: "WARDEN_NETPROXY_COMMAND";
56
+ /** `1` when the suite's devices are biometrics devices: the session enrolls an iOS sim again before the app is installed */
57
+ readonly biometrics: "WARDEN_BIOMETRICS";
58
+ /** JSON of the suite's `a11y` (`ignore` / `minSeverity` / `rules`): the defaults `device.a11yAudit()` and `toPassA11yAudit()` use */
59
+ readonly a11yAudit: "WARDEN_A11Y_AUDIT";
60
+ /** `1`: iOS apps launch with the injected library, so hint, custom actions, reading order and announcements can be read */
61
+ readonly a11y: "WARDEN_A11Y";
62
+ /** JSON of the suite's `camera` with absolute paths (`{ back?: { path, loop }, front? }`): staged and fed before the first `app.open()` */
63
+ readonly cameraFeeds: "WARDEN_CAMERA_FEEDS";
37
64
  };
38
65
  export declare const DEFAULT_TIMEOUT_MS = 120000;
39
66
  export declare const DEFAULT_ACTION_TIMEOUT_MS = 30000;
@@ -46,6 +73,8 @@ export type E2eEnv = {
46
73
  bundleId: string;
47
74
  appPath?: string;
48
75
  metroUrl?: string;
76
+ /** `WARDEN_DEV_CLIENT_SCHEME` */
77
+ devClientScheme?: string;
49
78
  launchArgs: string[];
50
79
  /** where `results.jsonl` and per-attempt artifacts go (may be relative to cwd) */
51
80
  out: string;
@@ -56,6 +85,12 @@ export type E2eEnv = {
56
85
  helperDir?: string;
57
86
  simd?: string;
58
87
  simdSocket?: string;
88
+ /** `WARDEN_IOS_RUNNER_SOCKET`: the runner host's socket for a physical iPhone */
89
+ iosRunnerSocket?: string;
90
+ /** `WARDEN_DEVICE_KIND`: `physical` for a real phone/tablet, absent for a simulator or emulator */
91
+ deviceKind?: "physical";
92
+ /** `WARDEN_IOS_RUNNER_RESTART`: argv that restarts the iPhone's runner host, `{udid}` not yet replaced */
93
+ iosRunnerRestart?: string[];
59
94
  /** warden already stamps the log lines: the spec reporter prints no clock of its own */
60
95
  logTimestamps: boolean;
61
96
  /** `WARDEN_AFTER_REBOOT`: argv run after a HID-loss reboot, `{udid}` not yet replaced (see `runAfterReboot`) */
@@ -68,6 +103,18 @@ export type E2eEnv = {
68
103
  perf?: string[];
69
104
  /** `WARDEN_PERF_BUDGETS`: raw JSON of the suite's budgets */
70
105
  perfBudgets?: string;
106
+ /** `WARDEN_CONDITIONS`: what every spec starts from (`conditions/suite-conditions.ts` applies it) */
107
+ conditions?: ConditionsConfig;
108
+ /** `WARDEN_LEASE_ID`: the device's lease; absent under a bare `bun test`, where network shaping is unsupported */
109
+ leaseId?: string;
110
+ /** `WARDEN_NETPROXY_COMMAND`: argv that starts the shaping proxy; absent from source (`bun netproxy.main.ts`) */
111
+ netproxyCommand?: string[];
112
+ /** `WARDEN_BIOMETRICS`: this is a biometrics device (profile `<p>+bio`); iOS enrollment does not survive a reboot or a spec's `unenroll` */
113
+ biometrics?: boolean;
114
+ /** `WARDEN_A11Y_AUDIT`: the suite's accessibility audit settings; absent = rules all, ignore none, minSeverity `error` */
115
+ a11yAudit?: A11yAuditConfig;
116
+ /** `WARDEN_CAMERA_FEEDS`: the suite's `camera` (absolute paths), applied before the first `app.open()` */
117
+ cameraFeeds?: CameraSuiteFeeds;
71
118
  };
72
119
  /**
73
120
  * Reads the spec env contract. `undefined` data = not running under warden (no `WARDEN_UDID`); an
@@ -0,0 +1,33 @@
1
+ import type { A11yTarget } from "../a11y/a11y-target";
2
+ import type { DeviceA11yAuditOptions } from "../device-a11y";
3
+ import type { TextMatch } from "../screen/text";
4
+ import type { AssertionContext } from "./matchers";
5
+ export type AnnouncedOptions = {
6
+ /** how long to wait for the announcement (default: the assertion timeout); `.not` waits this long for none */
7
+ timeoutMs?: number;
8
+ /** same as `timeoutMs`, spelled as the other matchers do */
9
+ timeout?: number;
10
+ /** cursor from `device.announcements()`: only what came after it counts (default: everything the device kept) */
11
+ since?: number;
12
+ };
13
+ export type PassA11yAuditOptions = DeviceA11yAuditOptions;
14
+ /**
15
+ * The matchers of `expect(device)` / `expect(screen)`: `toPassA11yAudit` and `toHaveAnnounced`. A failure carries the
16
+ * issue table or the announcements seen, and the screen as text with the `--a11y` columns (`screen-at-failure.txt`).
17
+ */
18
+ export declare class DeviceAssertions {
19
+ private readonly target;
20
+ private readonly context;
21
+ constructor(target: A11yTarget, context: AssertionContext);
22
+ get not(): DeviceAssertions;
23
+ /**
24
+ * The screen as it is now has no issue at `minSeverity` (default `error`) or worse, from warden's rules and the
25
+ * platform's own audit. Takes the options of `device.a11yAudit` (suite `a11y` config applies); runs once, so settle
26
+ * first. Warnings (target size, platform guidelines) are reported only with `{ minSeverity: "warning" }`.
27
+ */
28
+ toPassA11yAudit(options?: PassA11yAuditOptions): Promise<void>;
29
+ /** An announcement or live-region change whose text contains the string or matches the RegExp arrived (`.not`: none did within the timeout). */
30
+ toHaveAnnounced(expected: TextMatch, options?: AnnouncedOptions): Promise<void>;
31
+ private failure;
32
+ private run;
33
+ }
@@ -1,20 +1,25 @@
1
1
  import { type Expect as BunExpect, type Matchers } from "bun:test";
2
+ import type { Device } from "../device";
2
3
  import { E2eError } from "../errors";
3
4
  import { type Locator } from "../screen/locator";
5
+ import type { Screen } from "../screen/screen";
4
6
  import { type Session } from "../session";
7
+ import { DeviceAssertions } from "./a11y-matchers";
5
8
  import { LocatorAssertions } from "./matchers";
6
9
  /** Receives a failure `expect.soft` kept instead of throwing. */
7
10
  export type SoftSink = (error: E2eError) => void;
8
11
  /** `expect.soft`: `expect` whose failures are kept on the running attempt, which fails once its body has settled. */
9
12
  export type SoftExpect = {
10
13
  (actual: Locator): LocatorAssertions;
14
+ (actual: Device | Screen): DeviceAssertions;
11
15
  <T = unknown>(actual: T, message?: string): Matchers<T>;
12
16
  };
13
17
  /**
14
- * The spec `expect`: `expect(locator)` gives the polling locator matchers, anything else is bun's own `expect`
18
+ * The spec `expect`: `expect(locator)` gives the polling locator matchers, `expect(device)` / `expect(screen)` the
19
+ * accessibility ones (`toPassA11yAudit`, `toHaveAnnounced`), anything else is bun's own `expect`
15
20
  * (all of its statics — `any`, `arrayContaining`, `extend`, `not`, … — are on it too).
16
21
  */
17
- export type E2eExpect = ((actual: Locator) => LocatorAssertions) & BunExpect & {
22
+ export type E2eExpect = ((actual: Locator) => LocatorAssertions) & ((actual: Device | Screen) => DeviceAssertions) & BunExpect & {
18
23
  readonly soft: SoftExpect;
19
24
  };
20
25
  export type ExpectDeps = {
@@ -1,5 +1,6 @@
1
1
  import { E2eError } from "../errors";
2
2
  import { type Locator } from "../screen/locator";
3
+ import type { QueryRole } from "../screen/roles";
3
4
  import { type TextMatch } from "../screen/text";
4
5
  /**
5
6
  * A negated matcher passes only after its condition held this long without a break (or the whole timeout, if shorter).
@@ -63,6 +64,19 @@ export declare class LocatorAssertions {
63
64
  toBeChecked(options?: CheckedOptions): Promise<void>;
64
65
  toBeEnabled(options?: AssertionOptions): Promise<void>;
65
66
  toBeDisabled(options?: AssertionOptions): Promise<void>;
67
+ /** The computed accessible name (label, else text, else merged child text) equals the string (whitespace normalised) or matches the RegExp. */
68
+ toHaveAccessibleName(expected: TextMatch, options?: AssertionOptions): Promise<void>;
69
+ /** The element's role in the `getByRole` vocabulary (`button`, `switch`, `heading`, …). */
70
+ toHaveRole(expected: QueryRole, options?: AssertionOptions): Promise<void>;
71
+ /** The accessibility hint equals the string or matches the RegExp. iOS needs the app launched with the injected library to see hints. */
72
+ toHaveHint(expected: TextMatch, options?: AssertionOptions): Promise<void>;
73
+ /**
74
+ * The announcement warden's speech model composes for the element ("Save, button, double tap to save") equals the
75
+ * string (`exact: false`: contains it, ignoring case) or matches the RegExp. Simulated: never what the real reader says.
76
+ */
77
+ toAnnounce(expected: TextMatch, options?: TextAssertionOptions): Promise<void>;
78
+ /** The element holds screen-reader focus (Android TalkBack's accessibility focus; iOS does not report it). */
79
+ toBeA11yFocused(options?: AssertionOptions): Promise<void>;
66
80
  /** Exactly `expected` current matches (zero included). */
67
81
  toHaveCount(expected: number, options?: AssertionOptions): Promise<void>;
68
82
  private assert;
@@ -9,6 +9,10 @@ import type { TraceEvent } from "./runner/trace";
9
9
  export type FixtureSession = {
10
10
  /** absolute `WARDEN_E2E_OUT` (screenshot fallback when no attempt is running) */
11
11
  readonly out: string;
12
+ /** the process's `results.jsonl`; `device.network` / `location` / `clock` append condition events to it */
13
+ readonly results?: {
14
+ readonly path: string;
15
+ };
12
16
  /** the running attempt's deadline / cancel signal; every driver call honours it */
13
17
  readonly signal?: AbortSignal;
14
18
  /** `<out>/<specId>/<title-slug>-<hash6>` of the running attempt */
@@ -1,6 +1,11 @@
1
- import { type Device } from "./device";
1
+ import { type AlertAction, type Device } from "./device";
2
2
  import type { BaseFixtures, FixtureContext } from "./runner/fixtures.types";
3
3
  import type { ScreenHost } from "./screen/context";
4
+ /**
5
+ * `device.alert(action)` for a read that answers sheets on the side: a sheet that stays up after every press
6
+ * (`ACTION_FAILED`) is left for the read to go on with, not thrown out of an unrelated `isVisible()`.
7
+ */
8
+ export declare function answerAlertQuietly(device: Pick<Device, "alert">, action: AlertAction): Promise<boolean>;
4
9
  /**
5
10
  * What `screen` needs from one attempt: the live driver, its timeouts and deadline, and reported steps. With
6
11
  * `systemAlerts` set (`test.use`) and a `device` to press with, reads and waits answer the alerts they see.
@@ -1,5 +1,11 @@
1
+ export type { A11yAuditOptions, A11yAuditResult, A11yEvent, A11yEventKind, A11yEventSource, A11yIgnore, A11yIssue, A11yRuleId, A11ySeverity, A11ySource, Announcement, ScreenReaderState, SpokenLine, } from "./a11y/a11y.types";
1
2
  export type { OpenOptions, OpenWaitUntil } from "./app";
3
+ export type { CameraFacingChoice, CameraSetOptions, ClockInput, ConditionRun, DeviceCamera, DeviceClock, DeviceLocation, DeviceNetwork, DevicePermissions, Duration, FlapOptions, LocationPoint, NetworkSetOptions, NetworkStatus, RouteOptions, TimelineStepInput, } from "./conditions/device-conditions";
4
+ export type { BiometricState, DeviceBiometrics } from "./device";
5
+ export type { A11yAnnouncement, A11yAnnouncements, A11yAnnouncementsOptions, DeviceA11y, DeviceA11yAuditOptions, DeviceScreenReader, ScreenReaderSpokenOptions, } from "./device-a11y";
6
+ export type { A11yOp, A11yState, CameraState } from "./driver/driver.types";
2
7
  export { E2eError } from "./errors";
8
+ export type { AnnouncedOptions, PassA11yAuditOptions } from "./expect/a11y-matchers";
3
9
  export { expect } from "./expect/expect";
4
10
  export type { PerfBreach, PerfBudgets } from "./perf/budgets";
5
11
  export type { DevicePerf } from "./perf/device-perf";
@@ -1,2 +1,4 @@
1
1
  /** The absolute path of the first stack frame outside the e2e runner: the spec file calling `test()`. */
2
- export declare function callerFile(stack?: string | undefined): string;
2
+ export declare function callerFile(stack?: string | undefined,
3
+ /** more files that never count as the caller (an API that resolves paths against the spec) */
4
+ extraOwn?: (path: string) => boolean): string;
@@ -57,6 +57,7 @@ export declare function registrationDefaults(env?: Readonly<Record<string, strin
57
57
  actionTimeoutMs: number;
58
58
  assertionTimeoutMs: number;
59
59
  platform: "ios" | "android" | undefined;
60
+ deviceKind: "physical" | undefined;
60
61
  };
61
62
  /** Records that a `.only` was collected (kept on `globalThis`: the preload and the specs may be separate bundles). */
62
63
  export declare function markOnly(): void;
@@ -1,4 +1,5 @@
1
1
  import type { Platform } from "../driver/driver.types";
2
+ import { type Requirement } from "../driver/requirements";
2
3
  import { type BaseFixtures } from "./fixtures.types";
3
4
  import { type Hook, type UseOptions } from "./scope";
4
5
  export type TestOptions = {
@@ -8,6 +9,11 @@ export type TestOptions = {
8
9
  only?: boolean;
9
10
  /** run only on these platforms (decided at collection time from `WARDEN_PLATFORM`) */
10
11
  platforms?: readonly Platform[];
12
+ /**
13
+ * driver capabilities the test needs (`pinch`, `multiTouch`). The test is skipped, when collected, on a device whose
14
+ * driver is known to lack one: a physical iPhone has neither. Elsewhere the driver decides at run time.
15
+ */
16
+ requires?: readonly Requirement[];
11
17
  /** extra attempts after a failure; only the last attempt writes to `results.jsonl` */
12
18
  retry?: number;
13
19
  };
@@ -7,6 +7,8 @@ export type RenderOptions = {
7
7
  refs: ReadonlyMap<string, string>;
8
8
  /** cap on element lines; a `… N more (use --all)` line follows when cut */
9
9
  maxLines?: number;
10
+ /** append the screen-reader facts of `Element.a11y` (see {@link a11yWords}) to each line */
11
+ a11y?: boolean;
10
12
  };
11
13
  export type RenderedSnapshot = {
12
14
  lines: string[];
@@ -19,10 +21,16 @@ export type RenderedSnapshot = {
19
21
  };
20
22
  /** `[button] "Sign in" id=sign-in-submit`: enough to tell matches apart in an error message. */
21
23
  export declare function describeEntry(entry: NodeEntry): string;
24
+ /**
25
+ * The `--a11y` tail of an entry line: `hint="…"`, `actions=["…"]`, `a11y-focused`, `not-important`, `live=polite|assertive`.
26
+ * Only facts the backend read are printed; an element without `a11y` adds nothing.
27
+ */
28
+ export declare function a11yWords(entry: NodeEntry): string[];
22
29
  /** `@e3 [button] "Sign in" id=sign-in-submit value="…" enabled hittable (24,332 345×48)`; `indent` is in levels. */
23
30
  export declare function renderEntryLine(entry: NodeEntry, options?: {
24
31
  ref?: string;
25
32
  indent?: number;
33
+ a11y?: boolean;
26
34
  }): string;
27
35
  /** The entries `interactiveOnly` lists: visible ones that are interactive or carry a testID. */
28
36
  export declare function isListed(entry: NodeEntry): boolean;
@@ -2,7 +2,8 @@ import type { Device } from "./device";
2
2
  import type { SpanRunner } from "./runner/span";
3
3
  /**
4
4
  * `device` with every call timed as a `device.<name>` span in the attempt's `trace.jsonl` (trace only: no console
5
- * line, since a settle or an alert is not a step). The driver calls a device call makes are `driver.*` spans of
5
+ * line, since a settle or an alert is not a step). The condition calls are `device.network.<call>`,
6
+ * `device.location.<call>`, `device.clock.<call>` and `device.timeline`. The driver calls a device call makes are `driver.*` spans of
6
7
  * their own, so a slow `device.openLink` shows what it spent its time on. Without a span runner (a bare
7
8
  * `FixtureSession`) the device is returned unchanged.
8
9
  */