@e2e-dev/mobile 0.8.0-canary-20260928184528

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 (73) hide show
  1. package/LICENSE +202 -0
  2. package/NOTICE +5 -0
  3. package/README.md +159 -0
  4. package/dist/.build.json +1 -0
  5. package/dist/actions.d.ts +41 -0
  6. package/dist/actions.d.ts.map +1 -0
  7. package/dist/actions.js +70 -0
  8. package/dist/actions.js.map +1 -0
  9. package/dist/bindings.d.ts +87 -0
  10. package/dist/bindings.d.ts.map +1 -0
  11. package/dist/bindings.js +112 -0
  12. package/dist/bindings.js.map +1 -0
  13. package/dist/device.d.ts +117 -0
  14. package/dist/device.d.ts.map +1 -0
  15. package/dist/device.js +116 -0
  16. package/dist/device.js.map +1 -0
  17. package/dist/engine.d.ts +17 -0
  18. package/dist/engine.d.ts.map +1 -0
  19. package/dist/engine.js +98 -0
  20. package/dist/engine.js.map +1 -0
  21. package/dist/errors.d.ts +61 -0
  22. package/dist/errors.d.ts.map +1 -0
  23. package/dist/errors.js +223 -0
  24. package/dist/errors.js.map +1 -0
  25. package/dist/index.d.ts +21 -0
  26. package/dist/index.d.ts.map +1 -0
  27. package/dist/index.js +14 -0
  28. package/dist/index.js.map +1 -0
  29. package/dist/links.d.ts +41 -0
  30. package/dist/links.d.ts.map +1 -0
  31. package/dist/links.js +79 -0
  32. package/dist/links.js.map +1 -0
  33. package/dist/locate.d.ts +11 -0
  34. package/dist/locate.d.ts.map +1 -0
  35. package/dist/locate.js +119 -0
  36. package/dist/locate.js.map +1 -0
  37. package/dist/nodes.d.ts +107 -0
  38. package/dist/nodes.d.ts.map +1 -0
  39. package/dist/nodes.js +530 -0
  40. package/dist/nodes.js.map +1 -0
  41. package/dist/options.d.ts +134 -0
  42. package/dist/options.d.ts.map +1 -0
  43. package/dist/options.js +7 -0
  44. package/dist/options.js.map +1 -0
  45. package/dist/png.d.ts +4 -0
  46. package/dist/png.d.ts.map +1 -0
  47. package/dist/png.js +25 -0
  48. package/dist/png.js.map +1 -0
  49. package/dist/pool.d.ts +99 -0
  50. package/dist/pool.d.ts.map +1 -0
  51. package/dist/pool.js +235 -0
  52. package/dist/pool.js.map +1 -0
  53. package/dist/provider.d.ts +119 -0
  54. package/dist/provider.d.ts.map +1 -0
  55. package/dist/provider.js +112 -0
  56. package/dist/provider.js.map +1 -0
  57. package/dist/selector.d.ts +17 -0
  58. package/dist/selector.d.ts.map +1 -0
  59. package/dist/selector.js +84 -0
  60. package/dist/selector.js.map +1 -0
  61. package/dist/support.d.ts +63 -0
  62. package/dist/support.d.ts.map +1 -0
  63. package/dist/support.js +87 -0
  64. package/dist/support.js.map +1 -0
  65. package/dist/surface.d.ts +405 -0
  66. package/dist/surface.d.ts.map +1 -0
  67. package/dist/surface.js +1159 -0
  68. package/dist/surface.js.map +1 -0
  69. package/dist/tools.d.ts +24 -0
  70. package/dist/tools.d.ts.map +1 -0
  71. package/dist/tools.js +90 -0
  72. package/dist/tools.js.map +1 -0
  73. package/package.json +83 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nodes.js","sourceRoot":"","sources":["../src/nodes.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAkEH;;;;GAIG;AACH,MAAM,QAAQ,GAAqC;IACjD,MAAM,EAAE,QAAQ;IAChB,IAAI,EAAE,MAAM;IACZ,YAAY,EAAE,SAAS;IACvB,SAAS,EAAE,SAAS;IACpB,cAAc,EAAE,SAAS;IACzB,WAAW,EAAE,SAAS;IACtB,WAAW,EAAE,SAAS;IACtB,mBAAmB,EAAE,SAAS;IAC9B,eAAe,EAAE,SAAS;IAC1B,MAAM,EAAE,QAAQ;IAChB,MAAM,EAAE,QAAQ;IAChB,QAAQ,EAAE,UAAU;IACpB,WAAW,EAAE,UAAU;IACvB,MAAM,EAAE,QAAQ;IAChB,KAAK,EAAE,OAAO;IACd,YAAY,EAAE,OAAO;IACrB,aAAa,EAAE,MAAM;IACrB,IAAI,EAAE,M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E,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,KAAK,MAAM,IAAI,KAAK,CAAC,GAAG,CAAC,KAAK,KAAK,SAAS,IAAI,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,QAAQ,CAAC,KAAK,EAAE,GAAG,CAAC,CAChI,CAAC;IACF,IAAI,IAAI,KAAK,SAAS;QAAE,OAAO,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC;IAC9C,OAAO,GAAG,CAAC,GAAG,CAAC,UAAU,KAAK,SAAS,IAAI,GAAG,CAAC,GAAG,CAAC,UAAU,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,UAAU,CAAC;AAC/G,CAAC;AAED,8DAA8D;AAC9D,MAAM,UAAU,QAAQ,CAAC,KAAoB,EAAE,QAAuB;IACpE,KAAK,IAAI,OAAO,GAAG,KAAK,CAAC,MAAM,EAAE,OAAO,KAAK,SAAS,EAAE,OAAO,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;QACjF,IAAI,OAAO,KAAK,QAAQ;YAAE,OAAO,IAAI,CAAC;IACxC,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC"}
