@e2e-dev/mobile 0.8.0-canary-20260928184528 → 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.
package/dist/options.d.ts CHANGED
@@ -14,47 +14,24 @@ export type AgentDeviceClient = ReturnType<typeof createAgentDeviceClient>;
14
14
  */
15
15
  export type ClientFactory = (session: string, connection?: DeviceConnection) => AgentDeviceClient;
16
16
  export type MobilePlatform = 'ios' | 'android';
17
+ /** Every permission agent-device can grant, deny, or reset on an app: what a target's `app.permissions` and `device.openApp` may name. */
18
+ export declare const DEVICE_PERMISSIONS: readonly ['camera', 'microphone', 'photos', 'contacts', 'notifications', 'calendar', 'location', 'reminders', 'motion', 'siri', 'media-library'];
17
19
  /** 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';
20
+ export type DevicePermission = (typeof DEVICE_PERMISSIONS)[number];
19
21
  /** A permission's state: held, refused, or not asked for yet, so the OS asks again. */
20
22
  export type PermissionState = 'grant' | 'deny' | 'reset';
21
23
  /** Permissions an app holds when it launches, by name. */
22
24
  export type LaunchPermissions = Readonly<Partial<Record<DevicePermission, PermissionState>>>;
23
25
  /**
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
+ * Options of the device engine: which devices it drives and how. The app
27
+ * under test is the target's `app` (`bundleId`, `appPath`,
28
+ * `launchArguments`, `permissions`). Every optional value also accepts
29
+ * `undefined`, so values read straight from `process.env` need no
30
+ * conditional spread.
26
31
  */
27
32
  export interface MobileOptions {
28
33
  /** Platform the target's device runs. */
29
34
  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
35
  /**
59
36
  * Simulator or emulator to use, by name, simulator UDID, or emulator
60
37
  * serial (`emulator-5554`). A list is a pool: the
@@ -104,31 +81,11 @@ export interface MobileOptions {
104
81
  */
105
82
  readonly transition?: number | undefined;
106
83
  /**
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.
84
+ * Whether a video recording draws agent-device's touch indicator where a
85
+ * test tapped. Default `true`. `false` records the plain screen, and skips
86
+ * the pass that draws the indicator once the recording stops: on a hosted
87
+ * daemon that pass can outlast the attempt's `cleanupTimeout`.
131
88
  */
132
- readonly permissions?: LaunchPermissions | undefined;
89
+ readonly videoTouches?: boolean | undefined;
133
90
  }
134
91
  //# sourceMappingURL=options.d.ts.map
@@ -1 +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,MAAM,EAAE,UAAU,CAAC,EAAE,gBAAgB,KAAK,iBAAiB,CAAC;AAElG,MAAM,MAAM,cAAc,GAAG,KAAK,GAAG,SAAS,CAAC;AAE/C,oEAAoE;AACpE,MAAM,MAAM,gBAAgB,GACxB,QAAQ,GACR,YAAY,GACZ,QAAQ,GACR,UAAU,GACV,eAAe,GACf,UAAU,GACV,UAAU,GACV,WAAW,GACX,QAAQ,GACR,MAAM,GACN,eAAe,CAAC;AAEpB,uFAAuF;AACvF,MAAM,MAAM,eAAe,GAAG,OAAO,GAAG,MA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;;;OAKG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACtC;;;;OAIG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,aAAa,GAAG,SAAS,CAAC;IACvD;;;;;;;;;;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;;;;;OAKG;IACH,QAAQ,CAAC,YAAY,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;CAC7C"}
package/dist/options.js CHANGED
@@ -3,5 +3,18 @@
3
3
  * it drives them through. Shared by the surface (one session per worker) and