@@ -0,0 +1,134 @@
1
+ /**
2
+ * What the device engine is given: its options, and the agent-device client
3
+ * it drives them through. Shared by the surface (one session per worker) and
4
+ * the pool (the target's devices, one per worker slot).
5
+ */
6
+ import type { createAgentDeviceClient } from 'agent-device';
7
+ import type { DeviceConnection } from './bindings.ts';
8
+ import type { DeviceProvider } from './provider.ts';
9
+ export type AgentDeviceClient = ReturnType<typeof createAgentDeviceClient>;
10
+ /**
11
+ * Mints the agent-device client for one session, with the daemon and client
12
+ * configuration a lease supplied when a provider leased the device, else
13
+ * against the local daemon; the seam unit tests script.
14
+ */
15
+ export type ClientFactory = (session: string, connection?: DeviceConnection) => AgentDeviceClient;
16
+ export type MobilePlatform = 'ios' | 'android';
17
+ /** Permissions agent-device can grant, deny, or reset on an app. */
18
+ export type DevicePermission = 'camera' | 'microphone' | 'photos' | 'contacts' | 'notifications' | 'calendar' | 'location' | 'reminders' | 'motion' | 'siri' | 'media-library';
19
+ /** A permission's state: held, refused, or not asked for yet, so the OS asks again. */
20
+ export type PermissionState = 'grant' | 'deny' | 'reset';
21
+ /** Permissions an app holds when it launches, by name. */
22
+ export type LaunchPermissions = Readonly<Partial<Record<DevicePermission, PermissionState>>>;
23
+ /**
24
+ * Options of the device engine. Every optional value also accepts `undefined`,
25
+ * so values read straight from `process.env` need no conditional spread.
26
+ */
27
+ export interface MobileOptions {
28
+ /** Platform the target's device runs. */
29
+ readonly platform: MobilePlatform;
30
+ /**
31
+ * App the worker brings up once in `prepare` and `app.open()` launches
32
+ * fresh: a bundle id, a package name, or a display name agent-device
33
+ * resolves (`Settings`). An attempt launches nothing on its own, so a test
34
+ * starts where the last one ended and calls `app.open()` when it wants
35
+ * the app fresh, as a Maestro flow calls `launchApp`. Without it the
36
+ * surface observes whatever is in the foreground, and `app.open()`,
37
+ * `app.restart()`, and `app.clearState()` are not available. A link is
38
+ * `INVALID_CONFIG`: a test opens one with `device.openLink`.
39
+ */
40
+ readonly app?: string | undefined;
41
+ /**
42
+ * The build the suite runs against: an iOS `.app` bundle or an Android
43
+ * `.apk`, resolved against the project root (the config's directory). The
44
+ * engine installs nothing on its own: `device.installApp()` with no path
45
+ * installs it, once per device, where the suite says so, and a device
46
+ * provider installs it on the device it leases. Without `app`, the
47
+ * installed bundle id or package becomes the app `app.open()` launches.
48
+ */
49
+ readonly appPath?: string | undefined;
50
+ /**
51
+ * Stable identity keying trace cache and session entries; defaults to `app`,
52
+ * else `appPath`. Declare one when the pinned app differs per run (a build
53
+ * path with a version in it) so entries survive the rename.
54
+ */
55
+ readonly identity?: string | undefined;
56
+ /** Report label joining the cache identity; a simulator or emulator defaults to `test`. */
57
+ readonly environment?: 'test' | 'staging' | 'production' | undefined;
58
+ /**
59
+ * Simulator or emulator to use, by name, simulator UDID, or emulator
60
+ * serial (`emulator-5554`). A list is a pool: the
61
+ * engine declares one worker per entry and worker slot `n` drives the
62
+ * `n`th, so `workers` at or above the pool size runs the target's files
63
+ * across every device at once. Omitted, the pool is every booted device of
64
+ * the platform at `prepare`, as many as the run has slots; with none booted,
65
+ * agent-device boots one. A `DeviceProvider` leases hosted devices instead:
66
+ * one per worker slot at `prepare`, each driven through the daemon and
67
+ * client configuration the lease names, all released when the run ends.
68
+ */
69
+ readonly device?: string | readonly string[] | DeviceProvider | undefined;
70
+ /**
71
+ * agent-device session name, before the worker slot: slot `n` drives its
72
+ * device under `<session>-<n>`, `e2e-<target name>-<n>` by default. One run
73
+ * per session at a time: concurrent runs on the same session interleave
74
+ * taps.
75
+ */
76
+ readonly session?: string | undefined;
77
+ /**
78
+ * What an observation captures. `full` (default) includes static text, so
79
+ * judgments can read values; `interactive` keeps only actionable nodes and
80
+ * is cheaper on screens with long lists.
81
+ */
82
+ readonly snapshot?: 'full' | 'interactive' | undefined;
83
+ /**
84
+ * How long the UI must hold still after a tap, fill, screen scroll, or
85
+ * back before the action counts as landed, in milliseconds; `false` skips
86
+ * the wait. The wait keeps the observation that follows an action off a
87
+ * transition frame; the runner's own polling (`expect`, actions waiting
88
+ * for their node) covers the rest, so a short window suffices. Default
89
+ * 150. Every frame of a running animation changes the tree, so a 150 ms
90
+ * window still catches a transition in flight; raise it for slow devices
91
+ * or apps that settle in stages, or lower it to 0 to keep only the first
92
+ * re-observation.
93
+ */
94
+ readonly settle?: number | false | undefined;
95
+ /**
96
+ * How long a control that appeared or moved with the last action is given
97
+ * to finish arriving before a test acts on it, in milliseconds. Default
98
+ * 500, the length of a modal or screen transition. Accessibility frames
99
+ * report a control's final position from the first frame of a transition,
100
+ * so this budget is the only thing that keeps a test from tapping a point
101
+ * the control has not reached; controls already on screen at the same
102
+ * place before the action are acted on at once. Raise it for slower
103
+ * transitions.
104
+ */
105
+ readonly transition?: number | undefined;
106
+ /**
107
+ * Arguments the pinned app is launched with on every fresh launch this
108
+ * engine performs: `app.open()`, `app.restart()`, and `app.clearState()`.
109
+ * iOS hands them to the app process (`ProcessInfo.processInfo.arguments`);
110
+ * Android appends them to `am start`, so `['--ez', 'e2e', 'true']` is a
111
+ * boolean intent extra. The warm-up in `prepare` and a foreground-only
112
+ * `device.openApp` pass none: an app already running keeps its process
113
+ * arguments, and `app.open()` relaunches it with them. Arguments that
114
+ * select a build mode change what the app is: give each mode its own
115
+ * `identity` so their recordings stay apart.
116
+ * `device.openApp(app, { launchArguments })` launches any app with its
117
+ * own.
118
+ */
119
+ readonly launchArguments?: readonly string[] | undefined;
120
+ /**
121
+ * Permissions the pinned app holds on every fresh launch this engine
122
+ * performs: `app.open()`, `app.restart()`, and `app.clearState()`, which
123
+ * resets them along with the app's data. Each is granted, denied, or reset
124
+ * (the OS asks again) before the app starts, since iOS terminates a running
125
+ * app whose permission changed and Android one whose permission was
126
+ * revoked. `deny` is a recorded refusal on iOS, where the app is told no
127
+ * without a prompt, and a revocation on Android, where the OS asks again
128
+ * when the app requests the permission. A foreground-only `device.openApp`
129
+ * leaves them alone; `device.openApp(app, { permissions })` presets any
130
+ * app's.
131
+ */
132
+ readonly permissions?: LaunchPermissions | undefined;
133
+ }
134
+ //# sourceMappingURL=options.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../src/options.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AAC5D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAEpD,MAAM,MAAM,iBAAiB,GAAG,UAAU,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAE3E;;;;GAIG;AACH,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,EAAE,M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;;;;;OAUG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,KAAK,GAAG,SAAS,CAAC;IAC7C;;;;;;;;;OASG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACzC;;;;;;;;;;;;OAYG;IACH,QAAQ,CAAC,eAAe,CAAC,EAAE,SAAS,MAAM,EAAE,GAAG,SAAS,CAAC;IACzD;;;;;;;;;;;OAWG;IACH,QAAQ,CAAC,WAAW,CAAC,EAAE,iBAAiB,GAAG,SAAS,CAAC;CACtD"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * What the device engine is given: its options, and the agent-device client
3
+ * it drives them through. Shared by the surface (one session per worker) and
4
+ * the pool (the target's devices, one per worker slot).
5
+ */
6
+ export {};
7
+ //# sourceMappingURL=options.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"options.js","sourceRoot":"","sources":["../src/options.ts"],"names":[],"mappings":"AAAA;;;;GAIG"}
package/dist/png.d.ts ADDED
@@ -0,0 +1,4 @@
1
+ import type { Rect } from './support.ts';
2
+ /** Paints each requested rectangle opaque black, rounding outward and clipping to the image. */
3
+ export declare function maskPng(bytes: Uint8Array, rects: readonly Rect[]): Uint8Array;
4
+ //# sourceMappingURL=png.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"png.d.ts","sourceRoot":"","sources":["../src/png.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEzC,gGAAgG;AAChG,wBAAgB,OAAO,CAAC,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,SAAS,IAAI,EAAE,GAAG,UAAU,CAmB7E"}
package/dist/png.js ADDED
@@ -0,0 +1,25 @@
1
+ /** Screenshot masking policy; PNG parsing and encoding belong to pngjs. */
2
+ import { PNG } from 'pngjs';
3
+ /** Paints each requested rectangle opaque black, rounding outward and clipping to the image. */
4
+ export function maskPng(bytes, rects) {
5
+ if (rects.length === 0)
6
+ return bytes;
7
+ const image = PNG.sync.read(Buffer.from(bytes));
8
+ for (const rect of rects) {
9
+ const x0 = Math.max(0, Math.floor(rect.x));
10
+ const y0 = Math.max(0, Math.floor(rect.y));
11
+ const x1 = Math.min(image.width, Math.ceil(rect.x + rect.width));
12
+ const y1 = Math.min(image.height, Math.ceil(rect.y + rect.height));
13
+ for (let y = y0; y < y1; y += 1) {
14
+ for (let x = x0; x < x1; x += 1) {
15
+ const at = (y * image.width + x) * 4;
16
+ image.data[at] = 0;
17
+ image.data[at + 1] = 0;
18
+ image.data[at + 2] = 0;
19
+ image.data[at + 3] = 255;
20
+ }
21
+ }
22
+ }
23
+ return PNG.sync.write(image);
24
+ }
25
+ //# sourceMappingURL=png.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"png.js","sourceRoot":"","sources":["../src/png.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAC3E,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAG5B,gGAAgG;AAChG,MAAM,UAAU,OAAO,CAAC,KAAiB,EAAE,KAAsB;IAC/D,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,KAAK,CAAC;IACrC,MAAM,KAAK,GAAG,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;IAChD,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,MAAM,EAAE,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;QAC3C,MAAM,EAAE,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;QAC3C,MAAM,EAAE,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,EAAE,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;QACjE,MAAM,EAAE,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,EAAE,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;QACnE,KAAK,IAAI,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC;YAChC,KAAK,IAAI,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC;gBAChC,MAAM,EAAE,GAAG,CAAC,CAAC,GAAG,KAAK,CAAC,KAAK,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC;gBACrC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC;gBACnB,KAAK,CAAC,IAAI,CAAC,EAAE,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC;gBACvB,KAAK,CAAC,IAAI,CAAC,EAAE,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC;gBACvB,KAAK,CAAC,IAAI,CAAC,EAAE,GAAG,CAAC,CAAC,GAAG,GAAG,CAAC;YAC3B,CAAC;QACH,CAAC;IACH,CAAC;IACD,OAAO,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;AAC/B,CAAC"}
package/dist/pool.d.ts ADDED
@@ -0,0 +1,99 @@
1
+ /**
2
+ * The devices one target drives: one simulator or emulator per worker slot,
3
+ * each under its own agent-device session. A named `device` is a pool of one
4
+ * and a list a pool of many; with no `device` the pool is every booted device
5
+ * of the platform, discovered in `prepare`; a `DeviceProvider` leases one
6
+ * hosted device per slot instead. Each is a `DeviceSource`; `prepare` binds
7
+ * one `SlotBinding` per slot from it, warms each once per run before any
8
+ * worker exists, and hands the bindings to the workers through the run's
9
+ * environment. The worker that owns a slot then resumes its session in
10
+ * `init`, and `finish` releases what the source acquired.
11
+ */
12
+ import { type EngineFinishInfo, type EnginePrepareInfo, type EnginePrepareResult } from 'e2e/engine';
13
+ import { type SlotBinding } from './bindings.ts';
14
+ import type { MobileOptions, MobilePlatform, ClientFactory } from './options.ts';
15
+ /** The fields agent-device commands select a device by: the platform, then one of a name, a simulator UDID, or an Android serial. */
16
+ export interface DeviceSelection {
17
+ readonly platform: MobilePlatform;
18
+ readonly device?: string;
19
+ readonly udid?: string;
20
+ readonly serial?: string;
21
+ }
22
+ /**
23
+ * The selection agent-device commands take for a binding: an id the pool
24
+ * discovered goes under the platform's id field (`udid` for a simulator,
25
+ * `serial` for an Android device), a configured string too when it reads as
26
+ * a UDID or an emulator serial, and any other string is a device name.
27
+ */
28
+ export declare function deviceSelection(platform: MobilePlatform, binding: Pick<SlotBinding, 'device' | 'deviceId'> | undefined): DeviceSelection;
29
+ export declare class DevicePool {
30
+ private readonly options;
31
+ private readonly createClient;
32
+ private readonly source;
33
+ /** What this process's `prepare` bound, per target: a handle may serve several targets and runs. */
34
+ private readonly bound;
35
+ /** The clients `warm` opened sessions with, per target, held for `finish` to close whatever `warm` got to. */
36
+ private readonly warmed;
37
+ constructor(options: MobileOptions, createClient: ClientFactory);
38
+ /**
39
+ * Workers the engine serves per target, one per device: known up front for
40
+ * a configured pool, and `undefined` for a discovered or leased one until
41
+ * `prepare` reports it, which lets the run plan with its own cap meanwhile.
42
+ */
43
+ get size(): number | undefined;
44
+ /** The agent-device session a worker slot drives its device under: the `session` option or `e2e-<target>`, then `-<slot>`. */
45
+ session(targetName: string, slot: number): string;
46
+ /**
47
+ * What a worker slot drives, for a worker's `init`: what this process's
48
+ * `prepare` bound for the target (an in-process run), else what `prepare`
49
+ * left in the environment (a child worker), else the source's fallback
50
+ * for a run without `prepare`. With none, the choice stays with the local
51
+ * daemon, which picks a booted device. A slot beyond the pool is a broken
52
+ * invariant: the runner caps the target at the workers this engine
53
+ * declared or reported.
54
+ */
55
+ binding(targetName: string, slot: number, env: Readonly<Record<string, string | undefined>>): SlotBinding | undefined;
56
+ /**
57
+ * Binds a device to every worker slot the run will use and warms each,
58
+ * once per run and outside every launch budget, so `init` finds a booted
59
+ * device. The bindings, each naming the app its session is on, are
60
+ * reported back as the target's worker cap and left in the environment
61
+ * for the workers. A target nothing runs on binds
62
+ * nothing: a hosted session is billed from the moment it starts.
63
+ */
64
+ prepare(info: EnginePrepareInfo): Promise<EnginePrepareResult>;
65
+ /**
66
+ * Closes every session `warm` opened for the target and releases what the
67
+ * source acquired. A worker closes its own session in `dispose`, but a run
68
+ * that failed in `prepare` never had one, and an agent-device session
69
+ * outlives the process: left open, the next run resumes it by name with
70
+ * the runner state that failed this one. The closes are best-effort under
71
+ * the hook's budget and run beside the release, so a close that hangs or
72
+ * fails never keeps a leased device billed; a local pool has nothing to
73
+ * release.
74
+ */
75
+ finish(info: EngineFinishInfo): Promise<void>;
76
+ /**
77
+ * Boots every bound device and opens the pinned app on it once, so its
78
+ * automation runner is up and the slot's session is on the app, which the
79
+ * returned binding records for the worker: a permission it presets there
80
+ * needs no open first. A plain foreground open, with none of the engine's
81
+ * launch options: an app still running from an earlier run keeps its
82
+ * process either way, and a test's `app.open()` relaunches it with them.
83
+ * One slot after another, on purpose: workers
84
+ * booting at once in `init` contend for the host and the daemon, and one
85
+ * cold boot pushes the others past `launchTimeout`. Each slot warms under
86
+ * the session its worker resumes. A device that cannot boot ends the run
87
+ * here; an app that does not open is logged and left to the first attempt.
88
+ * An automation runner that is busy or wedged from an earlier run ends it
89
+ * here too: the first attempt could only meet the same runner and fail
90
+ * its first observation with the app blamed, and the message names the
91
+ * recovery, which a wait of up to the runner's recycle window would only
92
+ * hide. A build `appPath` installs in `init` is not on the device yet, so
93
+ * that slot boots only, unless a lease says the build is already there.
94
+ */
95
+ private warm;
96
+ /** Holds a warm-up client for `finish`, before its first command: a boot that fails still opened the session. */
97
+ private retain;
98
+ }
99
+ //# sourceMappingURL=pool.d.ts.map
@@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OAQG;IACH,OAAO,CAAC,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC,GAAG,WAAW,GAAG,SAAS,CAYpH;IAED;;;;;;;OAOG;IACG,OAAO,CAAC,IAAI,EAAE,iBAAiB,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAKnE;IAED;;;;;;;;;OASG;IACG,MAAM,CAAC,IAAI,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,CAQlD;IAED;;;;;;;;;;;;;;;;;;OAkBG;YACW,IAAI;IAmClB,iHAAiH;IACjH,OAAO,CAAC,MAAM;CAKf"}
package/dist/pool.js ADDED
@@ -0,0 +1,235 @@
1
+ /**
2
+ * The devices one target drives: one simulator or emulator per worker slot,
3
+ * each under its own agent-device session. A named `device` is a pool of one
4
+ * and a list a pool of many; with no `device` the pool is every booted device
5
+ * of the platform, discovered in `prepare`; a `DeviceProvider` leases one
6
+ * hosted device per slot instead. Each is a `DeviceSource`; `prepare` binds
7
+ * one `SlotBinding` per slot from it, warms each once per run before any
8
+ * worker exists, and hands the bindings to the workers through the run's
9
+ * environment. The worker that owns a slot then resumes its session in
10
+ * `init`, and `finish` releases what the source acquired.
11
+ */
12
+ import { ConfigurationError, EngineError, obj, withinCleanupBudget, } from 'e2e/engine';
13
+ import { bindingsVariable, decodeBindings, deviceLabel, encodeBindings, pinnedApp } from './bindings.js';
14
+ import { isRunnerFailure, message, runCommand } from './errors.js';
15
+ import { asDeviceProvider, LeasedDevices } from './provider.js';
16
+ /** An Apple simulator UDID. */
17
+ const UDID = /^[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12}$/i;
18
+ /** An Android emulator's adb serial. */
19
+ const EMULATOR_SERIAL = /^emulator-\d+$/;
20
+ /**
21
+ * The selection agent-device commands take for a binding: an id the pool
22
+ * discovered goes under the platform's id field (`udid` for a simulator,
23
+ * `serial` for an Android device), a configured string too when it reads as
24
+ * a UDID or an emulator serial, and any other string is a device name.
25
+ */
26
+ export function deviceSelection(platform, binding) {
27
+ const { device, deviceId } = binding ?? {};
28
+ const id = deviceId ?? (device !== undefined && (UDID.test(device) || EMULATOR_SERIAL.test(device)) ? device : undefined);
29
+ if (id === undefined)
30
+ return obj({ platform, device });
31
+ return platform === 'android' ? { platform, serial: id } : { platform, udid: id };
32
+ }
33
+ function isDeviceList(device) {
34
+ return Array.isArray(device);
35
+ }
36
+ /** The source the `device` option names: a configured pool, the booted devices, or a provider's leases. */
37
+ function sourceFor(options, createClient, session) {
38
+ const { device } = options;
39
+ if (device === undefined)
40
+ return new BootedDevices(options.platform, createClient, session);
41
+ if (typeof device === 'string')
42
+ return new ConfiguredDevices([device]);
43
+ if (isDeviceList(device)) {
44
+ if (device.length === 0) {
45
+ throw new ConfigurationError('INVALID_CONFIG', 'mobile: `device` is an empty pool; name at least one simulator or emulator, or omit it to use every booted one');
46
+ }
47
+ return new ConfiguredDevices(device);
48
+ }
49
+ return new LeasedDevices(asDeviceProvider(device), options);
50
+ }
51
+ /** The devices named in the config, bound in order, as many as the run has slots. */
52
+ class ConfiguredDevices {
53
+ size;
54
+ fallback;
55
+ constructor(devices) {
56
+ this.size = devices.length;
57
+ this.fallback = devices.map((device) => ({ device }));
58
+ }
59
+ async bind(info) {
60
+ return this.fallback.slice(0, Math.min(info.slots, this.size));
61
+ }
62
+ }
63
+ /** Every booted device of the platform, as many as the run has slots; with none booted, one slot the daemon fills. */
64
+ class BootedDevices {
65
+ platform;
66
+ createClient;
67
+ session;
68
+ constructor(platform, createClient, session) {
69
+ this.platform = platform;
70
+ this.createClient = createClient;
71
+ this.session = session;
72
+ }
73
+ async bind(info) {
74
+ const booted = await this.inventory(info.targetName, info.signal);
75
+ const chosen = booted.slice(0, info.slots);
76
+ if (chosen.length === 0) {
77
+ info.log(`no booted ${this.platform} device; agent-device boots one`);
78
+ return [{}];
79
+ }
80
+ info.log(`${booted.length} booted ${this.platform} device(s); driving ${chosen.length}: ${chosen.map((device) => device.name).join(', ')}`);
81
+ return chosen.map((device) => ({ deviceId: device.id }));
82
+ }
83
+ /** Every booted device of the platform, by stable id and name, in agent-device's inventory order. */
84
+ async inventory(targetName, signal) {
85
+ const client = this.createClient(this.session(targetName, 0));
86
+ const inventory = await runCommand('devices', () => client.devices.list({ platform: this.platform }), signal);
87
+ if (!Array.isArray(inventory))
88
+ return [];
89
+ return inventory
90
+ .filter((device) => typeof device === 'object' &&
91
+ device !== null &&
92
+ device.booted === true &&
93
+ device.platform === this.platform &&
94
+ typeof device.id === 'string')
95
+ .map((device) => ({ id: device.id, name: typeof device.name === 'string' ? device.name : device.id }));
96
+ }
97
+ }
98
+ export class DevicePool {
99
+ options;
100
+ createClient;
101
+ source;
102
+ /** What this process's `prepare` bound, per target: a handle may serve several targets and runs. */
103
+ bound = new Map();
104
+ /** The clients `warm` opened sessions with, per target, held for `finish` to close whatever `warm` got to. */
105
+ warmed = new Map();
106
+ constructor(options, createClient) {
107
+ this.options = options;
108
+ this.createClient = createClient;
109
+ this.source = sourceFor(options, createClient, (targetName, slot) => this.session(targetName, slot));
110
+ }
111
+ /**
112
+ * Workers the engine serves per target, one per device: known up front for
113
+ * a configured pool, and `undefined` for a discovered or leased one until
114
+ * `prepare` reports it, which lets the run plan with its own cap meanwhile.
115
+ */
116
+ get size() {
117
+ return this.source.size;
118
+ }
119
+ /** The agent-device session a worker slot drives its device under: the `session` option or `e2e-<target>`, then `-<slot>`. */
120
+ session(targetName, slot) {
121
+ return `${this.options.session ?? `e2e-${targetName}`}-${slot}`;
122
+ }
123
+ /**
124
+ * What a worker slot drives, for a worker's `init`: what this process's
125
+ * `prepare` bound for the target (an in-process run), else what `prepare`
126
+ * left in the environment (a child worker), else the source's fallback
127
+ * for a run without `prepare`. With none, the choice stays with the local
128
+ * daemon, which picks a booted device. A slot beyond the pool is a broken
129
+ * invariant: the runner caps the target at the workers this engine
130
+ * declared or reported.
131
+ */
132
+ binding(targetName, slot, env) {
133
+ const bindings = this.bound.get(targetName) ?? decodeBindings(env[bindingsVariable(targetName)]) ?? this.source.fallback;
134
+ if (bindings === undefined)
135
+ return undefined;
136
+ const binding = bindings[slot];
137
+ if (binding === undefined) {
138
+ throw new EngineError('ENGINE_FAILURE', `worker slot ${slot} is outside a device pool of ${bindings.length}; the runner must cap the target at the engine's declared workers`, { retryable: false });
139
+ }
140
+ return binding;
141
+ }
142
+ /**
143
+ * Binds a device to every worker slot the run will use and warms each,
144
+ * once per run and outside every launch budget, so `init` finds a booted
145
+ * device. The bindings, each naming the app its session is on, are
146
+ * reported back as the target's worker cap and left in the environment
147
+ * for the workers. A target nothing runs on binds
148
+ * nothing: a hosted session is billed from the moment it starts.
149
+ */
150
+ async prepare(info) {
151
+ if (info.slots === 0)
152
+ return {};
153
+ const bindings = await this.warm(await this.source.bind(info), info);
154
+ this.bound.set(info.targetName, bindings);
155
+ return { workers: bindings.length, env: { [bindingsVariable(info.targetName)]: encodeBindings(bindings) } };
156
+ }
157
+ /**
158
+ * Closes every session `warm` opened for the target and releases what the
159
+ * source acquired. A worker closes its own session in `dispose`, but a run
160
+ * that failed in `prepare` never had one, and an agent-device session
161
+ * outlives the process: left open, the next run resumes it by name with
162
+ * the runner state that failed this one. The closes are best-effort under
163
+ * the hook's budget and run beside the release, so a close that hangs or
164
+ * fails never keeps a leased device billed; a local pool has nothing to
165
+ * release.
166
+ */
167
+ async finish(info) {
168
+ const clients = this.warmed.get(info.targetName) ?? [];
169
+ this.warmed.delete(info.targetName);
170
+ const closing = withinCleanupBudget(Promise.allSettled(clients.map((client) => client.sessions.close())), info);
171
+ await Promise.all([closing, this.source.finish?.(info)]);
172
+ }
173
+ /**
174
+ * Boots every bound device and opens the pinned app on it once, so its
175
+ * automation runner is up and the slot's session is on the app, which the
176
+ * returned binding records for the worker: a permission it presets there
177
+ * needs no open first. A plain foreground open, with none of the engine's
178
+ * launch options: an app still running from an earlier run keeps its
179
+ * process either way, and a test's `app.open()` relaunches it with them.
180
+ * One slot after another, on purpose: workers
181
+ * booting at once in `init` contend for the host and the daemon, and one
182
+ * cold boot pushes the others past `launchTimeout`. Each slot warms under
183
+ * the session its worker resumes. A device that cannot boot ends the run
184
+ * here; an app that does not open is logged and left to the first attempt.
185
+ * An automation runner that is busy or wedged from an earlier run ends it
186
+ * here too: the first attempt could only meet the same runner and fail
187
+ * its first observation with the app blamed, and the message names the
188
+ * recovery, which a wait of up to the runner's recycle window would only
189
+ * hide. A build `appPath` installs in `init` is not on the device yet, so
190
+ * that slot boots only, unless a lease says the build is already there.
191
+ */
192
+ async warm(bindings, info) {
193
+ const warmed = [];
194
+ for (const [slot, binding] of bindings.entries()) {
195
+ const label = deviceLabel(binding) ?? `a booted ${this.options.platform} device`;
196
+ const where = deviceSelection(this.options.platform, binding);
197
+ const session = this.session(info.targetName, slot);
198
+ const at = `session ${session} on ${label}`;
199
+ const client = this.createClient(session, binding);
200
+ this.retain(info.targetName, client);
201
+ info.log(`booting ${label} (${slot + 1} of ${bindings.length})`);
202
+ await runCommand('boot', () => client.devices.boot(where), info.signal, at);
203
+ const app = pinnedApp(this.options, binding.installedApp);
204
+ if (app === undefined) {
205
+ warmed.push(binding);
206
+ continue;
207
+ }
208
+ // A build the suite installs itself is not on the device yet, so there
209
+ // is nothing to open: the first attempt installs it and starts the runner.
210
+ if (this.options.appPath !== undefined && binding.installedApp === undefined) {
211
+ info.log(`${label}: ${app} awaits the suite's device.installApp(); the first attempt starts the automation runner`);
212
+ warmed.push(binding);
213
+ continue;
214
+ }
215
+ try {
216
+ await runCommand(`open ${app}`, () => client.apps.open({ app, ...where }), info.signal, at);
217
+ warmed.push({ ...binding, sessionApp: app });
218
+ }
219
+ catch (cause) {
220
+ if (info.signal.aborted || isRunnerFailure(cause))
221
+ throw cause;
222
+ info.log(`${label}: automation runner not warmed up (${message(cause)}); the first attempt starts it`);
223
+ warmed.push(binding);
224
+ }
225
+ }
226
+ return warmed;
227
+ }
228
+ /** Holds a warm-up client for `finish`, before its first command: a boot that fails still opened the session. */
229
+ retain(targetName, client) {
230
+ const clients = this.warmed.get(targetName) ?? [];
231
+ clients.push(client);
232
+ this.warmed.set(targetName, clients);
233
+ }
234
+ }
235
+ //# sourceMappingURL=pool.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pool.js","sourceRoot":"","sources":["../src/pool.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EACL,kBAAkB,EAClB,WAAW,EACX,GAAG,EACH,mBAAmB,GAIpB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,WAAW,EAAE,cAAc,EAAE,SAAS,EAAuC,MAAM,eAAe,CAAC;AAC9I,OAAO,EAAE,eAAe,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEnE,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAEhE,+BAA+B;AAC/B,MAAM,IAAI,GAAG,iEAAiE,CAAC;AAC/E,wCAAwC;AACxC,MAAM,eAAe,GAAG,gBAAgB,CAAC;AAUzC;;;;;GAKG;AACH,MAAM,UAAU,eAAe,CAC7B,QAAwB,EACxB,OAA6D;IAE7D,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,OAAO,IAAI,EAAE,CAAC;IAC3C,MAAM,EAAE,GAAG,QAAQ,IAAI,CAAC,MAAM,KAAK,SAAS,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,eAAe,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;IAC1H,IAAI,EAAE,KAAK,SAAS;QAAE,OAAO,GAAG,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC,CAAC;IACvD,OAAO,QAAQ,KAAK,SAA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