4
4
  * the pool (the target's devices, one per worker slot).
5
5
  */
6
- export {};
6
+ /** Every permission agent-device can grant, deny, or reset on an app: what a target's `app.permissions` and `device.openApp` may name. */
7
+ export const DEVICE_PERMISSIONS = [
8
+ 'camera',
9
+ 'microphone',
10
+ 'photos',
11
+ 'contacts',
12
+ 'notifications',
13
+ 'calendar',
14
+ 'location',
15
+ 'reminders',
16
+ 'motion',
17
+ 'siri',
18
+ 'media-library',
19
+ ];
7
20
  //# sourceMappingURL=options.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"options.js","sourceRoot":"","sources":["../src/options.ts"],"names":[],"mappings":"AAAA;;;;GAIG"}
1
+ {"version":3,"file":"options.js","sourceRoot":"","sources":["../src/options.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAiBH,0IAA0I;AAC1I,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,QAAQ;IACR,YAAY;IACZ,QAAQ;IACR,UAAU;IACV,eAAe;IACf,UAAU;IACV,UAAU;IACV,WAAW;IACX,QAAQ;IACR,MAAM;IACN,eAAe;CACP,CAAC"}
package/dist/pool.d.ts CHANGED
@@ -12,6 +12,7 @@
12
12
  import { type EngineFinishInfo, type EnginePrepareInfo, type EnginePrepareResult } from 'e2e/engine';
13
13
  import { type SlotBinding } from './bindings.ts';
14
14
  import type { MobileOptions, MobilePlatform, ClientFactory } from './options.ts';
15
+ import { type RecordingDeviceProvider } from './provider.ts';
15
16
  /** The fields agent-device commands select a device by: the platform, then one of a name, a simulator UDID, or an Android serial. */
16
17
  export interface DeviceSelection {
17
18
  readonly platform: MobilePlatform;
@@ -35,6 +36,13 @@ export declare class DevicePool {
35
36
  /** The clients `warm` opened sessions with, per target, held for `finish` to close whatever `warm` got to. */
36
37
  private readonly warmed;
37
38
  constructor(options: MobileOptions, createClient: ClientFactory);
39
+ /**
40
+ * The device provider when its service records the devices it leases,
41
+ * in every process: the pool is built from the options in the runner and
42
+ * in each worker alike. `undefined` for a local pool, or a provider
43
+ * without `record`.
44
+ */
45
+ get recorder(): RecordingDeviceProvider | undefined;
38
46
  /**
39
47
  * Workers the engine serves per target, one per device: known up front for
40
48
  * a configured pool, and `undefined` for a discovered or leased one until
@@ -74,10 +82,10 @@ export declare class DevicePool {
74
82
  */
75
83
  finish(info: EngineFinishInfo): Promise<void>;
76
84
  /**
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
85
+ * Boots every bound device, starts the iOS automation runner on it, and
86
+ * opens the pinned app on it once, so the slot's session is on the app,
87
+ * which the returned binding records for the worker: a permission it
88
+ * presets there needs no open first. A plain foreground open, with none of the engine's
81
89
  * launch options: an app still running from an earlier run keeps its
82
90
  * process either way, and a test's `app.open()` relaunches it with them.
83
91
  * One slot after another, on purpose: workers
@@ -89,8 +97,11 @@ export declare class DevicePool {
89
97
  * here too: the first attempt could only meet the same runner and fail
90
98
  * its first observation with the app blamed, and the message names the
91
99
  * 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.
100
+ * hide. A runner that did not start leaves the slot unopened: the open
101
+ * would start it again under a shorter budget, and its timeout resets the
102
+ * daemon every earlier slot is on. A build `appPath` installs in `init` is
103
+ * not on the device yet, so that slot boots and starts the runner only,
104
+ * unless a lease says the build is already there.
94
105
  */
95
106
  private warm;
96
107
  /** Holds a warm-up client for `finish`, before its first command: a boot that fails still opened the session. */
@@ -1 +1 @@
1
- {"version":3,"file":"pool.d.ts","sourceRoot":"","sources":["../src/pool.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAKL,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACzB,MAAM,YAAY,CAAC;AACpB,OAAO,EAA+F,KAAK,WAAW,EAAE,MAAM,eAAe,CAAC;AAE9I,OAAO,KAAK,EAAqB,aAAa,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAQpG,qIAAqI;AACrI,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,QAAQ,EAAE,cAAc,CAAC;IAClC,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAC7B,QAAQ,EAAE,cAAc,EACxB,OAAO,EAAE,IAAI,CAAC,WAAW,EAAE,QAAQ,GAAG,UAAU,CAAC,GAAG,SAAS,GAC5D,eAAe,CAKjB;AA8ED,qBAAa,UAAU;IAQnB,OAAO,CAAC,QAAQ,CAAC,OAAO;IACxB,OAAO,CAAC,QAAQ,CAAC,YAAY;IAR/B,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAe;IACtC,oGAAoG;IACpG,OAAO,CAAC,QAAQ,CAAC,KAAK,CAA6C;IACnE,8GAA8G;IAC9G,OAAO,CAAC,QAAQ,CAAC,MAAM,CAA0C;IAEjE,YACmB,OAA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CAAC,MAAM;CAKf"}
package/dist/pool.js CHANGED
@@ -108,6 +108,15 @@ export class DevicePool {
108
108
  this.createClient = createClient;
109
109
  this.source = sourceFor(options, createClient, (targetName, slot) => this.session(targetName, slot));
110
110
  }
111
+ /**
112
+ * The device provider when its service records the devices it leases,
113
+ * in every process: the pool is built from the options in the runner and
114
+ * in each worker alike. `undefined` for a local pool, or a provider
115
+ * without `record`.
116
+ */
117
+ get recorder() {
118
+ return this.source instanceof LeasedDevices ? this.source.recorder : undefined;
119
+ }
111
120
  /**
112
121
  * Workers the engine serves per target, one per device: known up front for
113
122
  * a configured pool, and `undefined` for a discovered or leased one until
@@ -171,10 +180,10 @@ export class DevicePool {
171
180
  await Promise.all([closing, this.source.finish?.(info)]);
172
181
  }
173
182
  /**
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
183
+ * Boots every bound device, starts the iOS automation runner on it, and
184
+ * opens the pinned app on it once, so the slot's session is on the app,
185
+ * which the returned binding records for the worker: a permission it
186
+ * presets there needs no open first. A plain foreground open, with none of the engine's
178
187
  * launch options: an app still running from an earlier run keeps its
179
188
  * process either way, and a test's `app.open()` relaunches it with them.
180
189
  * One slot after another, on purpose: workers
@@ -186,8 +195,11 @@ export class DevicePool {
186
195
  * here too: the first attempt could only meet the same runner and fail
187
196
  * its first observation with the app blamed, and the message names the
188
197
  * 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.
198
+ * hide. A runner that did not start leaves the slot unopened: the open
199
+ * would start it again under a shorter budget, and its timeout resets the
200
+ * daemon every earlier slot is on. A build `appPath` installs in `init` is
201
+ * not on the device yet, so that slot boots and starts the runner only,
202
+ * unless a lease says the build is already there.
191
203
  */
192
204
  async warm(bindings, info) {
193
205
  const warmed = [];
@@ -200,15 +212,16 @@ export class DevicePool {
200
212
  this.retain(info.targetName, client);
201
213
  info.log(`booting ${label} (${slot + 1} of ${bindings.length})`);
202
214
  await runCommand('boot', () => client.devices.boot(where), info.signal, at);
203
- const app = pinnedApp(this.options, binding.installedApp);
204
- if (app === undefined) {
215
+ const runnerUp = this.options.platform !== 'ios' || (await prepareRunner(client, where, info, at));
216
+ const app = pinnedApp(info.app, binding.installedApp);
217
+ if (app === undefined || !runnerUp) {
205
218
  warmed.push(binding);
206
219
  continue;
207
220
  }
208
221
  // 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`);
222
+ // is nothing to open: the first attempt installs it.
223
+ if (info.app.appPath !== undefined && binding.installedApp === undefined) {
224
+ info.log(`${label}: ${app} awaits the suite's device.installApp()`);
212
225
  warmed.push(binding);
213
226
  continue;
214
227
  }
@@ -219,7 +232,7 @@ export class DevicePool {
219
232
  catch (cause) {
220
233
  if (info.signal.aborted || isRunnerFailure(cause))
221
234
  throw cause;
222
- info.log(`${label}: automation runner not warmed up (${message(cause)}); the first attempt starts it`);
235
+ info.log(`${label}: ${app} did not open (${message(cause)}); the first attempt opens it`);
223
236
  warmed.push(binding);
224
237
  }
225
238
  }
@@ -232,4 +245,25 @@ export class DevicePool {
232
245
  this.warmed.set(targetName, clients);
233
246
  }
234
247
  }
248
+ /**
249
+ * Starts the slot's iOS automation runner under `prepare ios-runner`, whose
250
+ * startup budget covers a cold simulator. Left to the first `open`, the
251
+ * start runs inside that request's 90 s envelope, which a cold runner on a
252
+ * loaded CI Mac outlasts; a timed-out `open` resets the daemon, ending every
253
+ * other slot's session with it. A runner that is busy or wedged ends the run
254
+ * here, like a warm-up open that meets one; any other failure is logged and
255
+ * left to the first attempt. True when the runner is up.
256
+ */
257
+ async function prepareRunner(client, where, info, at) {
258
+ try {
259
+ await runCommand('prepare ios-runner', () => client.command.prepare({ action: 'ios-runner', ...where }), info.signal, at);
260
+ return true;
261
+ }
262
+ catch (cause) {
263
+ if (info.signal.aborted || isRunnerFailure(cause))
264
+ throw cause;
265
+ info.log(`${at}: automation runner not prepared (${message(cause)}); the first attempt starts it`);
266
+ return false;
267
+ }
268
+ }
235
269
  //# sourceMappingURL=pool.js.map
package/dist/pool.js.map CHANGED
@@ -1 +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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AC;IAED,iHAAiH;IACzG,MAAM,CAAC,UAAkB,EAAE,MAAyB;QAC1D,MAAM,OAAO,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,UAAU,CAAC,IAAI,EAAE,CAAC;QAClD,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACrB,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;IACvC,CAAC;CACF;AAED;;;;;;;;GAQG;AACH,KAAK,UAAU,aAAa,CAAC,MAAyB,EAAE,KAAsB,EAAE,IAAuB,EAAE,EAAU;IACjH,IAAI,CAAC;QACH,MAAM,UAAU,CAAC,oBAAoB,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,YAAY,EAAE,GAAG,KAAK,EAAE,CAAC,EAAE,IAAI,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;QAC1H,OAAO,IAAI,CAAC;IACd,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,IAAI,CAAC,MAAM,CAAC,OAAO,IAAI,eAAe,CAAC,KAAK,CAAC;YAAE,MAAM,KAAK,CAAC;QAC/D,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,qCAAqC,OAAO,CAAC,KAAK,CAAC,gCAAgC,CAAC,CAAC;QACnG,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC"}
@@ -2,11 +2,13 @@
2
2
  * The seam a hosted device service plugs into: a `DeviceProvider` leases one
3
3
  * device per worker slot for the run and hands back the agent-device daemon
4
4
  * that drives it. The engine acquires in `prepare`, drives each lease from
5
- * its worker, and releases in `finish`, on every exit path. Nothing here
5
+ * its worker, and releases in `finish`, on every exit path. A provider whose
6
+ * service records its devices records an attempt's video in place of
7
+ * agent-device, from the worker that drives the lease. Nothing here
6
8
  * knows any vendor: a hosted simulator service, a device farm, or a daemon on
7
9
  * a machine down the hall are each one small provider in user code.
8
10
  */
9
- import { type EngineFinishInfo, type EnginePrepareInfo } from 'e2e/engine';
11
+ import { type EngineFinishInfo, type EnginePrepareInfo, type ProviderRecordContext, type ProviderRecording } from 'e2e/engine';
10
12
  import { type DeviceClientConfig, type DeviceDaemon, type DeviceSource, type SlotBinding } from './bindings.ts';
11
13
  import type { MobileOptions, MobilePlatform } from './options.ts';
12
14
  /** What the engine asks a provider for: one device for one worker slot of a run. */
@@ -21,11 +23,17 @@ export interface DeviceRequest {
21
23
  readonly slot: number;
22
24
  /** Devices the run acquires for this target, in all. */
23
25
  readonly slots: number;
24
- /** The `app` option: the bundle id or package `app.open()` launches, when the config names one. */
26
+ /**
27
+ * The agent-device version this engine's client speaks, for a provider
28
+ * that picks the daemon version it starts: a daemon of another version may
29
+ * answer the same commands differently.
30
+ */
31
+ readonly agentDeviceVersion: string;
32
+ /** The target's `app.bundleId`: the bundle id or package `app.open()` launches, when the config names one. */
25
33
  readonly app?: string | undefined;
26
34
  /**
27
- * The build the engine would install, resolved to an absolute path, when
28
- * the config names one. A provider that installs it itself (uploading it,
35
+ * The build the engine would install (the target's `app.appPath`),
36
+ * resolved to an absolute path, when the config names one. A provider that installs it itself (uploading it,
29
37
  * or naming a build it already hosts) reports `installedApp` on the lease
30
38
  * and the engine skips its own install.
31
39
  */
@@ -42,12 +50,12 @@ export interface DeviceRequest {
42
50
  * JSON data only: a lease travels from the runner process to the worker that
43
51
  * drives it through the environment.
44
52
  */
45
- export interface DeviceLease extends SlotBinding {
53
+ export interface DeviceLease extends Omit<SlotBinding, 'leaseId'> {
46
54
  /**
47
55
  * The provider's handle on the lease (a session id); named in progress
48
56
  * lines and handed back to `release`. A provider may keep further fields on
49
57
  * the object it returns: `release` gets that same object, while only the
50
- * fields declared here travel to the worker.
58
+ * fields declared here travel to the worker, and `record` gets those.
51
59
  */
52
60
  readonly id: string;
53
61
  /**
@@ -71,7 +79,7 @@ export interface DeviceLease extends SlotBinding {
71
79
  /**
72
80
  * Bundle id or package of the app the provider installed from the
73
81
  * request's `appPath`, and only then: with it the engine installs nothing
74
- * and, without an `app` option, `app.open()` launches this app. A lease
82
+ * and, without an `app.bundleId`, `app.open()` launches this app. A lease
75
83
  * reporting one for a request without `appPath` fails the run.
76
84
  */
77
85
  readonly installedApp?: string | undefined;
@@ -90,16 +98,47 @@ export interface DeviceReleaseContext {
90
98
  * A source of hosted devices. `acquire` is called once per worker slot, for
91
99
  * every slot at once; `release` once per lease acquired, at the end of the
92
100
  * run, also after an `acquire` of another slot failed. Both run in the
93
- * runner process, so a provider may keep state between them.
101
+ * runner process, so a provider may keep state between them. `record` runs
102
+ * in the worker that drives the lease, which may be another process, so it
103
+ * must not rely on state `acquire` kept.
94
104
  */
95
105
  export interface DeviceProvider {
96
106
  /** Label in progress lines and error messages. */
97
107
  readonly name: string;
98
108
  acquire(request: DeviceRequest): Promise<DeviceLease>;
99
109
  release(lease: DeviceLease, context: DeviceReleaseContext): Promise<void>;
110
+ /**
111
+ * Records the leased device for an attempt that records video, in place of
112
+ * the engine's agent-device screen recording: the service's own recording
113
+ * of the device, called from the worker when the attempt starts its video.
114
+ * A provider that cannot record its devices leaves it out, and the engine
115
+ * records with agent-device. `lease` is the lease as it traveled to the
116
+ * worker: its `id` and the other fields declared on `DeviceLease`, never
117
+ * what else the provider kept on the object `acquire` returned.
118
+ * `ProviderRecording` comes from `e2e/engine`: its `stop` writes a file
119
+ * into the directory it is given, or names a recording the service keeps
120
+ * by URL.
121
+ */
122
+ record?(lease: DeviceLease, context: ProviderRecordContext): Promise<ProviderRecording>;
100
123
  }
124
+ /** A provider whose service records the devices it leases. */
125
+ export type RecordingDeviceProvider = DeviceProvider & Required<Pick<DeviceProvider, 'record'>>;
101
126
  /** Narrows an intended provider, or names what it is missing. */
102
127
  export declare function asDeviceProvider(device: object): DeviceProvider;
128
+ /**
129
+ * The lease a worker's binding stands for, as it traveled from the runner:
130
+ * its id and the fields `DeviceLease` declares, never anything else the
131
+ * provider kept on the object `acquire` returned. `undefined` for a binding
132
+ * no provider leased.
133
+ */
134
+ export declare function travelledLease(binding: SlotBinding | undefined): DeviceLease | undefined;
135
+ /**
136
+ * Starts the provider's recording of a leased device for one attempt. A
137
+ * failure is named after the provider and the lease, and one met once the
138
+ * signal aborted is a cancellation. A recording without a `startedAt` and a
139
+ * `stop()` is refused: the engine trusts nothing it did not write.
140
+ */
141
+ export declare function recordLease(provider: RecordingDeviceProvider, lease: DeviceLease, context: ProviderRecordContext): Promise<ProviderRecording>;
103
142
  /**
104
143
  * Devices a provider leases, one per slot, all at once: hosted sessions start
105
144
  * in parallel and are billed from the moment they do, so nothing waits on a
@@ -112,7 +151,9 @@ export declare class LeasedDevices implements DeviceSource {
112
151
  private readonly options;
113
152
  /** Leases granted so far, per target, filled as each `acquire` settles; a lease the engine then rejects is among them. */
114
153
  private readonly held;
115
- constructor(provider: DeviceProvider, options: Pick<MobileOptions, 'platform' | 'app' | 'appPath'>);
154
+ /** The provider when its service records the devices it leases; `undefined` leaves video to agent-device. */
155
+ readonly recorder: RecordingDeviceProvider | undefined;
156
+ constructor(provider: DeviceProvider, options: Pick<MobileOptions, 'platform'>);
116
157
  bind(info: EnginePrepareInfo): Promise<readonly SlotBinding[]>;
117
158
  finish(info: EngineFinishInfo): Promise<void>;
118
159
  }
@@ -1 +1 @@
1
- {"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../src/provider.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,EAAwC,KAAK,gBAAgB,EAAE,KAAK,iBAAiB,EAAE,MAAM,YAAY,CAAC;AACjH,OAAO,EAAiB,KAAK,kBAAkB,EAAE,KAAK,YAAY,EAAE,KAAK,YAAY,EAAE,KAAK,WAAW,EAAE,MAAM,eAAe,CAAC;AAG/H,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAElE,oFAAoF;AACpF,MAAM,WAAW,aAAa;IAC5B,6CAA6C;IAC7C,QAAQ,CAAC,QAAQ,EAAE,cA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CACzF;AAED,8DAA8D;AAC9D,MAAM,MAAM,uBAAuB,GAAG,cAAc,GAAG,QAAQ,CAAC,IAAI,CAAC,cAAc,EAAE,QAAQ,CAAC,CAAC,CAAC;AAEhG,iEAAiE;AACjE,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG,cAAc,CAc/D;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,WAAW,GAAG,SAAS,GAAG,WAAW,GAAG,SAAS,CAIxF;AAED;;;;;GAKG;AACH,wBAAsB,WAAW,CAAC,QAAQ,EAAE,uBAAuB,EAAE,KAAK,EAAE,WAAW,EAAE,OAAO,EAAE,qBAAqB,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAanJ;AA8BD;;;;;;GAMG;AACH,qBAAa,aAAc,YAAW,YAAY;IAO9C,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,OAAO;IAP1B,0HAA0H;IAC1H,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAoC;IACzD,6GAA6G;IAC7G,QAAQ,CAAC,QAAQ,EAAE,uBAAuB,GAAG,SAAS,CAAC;IAEvD,YACmB,QAAQ,EAAE,cAAc,EACxB,OAAO,EAAE,IAAI,CAAC,aAAa,EAAE,UAAU,CAAC,EAG1D;IAEK,IAAI,CAAC,IAAI,EAAE,iBAAiB,GAAG,OAAO,CAAC,SAAS,WAAW,EAAE,CAAC,CA2CnE;IAEK,MAAM,CAAC,IAAI,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,CAWlD;CACF"}
package/dist/provider.js CHANGED
@@ -2,15 +2,19 @@
2
2
  * The seam a hosted device service plugs into: a `DeviceProvider` leases one
3
3
  * device per worker slot for the run and hands back the agent-device daemon
4
4
  * that drives it. The engine acquires in `prepare`, drives each lease from
5
- * its worker, and releases in `finish`, on every exit path. Nothing here
5
+ * its worker, and releases in `finish`, on every exit path. A provider whose
6
+ * service records its devices records an attempt's video in place of
7
+ * agent-device, from the worker that drives the lease. Nothing here
6
8
  * knows any vendor: a hosted simulator service, a device farm, or a daemon on
7
9
  * a machine down the hall are each one small provider in user code.
8
10
  */
11
+ import { createRequire } from 'node:module';
9
12
  import path from 'node:path';
10
- import { ConfigurationError, EngineError, obj } from 'e2e/engine';
13
+ import { ConfigurationError, EngineError, isProviderRecording, obj, } from 'e2e/engine';
11
14
  import { isSlotBinding } from './bindings.js';
12
15
  import { message } from './errors.js';
13
16
  import { isLink } from './links.js';
17
+ import { cancelled } from './support.js';
14
18
  /** Narrows an intended provider, or names what it is missing. */
15
19
  export function asDeviceProvider(device) {
16
20
  const candidate = device;
@@ -22,15 +26,57 @@ export function asDeviceProvider(device) {
22
26
  throw new ConfigurationError('INVALID_CONFIG', `mobile: device provider "${candidate.name}" must implement ${member}()`);
23
27
  }
24
28
  }
29
+ if (candidate.record !== undefined && typeof candidate.record !== 'function') {
30
+ throw new ConfigurationError('INVALID_CONFIG', `mobile: device provider "${candidate.name}" has a record that is not a function`);
31
+ }
25
32
  return device;
26
33
  }
34
+ /**
35
+ * The lease a worker's binding stands for, as it traveled from the runner:
36
+ * its id and the fields `DeviceLease` declares, never anything else the
37
+ * provider kept on the object `acquire` returned. `undefined` for a binding
38
+ * no provider leased.
39
+ */
40
+ export function travelledLease(binding) {
41
+ if (binding?.leaseId === undefined)
42
+ return undefined;
43
+ const { leaseId, device, deviceId, daemon, client, installedApp } = binding;
44
+ return obj({ id: leaseId, device, deviceId, daemon, client, installedApp });
45
+ }
46
+ /**
47
+ * Starts the provider's recording of a leased device for one attempt. A
48
+ * failure is named after the provider and the lease, and one met once the
49
+ * signal aborted is a cancellation. A recording without a `startedAt` and a
50
+ * `stop()` is refused: the engine trusts nothing it did not write.
51
+ */
52
+ export async function recordLease(provider, lease, context) {
53
+ const failure = (detail, cause) => new EngineError('ENGINE_FAILURE', `device provider "${provider.name}" ${detail} for lease ${lease.id}`, { retryable: false, ...(cause === undefined ? {} : { cause }) });
54
+ if (context.signal.aborted)
55
+ throw cancelled(`recording from device provider "${provider.name}" cancelled`);
56
+ let recording;
57
+ try {
58
+ recording = await provider.record(lease, context);
59
+ }
60
+ catch (cause) {
61
+ if (context.signal.aborted)
62
+ throw cancelled(`recording from device provider "${provider.name}" cancelled`);
63
+ throw failure(`could not start recording: ${message(cause)}`, cause);
64
+ }
65
+ if (!isProviderRecording(recording))
66
+ throw failure('returned a recording without a start time and a stop()');
67
+ return recording;
68
+ }
69
+ /** The agent-device this package pins exactly, read from its manifest: the version every worker's client is. */
70
+ const AGENT_DEVICE_VERSION = createRequire(import.meta.url)('../package.json').dependencies['agent-device'];
27
71
  /** An object with a lease id: something the provider granted and `release` is owed, whatever the field check makes of it. */
28
72
  function isGrantedLease(value) {
29
73
  return typeof value === 'object' && value !== null && typeof value.id === 'string';
30
74
  }
31
75
  /** A granted lease checked field by field: the engine trusts nothing it did not write. */
32
76
  function isDeviceLease(lease) {
33
- return isSlotBinding(lease) && (lease.daemon !== undefined || lease.client !== undefined);
77
+ // `leaseId` is the engine's own field on a binding; a provider may keep a field of that name on its lease.
78
+ const declared = { ...lease, leaseId: undefined };
79
+ return isSlotBinding(declared) && (declared.daemon !== undefined || declared.client !== undefined);
34
80
  }
35
81
  const REJECTED_LEASE = 'returned a lease without an id and a daemon baseUrl or JSON client configuration (no `session` or daemon keys)';
36
82
  /** Runs every task, then reports the first failure: nothing is skipped because a sibling failed. */
@@ -55,14 +101,18 @@ export class LeasedDevices {
55
101
  options;
56
102
  /** Leases granted so far, per target, filled as each `acquire` settles; a lease the engine then rejects is among them. */
57
103
  held = new Map();
104
+ /** The provider when its service records the devices it leases; `undefined` leaves video to agent-device. */
105
+ recorder;
58
106
  constructor(provider, options) {
59
107
  this.provider = provider;
60
108
  this.options = options;
109
+ this.recorder = provider.record === undefined ? undefined : provider;
61
110
  }
62
111
  async bind(info) {
63
112
  const { provider } = this;
64
- const { platform, app } = this.options;
65
- const appPath = this.options.appPath === undefined ? undefined : path.resolve(info.projectRoot, this.options.appPath);
113
+ const { platform } = this.options;
114
+ const app = info.app.bundleId;
115
+ const appPath = info.app.appPath === undefined ? undefined : path.resolve(info.projectRoot, info.app.appPath);
66
116
  const held = [];
67
117
  this.held.set(info.targetName, held);
68
118
  info.log(`leasing ${info.slots} ${platform} device(s) from ${provider.name}`);
@@ -73,6 +123,7 @@ export class LeasedDevices {
73
123
  targetName: info.targetName,
74
124
  slot,
75
125
  slots: info.slots,
126
+ agentDeviceVersion: AGENT_DEVICE_VERSION,
76
127
  app,
77
128
  appPath,
78
129
  env: info.env,
@@ -96,7 +147,7 @@ export class LeasedDevices {
96
147
  info.log(`${provider.name}: leased ${lease.id}${lease.device === undefined ? '' : ` (${lease.device})`}`);
97
148
  return lease;
98
149
  }), `device provider "${provider.name}" could not lease a device`);
99
- return leases.map((lease) => obj({ device: lease.device, deviceId: lease.deviceId, daemon: lease.daemon, client: lease.client, installedApp: lease.installedApp }));
150
+ return leases.map((lease) => obj({ leaseId: lease.id, device: lease.device, deviceId: lease.deviceId, daemon: lease.daemon, client: lease.client, installedApp: lease.installedApp }));
100
151
  }
101
152
  async finish(info) {
102
153
  const { provider } = this;
@@ -1 +1 @@
1
- {"version":3,"file":"provider.js","sourceRoot":"","sources":["../src/provider.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,kBAAkB,EAAE,WAAW,EAAE,GAAG,EAAiD,MAAM,YAAY,CAAC;AACjH,OAAO,EAAE,aAAa,EAAmF,MAAM,eAAe,CAAC;AAC/H,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAgGpC,iEAAiE;AACjE,MAAM,UAAU,gBAAgB,CAAC,MAAc;IAC7C,MAAM,SAAS,GAAG,MAAwD,CAAC;IAC3E,IAAI,OAAO,SAAS,CAAC,IAAI,KAAK,QAAQ,IAAI,SAA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