@threenative/playtest 0.3.3 → 0.3.5
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/README.md +40 -2
- package/dist/capture.d.ts +30 -1
- package/dist/capture.js +92 -2
- package/dist/diagnostics-BhS6v2n1.d.ts +800 -0
- package/dist/index.d.ts +5 -3
- package/dist/index.js +1890 -140
- package/dist/protocol.d.ts +50 -2
- package/dist/protocol.js +10 -1
- package/dist/runner/cli.d.ts +4 -2
- package/dist/runner/cli.js +11425 -8070
- package/dist/runner/index.d.ts +163 -314
- package/dist/runner/index.js +12077 -9409
- package/dist/{diagnostics-Bpy15z5f.d.ts → schema-base-B5mr_Yr9.d.ts} +137 -440
- package/dist/shared-DK12BZyS.d.ts +489 -0
- package/dist/three/index.d.ts +19 -2
- package/dist/three/index.js +99 -27
- package/package.json +3 -2
- package/dist/shared-eFOF5bZO.d.ts +0 -288
|
@@ -0,0 +1,800 @@
|
|
|
1
|
+
import { x as IPlaytestToneCaptureObservation, t as IPlaytestVisualRegionBounds, u as IPlaytestVisualRegionTarget, y as IPlaytestDiagnosticsAssertion } from './schema-base-B5mr_Yr9.js';
|
|
2
|
+
import { JsonValue, IPlaytestRenderChainObservation, IPlaytestSceneObservation, IPlaytestSceneNodesObservation, IPlaytestStartupTimeline } from './protocol.js';
|
|
3
|
+
|
|
4
|
+
interface IAndroidDriverOptions {
|
|
5
|
+
activity: string;
|
|
6
|
+
adbPath?: string;
|
|
7
|
+
packageName: string;
|
|
8
|
+
serial?: string;
|
|
9
|
+
/** Android user id to target; when omitted, the device's current foreground user is detected. */
|
|
10
|
+
user?: string;
|
|
11
|
+
/**
|
|
12
|
+
* The rotation between the touchscreen's raw axes and the frame the app draws in, when the
|
|
13
|
+
* device cannot be asked.
|
|
14
|
+
*
|
|
15
|
+
* Normally this is read from the window — `dumpsys window`'s `mRotation`, inverted, and then
|
|
16
|
+
* `dumpsys input`'s `SurfaceOrientation` and the `user_rotation` setting behind it. Those two
|
|
17
|
+
* older sources are why this option exists: an orientation-locked game on a device whose
|
|
18
|
+
* display never rotated reads 0 from both while its window is turned 90° from the panel, so an
|
|
19
|
+
* injected touch lands somewhere else entirely and every input assertion fails for a reason
|
|
20
|
+
* that has nothing to do with the game.
|
|
21
|
+
*
|
|
22
|
+
* Set explicitly to make such a run reproducible, and say so in the evidence. Fails closed on
|
|
23
|
+
* anything but 0, 1, 2 or 3.
|
|
24
|
+
*/
|
|
25
|
+
touchRotation?: number;
|
|
26
|
+
}
|
|
27
|
+
interface IAndroidDriver {
|
|
28
|
+
/** Send the app behind HOME and wait until the device reports it unfocused. */
|
|
29
|
+
background?(): Promise<void>;
|
|
30
|
+
captureConsole(): Promise<Array<{
|
|
31
|
+
text: string;
|
|
32
|
+
type: string;
|
|
33
|
+
}>>;
|
|
34
|
+
/** The device this driver is bound to, when it knows; reported next to its metric samples. */
|
|
35
|
+
deviceSerial?(): string | undefined;
|
|
36
|
+
/** Bring the launched app back to the foreground without force-stopping it. */
|
|
37
|
+
foreground?(): Promise<void>;
|
|
38
|
+
isAlive(): Promise<boolean>;
|
|
39
|
+
/** What the device says about the app right now; the lifecycle phases are read from this. */
|
|
40
|
+
lifecycleState?(): Promise<IAndroidAppState>;
|
|
41
|
+
prepare(endpoint: string, mailboxRoot?: string, viewport?: {
|
|
42
|
+
height: number;
|
|
43
|
+
width: number;
|
|
44
|
+
}): Promise<void>;
|
|
45
|
+
readFile?(path: string): Promise<string | undefined>;
|
|
46
|
+
removeFile?(path: string): Promise<void>;
|
|
47
|
+
/** Lock the display to one rotation and wait until the device's own window reports it. */
|
|
48
|
+
rotate?(rotation: number): Promise<void>;
|
|
49
|
+
/** Raw adb passthrough, so the host can measure the device itself. Read-only probes only. */
|
|
50
|
+
runAdb?(args: readonly string[]): Promise<string>;
|
|
51
|
+
screenshot(path: string): Promise<void>;
|
|
52
|
+
setPointers?(pointers: readonly IAndroidPointer[]): Promise<IAndroidPointerInjection>;
|
|
53
|
+
startScreenRecording?(): Promise<void>;
|
|
54
|
+
/** One OS tap in viewport pixels. Works on emulators and physical devices alike. */
|
|
55
|
+
tap?(x: number, y: number): Promise<void>;
|
|
56
|
+
/** Put the soft keyboard away, and report whether one was up. */
|
|
57
|
+
hideKeyboard?(): Promise<boolean>;
|
|
58
|
+
stop(): Promise<void>;
|
|
59
|
+
stopScreenRecording?(path: string): Promise<void>;
|
|
60
|
+
writeFile?(path: string, contents: string): Promise<void>;
|
|
61
|
+
}
|
|
62
|
+
/** The device operations a scenario's `lifecycle` step can name. */
|
|
63
|
+
type IAndroidLifecycleOperation = "background" | "foreground" | "rotate";
|
|
64
|
+
/**
|
|
65
|
+
* One reading of the app, taken off the device and never off the game.
|
|
66
|
+
*
|
|
67
|
+
* `frames` is the platform's own count of frames drawn for this process (`dumpsys gfxinfo`), which
|
|
68
|
+
* is what makes "the surface stopped while backgrounded and started again after resume" a
|
|
69
|
+
* measurement rather than a claim. It is absent when the device declined to report one, and the
|
|
70
|
+
* runner treats that absence as a failure — a zero here would be indistinguishable from a game
|
|
71
|
+
* that genuinely drew nothing.
|
|
72
|
+
*/
|
|
73
|
+
interface IAndroidAppState {
|
|
74
|
+
focused: boolean;
|
|
75
|
+
frames?: number;
|
|
76
|
+
pid?: number;
|
|
77
|
+
/** `mRotation` for the app's window: how far its content is turned from the panel's frame. */
|
|
78
|
+
windowRotation?: number;
|
|
79
|
+
}
|
|
80
|
+
/** One device-observed lifecycle phase, in the order the scenario drove them. */
|
|
81
|
+
interface IPlaytestDeviceLifecyclePhase {
|
|
82
|
+
at: number;
|
|
83
|
+
focused: boolean;
|
|
84
|
+
frames: number;
|
|
85
|
+
/** Only on a `background` phase: the platform's frame count stopped before this reading. */
|
|
86
|
+
framesPaused?: boolean;
|
|
87
|
+
phase: IAndroidLifecycleOperation;
|
|
88
|
+
pid: number;
|
|
89
|
+
requestedRotation?: number;
|
|
90
|
+
windowRotation?: number;
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* The simulation-step count at each read around a driven lifecycle.
|
|
94
|
+
*
|
|
95
|
+
* A read the scenario never reached is `null` rather than a count this run did not take.
|
|
96
|
+
*/
|
|
97
|
+
interface IPlaytestDeviceLifecycleSteps {
|
|
98
|
+
afterAdvance: number | null;
|
|
99
|
+
afterForeground: number | null;
|
|
100
|
+
beforeBackground: number | null;
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* The simulation-step count read around a driven lifecycle, and what it says about continuity.
|
|
104
|
+
*
|
|
105
|
+
* The counter is runtime-owned, not device-observed: the platform counts drawn frames, and
|
|
106
|
+
* `dumpsys gfxinfo` has no physics counter, so only the plugin that performed the step can say
|
|
107
|
+
* whether the simulation moved. Neither the device nor a game-authored `GameState` can restate it.
|
|
108
|
+
*/
|
|
109
|
+
type IPlaytestDeviceLifecyclePhysics = {
|
|
110
|
+
available: false;
|
|
111
|
+
reason: string;
|
|
112
|
+
} | {
|
|
113
|
+
available: true;
|
|
114
|
+
/** Read immediately before the app went away, on its return before the advance, and after. */
|
|
115
|
+
steps: IPlaytestDeviceLifecycleSteps;
|
|
116
|
+
/** The count moved across the runner's advance after the app came back, or `null`. */
|
|
117
|
+
stepsAdvanced: boolean | null;
|
|
118
|
+
/** The count stood still while the app was away, or `null` for a scenario that never left. */
|
|
119
|
+
stepsPaused: boolean | null;
|
|
120
|
+
};
|
|
121
|
+
/**
|
|
122
|
+
* The runner's own account of a driven lifecycle, for a collector to bind to a scenario and an
|
|
123
|
+
* installed artifact. Nothing here was authored by the game.
|
|
124
|
+
*/
|
|
125
|
+
interface IPlaytestDeviceLifecycleObservation {
|
|
126
|
+
phases: readonly IPlaytestDeviceLifecyclePhase[];
|
|
127
|
+
/** Absent rather than zero on a build that installs no physics plugin, and a failed run rather
|
|
128
|
+
* than a value when the plugin advertised one and reported nothing readable. */
|
|
129
|
+
physics: IPlaytestDeviceLifecyclePhysics;
|
|
130
|
+
render: {
|
|
131
|
+
/** Frames advanced after the background phase, or `null` when there was nothing to compare. */
|
|
132
|
+
framesAdvanced: boolean | null;
|
|
133
|
+
/** Whether the device's own frame count stopped while the app was unfocused, or `null`. */
|
|
134
|
+
framesPaused: boolean | null;
|
|
135
|
+
};
|
|
136
|
+
/** The process every phase reported; a different pid anywhere is a failed run, not a row. */
|
|
137
|
+
session: {
|
|
138
|
+
pid: number;
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
interface IAndroidPointer {
|
|
142
|
+
buttons?: number;
|
|
143
|
+
id: number;
|
|
144
|
+
x: number;
|
|
145
|
+
y: number;
|
|
146
|
+
}
|
|
147
|
+
interface IAndroidPointerInjection {
|
|
148
|
+
activeIds: number[];
|
|
149
|
+
injection: "adb-emu-event-protocol-b";
|
|
150
|
+
rotation: number;
|
|
151
|
+
trackingIds: number[];
|
|
152
|
+
}
|
|
153
|
+
interface IAndroidTouchViewport {
|
|
154
|
+
device: {
|
|
155
|
+
height: number;
|
|
156
|
+
width: number;
|
|
157
|
+
};
|
|
158
|
+
logical: {
|
|
159
|
+
bottom: number;
|
|
160
|
+
left: number;
|
|
161
|
+
right: number;
|
|
162
|
+
top: number;
|
|
163
|
+
};
|
|
164
|
+
orientation: number | undefined;
|
|
165
|
+
physical: {
|
|
166
|
+
bottom: number;
|
|
167
|
+
left: number;
|
|
168
|
+
right: number;
|
|
169
|
+
top: number;
|
|
170
|
+
};
|
|
171
|
+
}
|
|
172
|
+
declare class AdbAndroidDriver implements IAndroidDriver {
|
|
173
|
+
private readonly options;
|
|
174
|
+
private static readonly COVERAGE_VIDEO_PATH;
|
|
175
|
+
/** Bounded polls for a lifecycle operation to become visible to the device's own readings. */
|
|
176
|
+
private static readonly LIFECYCLE_ATTEMPTS;
|
|
177
|
+
private readonly adbPath;
|
|
178
|
+
private screenrecord?;
|
|
179
|
+
private screenrecordError?;
|
|
180
|
+
private readonly touchSlots;
|
|
181
|
+
private nextTrackingId;
|
|
182
|
+
private rotation?;
|
|
183
|
+
private touchViewport?;
|
|
184
|
+
private readonly user?;
|
|
185
|
+
private activeUser?;
|
|
186
|
+
private readonly consolePids;
|
|
187
|
+
/** Set by a lifecycle `rotate`, whose display lock `stop()` has to free on its own account. */
|
|
188
|
+
private lifecycleRotationLocked;
|
|
189
|
+
private viewportPresented;
|
|
190
|
+
constructor(options: IAndroidDriverOptions);
|
|
191
|
+
prepare(endpoint: string, mailboxRoot?: string, viewport?: {
|
|
192
|
+
height: number;
|
|
193
|
+
width: number;
|
|
194
|
+
}): Promise<void>;
|
|
195
|
+
private rememberConsolePids;
|
|
196
|
+
private resolveUser;
|
|
197
|
+
/**
|
|
198
|
+
* Put the device into the scenario's viewport, and fail closed if it did not take.
|
|
199
|
+
*
|
|
200
|
+
* A silent failure here is the expensive one: the run continues, the touches arrive, the
|
|
201
|
+
* assertions go red, and the report blames the game for a device that was never showing the
|
|
202
|
+
* viewport the scenario asked for.
|
|
203
|
+
*/
|
|
204
|
+
private presentViewport;
|
|
205
|
+
tap(x: number, y: number): Promise<void>;
|
|
206
|
+
/**
|
|
207
|
+
* The three device operations a `lifecycle` step names, each waiting for the device to *report*
|
|
208
|
+
* the effect rather than for the command to return.
|
|
209
|
+
*
|
|
210
|
+
* `input keyevent 3` and `am start` both answer `OK` whether or not anything moved, and `wm
|
|
211
|
+
* user-rotation lock` answers the same way on a device whose rotation is pinned. A step that
|
|
212
|
+
* recorded a phase on the strength of the exit code alone would certify a device that never went
|
|
213
|
+
* away — which is the exact value the gate exists to read off the phone, so each op polls the
|
|
214
|
+
* reading it is about to claim and throws when the claim is false.
|
|
215
|
+
*/
|
|
216
|
+
background(): Promise<void>;
|
|
217
|
+
foreground(): Promise<void>;
|
|
218
|
+
rotate(rotation: number): Promise<void>;
|
|
219
|
+
lifecycleState(): Promise<IAndroidAppState>;
|
|
220
|
+
private waitForFocus;
|
|
221
|
+
/**
|
|
222
|
+
* Dismiss the soft keyboard and wait for it to actually be gone.
|
|
223
|
+
*
|
|
224
|
+
* Measured on the physical Pixel 8: focusing a text field opens the IME, the WebView reflows
|
|
225
|
+
* into the space left above it, and the page's centred menu rides up — so a coordinate computed
|
|
226
|
+
* against the scenario's viewport now points at the keyboard. A tap there does not merely miss
|
|
227
|
+
* the control; it types a character into the field it meant to submit.
|
|
228
|
+
*
|
|
229
|
+
* BACK is the dismissal the platform guarantees. The wait is the point: the reflow happens on
|
|
230
|
+
* the next layout pass, and a click sent into the middle of it lands wherever the menu was
|
|
231
|
+
* halfway through moving.
|
|
232
|
+
*/
|
|
233
|
+
hideKeyboard(): Promise<boolean>;
|
|
234
|
+
/**
|
|
235
|
+
* The device's own diagnostics, read once and parsed once.
|
|
236
|
+
*
|
|
237
|
+
* The read is the only step here that can fail for a reason the game did not cause: a hosted
|
|
238
|
+
* SwiftShader emulator drops the adb transport mid-dump, and `adb logcat -d` exits non-zero after
|
|
239
|
+
* printing part of the buffer — a run whose assertions all passed died on a truncated line (CI
|
|
240
|
+
* `clean-consumer`, 5th of 6 sequential runs). The native harnesses already answer that with one
|
|
241
|
+
* re-read after `wait-for-device` (#310, b12becde6); this mirrors it, including the named refusal
|
|
242
|
+
* exemption: a `KO:` reply is the device rejecting the command, and retrying it would hide that.
|
|
243
|
+
*/
|
|
244
|
+
captureConsole(): Promise<Array<{
|
|
245
|
+
text: string;
|
|
246
|
+
type: string;
|
|
247
|
+
}>>;
|
|
248
|
+
screenshot(path: string): Promise<void>;
|
|
249
|
+
startScreenRecording(): Promise<void>;
|
|
250
|
+
stopScreenRecording(path: string): Promise<void>;
|
|
251
|
+
isAlive(): Promise<boolean>;
|
|
252
|
+
setPointers(pointers: readonly IAndroidPointer[]): Promise<IAndroidPointerInjection>;
|
|
253
|
+
readFile(path: string): Promise<string | undefined>;
|
|
254
|
+
removeFile(path: string): Promise<void>;
|
|
255
|
+
stop(): Promise<void>;
|
|
256
|
+
private readRotation;
|
|
257
|
+
writeFile(path: string, contents: string): Promise<void>;
|
|
258
|
+
deviceSerial(): string | undefined;
|
|
259
|
+
/**
|
|
260
|
+
* The device-metrics probes read `dumpsys`, `logcat` and sysfs through here. Deliberately a
|
|
261
|
+
* thin passthrough rather than a metrics API: the parsing belongs to deviceMetrics.ts, which
|
|
262
|
+
* is unit-tested against real captured device output.
|
|
263
|
+
*/
|
|
264
|
+
runAdb(args: readonly string[]): Promise<string>;
|
|
265
|
+
private adb;
|
|
266
|
+
private waitForScreenRecorder;
|
|
267
|
+
private abortScreenRecording;
|
|
268
|
+
private serialArgs;
|
|
269
|
+
}
|
|
270
|
+
declare function parseAndroidConsole(output: string): Array<{
|
|
271
|
+
text: string;
|
|
272
|
+
type: string;
|
|
273
|
+
}>;
|
|
274
|
+
declare function parseAndroidTouchViewport(output: string): IAndroidTouchViewport;
|
|
275
|
+
/** Map a normalized logical-display point to the raw touchscreen axes. */
|
|
276
|
+
declare function touchPositionForViewport(x: number, y: number, viewport: IAndroidTouchViewport, rotationOverride?: number): [number, number];
|
|
277
|
+
/**
|
|
278
|
+
* Splits slot identity from coordinates into separate synced `adb emu event send` batches.
|
|
279
|
+
*
|
|
280
|
+
* The emulator console drops ABS_MT_POSITION_X/Y from any batch that also carries an
|
|
281
|
+
* ABS_MT_TRACKING_ID: the command reports `OK` and the coordinates never reach the device, so
|
|
282
|
+
* every contact lands at (0, 0) and a two-finger gesture reads as two touches in the same
|
|
283
|
+
* screen half — the exact failure that made the simultaneous-touch proof unprovable.
|
|
284
|
+
* Confirmed against `getevent -lt /dev/input/event2` on emulator 36.6.11 with the android-35
|
|
285
|
+
* google_apis image. Identity goes first so a slot exists before it is positioned.
|
|
286
|
+
*/
|
|
287
|
+
declare function androidTouchBatches(identity: readonly string[], positions: readonly string[]): string[][];
|
|
288
|
+
/**
|
|
289
|
+
* Confirm that Android reported the requested viewport, including the physical-size omission.
|
|
290
|
+
*
|
|
291
|
+
* @situation verify that an Android device presented the requested viewport
|
|
292
|
+
* @situation accept the physical panel size when `wm size` omits its override line
|
|
293
|
+
* @example viewportPresentationObserved(undefined, "1080x2400", { width: 1080, height: 2400 });
|
|
294
|
+
*/
|
|
295
|
+
declare function viewportPresentationObserved(override: string | undefined, expected: string | undefined, physical: {
|
|
296
|
+
height: number;
|
|
297
|
+
width: number;
|
|
298
|
+
}): boolean;
|
|
299
|
+
/**
|
|
300
|
+
* The touch rotation for the window `dumpsys window` just described, or `undefined`.
|
|
301
|
+
*
|
|
302
|
+
* `mRotation` says how far the window's content is turned from the panel's natural frame.
|
|
303
|
+
* {@link rotatedTouchPosition} converts the other way — a point in that content back to the
|
|
304
|
+
* panel's raw axes — so the value it needs is the inverse, and handing it `mRotation` directly
|
|
305
|
+
* is a 180-degree error on either odd rotation.
|
|
306
|
+
*
|
|
307
|
+
* This is the source of truth because it describes the *window*. `dumpsys input`'s
|
|
308
|
+
* `SurfaceOrientation` is absent on the emulator, and `user_rotation` is the user's preference:
|
|
309
|
+
* an orientation-locked game on a device the user never turned reads 0 there while its window
|
|
310
|
+
* is turned 90 degrees off the panel, so every injected touch lands somewhere else.
|
|
311
|
+
*/
|
|
312
|
+
declare function touchRotationFromWindowDump(dump: string): number | undefined;
|
|
313
|
+
/**
|
|
314
|
+
* Make the device present a scenario's declared viewport, one device pixel per CSS pixel.
|
|
315
|
+
*
|
|
316
|
+
* A scenario's `viewport` is a declared test condition, and the browser target honours it by
|
|
317
|
+
* sizing the window. Without the same courtesy here, a UI page lays out at whatever CSS viewport
|
|
318
|
+
* the device's density happens to give — 914x411 on a 2400x1080 panel at 420dpi — and a step
|
|
319
|
+
* that names a point in viewport pixels lands on whatever the device's own layout put there.
|
|
320
|
+
* Nothing about that failure looks like a coordinate problem: the touch arrives, the host
|
|
321
|
+
* hit-tests it honestly, and the control simply is not where the scenario said.
|
|
322
|
+
*
|
|
323
|
+
* Density 160 is the whole mechanism: it makes `devicePixelRatio` 1, so a viewport pixel, a CSS
|
|
324
|
+
* pixel and a device pixel are the same pixel and the page lays out exactly as it does on web.
|
|
325
|
+
* The size is written in the panel's natural frame, which is why it is transposed for the
|
|
326
|
+
* portrait-natural devices every phone and emulator here happens to be.
|
|
327
|
+
*/
|
|
328
|
+
declare function viewportPresentationCommands(viewport: {
|
|
329
|
+
height: number;
|
|
330
|
+
width: number;
|
|
331
|
+
}, physical: {
|
|
332
|
+
height: number;
|
|
333
|
+
width: number;
|
|
334
|
+
}): string[][];
|
|
335
|
+
/**
|
|
336
|
+
* One OS-level tap, in the display's current orientation.
|
|
337
|
+
*
|
|
338
|
+
* With the viewport presented, that orientation *is* the scenario's viewport and the coordinate
|
|
339
|
+
* needs no rotation — which is the second reason to prefer this over the emulator's pointer
|
|
340
|
+
* protocol. The first is that `adb emu event send` exists only on emulators, and a click step
|
|
341
|
+
* that only works on an emulator is a click step that does not work.
|
|
342
|
+
*/
|
|
343
|
+
declare function tapCommand(x: number, y: number): string[];
|
|
344
|
+
/** Whether an input method window is on screen, from `dumpsys input_method`. */
|
|
345
|
+
declare function keyboardIsShown(dump: string): boolean;
|
|
346
|
+
/**
|
|
347
|
+
* Undo the presentation.
|
|
348
|
+
*
|
|
349
|
+
* `reset` and never the numbers read beforehand: a run that crashed between reading and writing
|
|
350
|
+
* would restore a size it had already replaced, and leave the device quietly wrong for whoever
|
|
351
|
+
* measures on it next.
|
|
352
|
+
*/
|
|
353
|
+
declare function viewportRestoreCommands(): string[][];
|
|
354
|
+
declare function rotatedTouchPosition(x: number, y: number, rotation: number): [number, number];
|
|
355
|
+
declare function discoverAdb(environment?: NodeJS.ProcessEnv): string;
|
|
356
|
+
|
|
357
|
+
/**
|
|
358
|
+
* Device thermal, power and battery state as a first-class measured observation.
|
|
359
|
+
*
|
|
360
|
+
* Why this exists, measured on 2026-08-24 against a physical Pixel 8: two cold-launch runs
|
|
361
|
+
* reported 44 s to first frame against a 14.7 s baseline, and the difference was attributed to a
|
|
362
|
+
* code change. It was not. The device had climbed to 43.2 °C at thermal status 2 while the
|
|
363
|
+
* baseline ran at 38.2 °C at status 0 — the run was throttled, and nothing in the playtest report
|
|
364
|
+
* said so. Every agent that needs this answer has been hand-rolling `adb shell dumpsys` for it.
|
|
365
|
+
*
|
|
366
|
+
* Two rules this module holds to:
|
|
367
|
+
*
|
|
368
|
+
* 1. **Never report a zero for something that was not measured.** A rail breakdown a device does
|
|
369
|
+
* not expose comes back `{ available: false, reason }`, never `0 mW`. Google's per-rail ODPM
|
|
370
|
+
* numbers exist on Pixel hardware and nowhere else.
|
|
371
|
+
* 2. **Never discard a confounded run's numbers, and never let it pass as comparable.** The
|
|
372
|
+
* samples are always reported; the verdict says whether the run may be compared with a cool
|
|
373
|
+
* one. A missing sample is a failure, not a skip.
|
|
374
|
+
*
|
|
375
|
+
* The parsers here read real `dumpsys` and `logcat` text. Captured samples of every format live in
|
|
376
|
+
* `__tests__/fixtures/device-metrics/`.
|
|
377
|
+
*/
|
|
378
|
+
/** Battery temperature at or above which a run is treated as having started hot, in °C. */
|
|
379
|
+
declare const HOT_START_TEMPERATURE_C = 40;
|
|
380
|
+
/** How often the recorder samples while a scenario runs, in milliseconds. */
|
|
381
|
+
declare const DEVICE_METRICS_CADENCE_MS = 5000;
|
|
382
|
+
/** Ceiling on retained samples, so a long run cannot outgrow the bridge payload budget. */
|
|
383
|
+
declare const DEVICE_METRICS_MAX_SAMPLES = 240;
|
|
384
|
+
declare class DeviceMetricsError extends Error {
|
|
385
|
+
readonly code: string;
|
|
386
|
+
readonly observed: string;
|
|
387
|
+
constructor(code: string, detail: string, observed: string);
|
|
388
|
+
}
|
|
389
|
+
/** A reading that a given device may simply not expose. Absent means absent, never zero. */
|
|
390
|
+
type PlaytestDeviceMeasurement<T> = {
|
|
391
|
+
available: false;
|
|
392
|
+
reason: string;
|
|
393
|
+
} | {
|
|
394
|
+
available: true;
|
|
395
|
+
value: T;
|
|
396
|
+
};
|
|
397
|
+
interface IPlaytestDeviceBattery {
|
|
398
|
+
chargeCounterUah?: number;
|
|
399
|
+
charging: boolean;
|
|
400
|
+
levelPercent: number;
|
|
401
|
+
/** `dumpsys battery` status: 2 charging, 3 discharging, 4 not charging, 5 full. */
|
|
402
|
+
status: number;
|
|
403
|
+
temperatureC: number;
|
|
404
|
+
voltageMv?: number;
|
|
405
|
+
}
|
|
406
|
+
interface IPlaytestDeviceThermal {
|
|
407
|
+
sensors: Record<string, number>;
|
|
408
|
+
skinSensorName?: string;
|
|
409
|
+
skinTemperatureC: PlaytestDeviceMeasurement<number>;
|
|
410
|
+
status: number;
|
|
411
|
+
statusName: string;
|
|
412
|
+
}
|
|
413
|
+
type PlaytestDevicePowerRails = {
|
|
414
|
+
available: false;
|
|
415
|
+
reason: string;
|
|
416
|
+
} | {
|
|
417
|
+
at: string;
|
|
418
|
+
available: true;
|
|
419
|
+
rails: Record<string, number>;
|
|
420
|
+
totalMw: number;
|
|
421
|
+
windowMs: number;
|
|
422
|
+
};
|
|
423
|
+
interface IPlaytestDeviceMetricsSample {
|
|
424
|
+
/** Milliseconds since the recorder was created. */
|
|
425
|
+
at: number;
|
|
426
|
+
batteryLevelPercent: number;
|
|
427
|
+
batteryStatus: number;
|
|
428
|
+
batteryTemperatureC: number;
|
|
429
|
+
charging: boolean;
|
|
430
|
+
/** Negative is discharge, matching the sysfs sign convention. */
|
|
431
|
+
currentMa: PlaytestDeviceMeasurement<number>;
|
|
432
|
+
phase: "after" | "before" | "during";
|
|
433
|
+
powerRails: PlaytestDevicePowerRails;
|
|
434
|
+
skinTemperatureC: PlaytestDeviceMeasurement<number>;
|
|
435
|
+
thermalStatus: number;
|
|
436
|
+
thermalStatusName: string;
|
|
437
|
+
}
|
|
438
|
+
interface IPlaytestDeviceMetricsVerdict {
|
|
439
|
+
endTemperatureC: number | null;
|
|
440
|
+
endThermalStatus: number | null;
|
|
441
|
+
maxThermalStatus: number | null;
|
|
442
|
+
peakTemperatureC: number | null;
|
|
443
|
+
/**
|
|
444
|
+
* Whether a fresh per-rail power window was logged between the first and last sample. When it
|
|
445
|
+
* is false the rail figures describe a window that predates the run and are not attributable
|
|
446
|
+
* to it; `null` when the device exposes no rails at all.
|
|
447
|
+
*/
|
|
448
|
+
powerRailWindowAdvanced: boolean | null;
|
|
449
|
+
/** Named codes: charging, hot-start, incomplete, thermal-status-rose, throttled-start. */
|
|
450
|
+
reasons: string[];
|
|
451
|
+
startTemperatureC: number | null;
|
|
452
|
+
startThermalStatus: number | null;
|
|
453
|
+
temperatureRiseC: number | null;
|
|
454
|
+
thermallyConfounded: boolean;
|
|
455
|
+
}
|
|
456
|
+
interface IPlaytestDeviceMetricsObservation {
|
|
457
|
+
available: boolean;
|
|
458
|
+
/** Probe failures, kept rather than dropped: an unexplained gap is itself the finding. */
|
|
459
|
+
errors: string[];
|
|
460
|
+
samples: IPlaytestDeviceMetricsSample[];
|
|
461
|
+
serial?: string;
|
|
462
|
+
source: string;
|
|
463
|
+
verdict: IPlaytestDeviceMetricsVerdict;
|
|
464
|
+
}
|
|
465
|
+
declare function parseDeviceBattery(output: string): IPlaytestDeviceBattery;
|
|
466
|
+
declare function parseDeviceThermal(output: string): IPlaytestDeviceThermal;
|
|
467
|
+
/**
|
|
468
|
+
* `/sys/class/power_supply/battery/current_now` in microamps. A device that does not expose the
|
|
469
|
+
* node answers with `cat`'s error text, which is unavailability, not a zero-current reading.
|
|
470
|
+
*/
|
|
471
|
+
declare function parseDeviceCurrent(output: string): PlaytestDeviceMeasurement<number>;
|
|
472
|
+
/**
|
|
473
|
+
* Pixel's on-device power monitor writes a whole-rail breakdown to logcat once per ~60 s window,
|
|
474
|
+
* as `Power rails total power: 547.76 mW for 60014 ms` followed by `[RAIL: n mW]` groups. Devices
|
|
475
|
+
* without Google's ODPM hardware log nothing here, and must say so rather than report zeros.
|
|
476
|
+
*/
|
|
477
|
+
declare function parseDevicePowerRails(output: string): PlaytestDevicePowerRails;
|
|
478
|
+
/**
|
|
479
|
+
* The thermal verdict. It never removes a number — a confounded run reports everything it
|
|
480
|
+
* measured — it only states whether this run may be compared with a cool one.
|
|
481
|
+
*/
|
|
482
|
+
declare function summarizeDeviceMetrics(samples: readonly IPlaytestDeviceMetricsSample[]): IPlaytestDeviceMetricsVerdict;
|
|
483
|
+
interface IDeviceMetricsRecorderOptions {
|
|
484
|
+
adb(args: readonly string[]): Promise<string>;
|
|
485
|
+
cadenceMs?: number;
|
|
486
|
+
now?(): number;
|
|
487
|
+
serial?: string;
|
|
488
|
+
}
|
|
489
|
+
/**
|
|
490
|
+
* Samples the device around and during a run. The periodic sampler is wall-clock paced on
|
|
491
|
+
* purpose and deliberately reads nothing the scenario depends on: it observes the phone, it
|
|
492
|
+
* never advances or gates a tick, so scenario determinism is untouched.
|
|
493
|
+
*/
|
|
494
|
+
declare class DeviceMetricsRecorder {
|
|
495
|
+
private readonly options;
|
|
496
|
+
private readonly errors;
|
|
497
|
+
private readonly samples;
|
|
498
|
+
private readonly startedAt;
|
|
499
|
+
private timer?;
|
|
500
|
+
constructor(options: IDeviceMetricsRecorderOptions);
|
|
501
|
+
sampleNow(phase: IPlaytestDeviceMetricsSample["phase"]): Promise<IPlaytestDeviceMetricsSample>;
|
|
502
|
+
/** Begins periodic `during` sampling. A periodic probe failure is recorded, never thrown away. */
|
|
503
|
+
start(): void;
|
|
504
|
+
stop(): void;
|
|
505
|
+
observation(): IPlaytestDeviceMetricsObservation;
|
|
506
|
+
private now;
|
|
507
|
+
private probe;
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
type PlaytestVec3 = [number, number, number];
|
|
511
|
+
/** One honest-reporting line: a placement/aim/spawn override the scenario requested. */
|
|
512
|
+
interface IPlaytestSetupRecord {
|
|
513
|
+
entity?: string;
|
|
514
|
+
kind: "aim" | "entities" | "place" | "resources" | "spawn";
|
|
515
|
+
value: JsonValue;
|
|
516
|
+
}
|
|
517
|
+
/**
|
|
518
|
+
* Requested overrides next to what actually applied; an unapplied request fails the run.
|
|
519
|
+
*
|
|
520
|
+
* `confirmedBy` says which of those two sentences the evidence supports. `read-back` means the
|
|
521
|
+
* bridge named the ids it applied and `applied` is that answer. `throw-contract` means the bridge
|
|
522
|
+
* resolved without naming anything, so the only evidence is that it did not throw — `applied`
|
|
523
|
+
* mirrors `requested` there, and the field is what stops the report reading as a confirmation it
|
|
524
|
+
* never received.
|
|
525
|
+
*/
|
|
526
|
+
interface IPlaytestSetupApplication {
|
|
527
|
+
applied: IPlaytestSetupRecord[];
|
|
528
|
+
requested: IPlaytestSetupRecord[];
|
|
529
|
+
confirmedBy?: "read-back" | "throw-contract";
|
|
530
|
+
}
|
|
531
|
+
interface IPlaytestTransformSample {
|
|
532
|
+
frame: number;
|
|
533
|
+
position: PlaytestVec3;
|
|
534
|
+
rotation?: readonly [number, number, number, number];
|
|
535
|
+
tick: number;
|
|
536
|
+
}
|
|
537
|
+
interface IPlaytestFollowReport {
|
|
538
|
+
after?: IPlaytestTransformSample;
|
|
539
|
+
before?: IPlaytestTransformSample;
|
|
540
|
+
entity: string;
|
|
541
|
+
moved?: number;
|
|
542
|
+
separation?: number;
|
|
543
|
+
within: number;
|
|
544
|
+
}
|
|
545
|
+
interface IPlaytestDiagnosticsPolicy {
|
|
546
|
+
consoleErrorsOptOutReason?: string;
|
|
547
|
+
networkErrorsOptOutReason?: string;
|
|
548
|
+
noConsoleErrors: boolean;
|
|
549
|
+
noNetworkErrors: boolean;
|
|
550
|
+
noRuntimeDiagnostics: boolean;
|
|
551
|
+
runtimeReady?: boolean;
|
|
552
|
+
runtimeDiagnosticsOptOutReason?: string;
|
|
553
|
+
}
|
|
554
|
+
interface IPlaytestCaptureProvenance {
|
|
555
|
+
adapter: Record<string, string>;
|
|
556
|
+
browserArgs: readonly string[];
|
|
557
|
+
/**
|
|
558
|
+
* How this run's pixels were captured. `page.screenshot` is a browser capture session;
|
|
559
|
+
* `device.screenshot` is a native host asked for its framebuffer directly.
|
|
560
|
+
*/
|
|
561
|
+
captureMethod: "device.screenshot" | "page.screenshot";
|
|
562
|
+
rendererKind: "webgl" | "webgpu";
|
|
563
|
+
target: string;
|
|
564
|
+
viewport: IPlaytestViewport;
|
|
565
|
+
}
|
|
566
|
+
interface IPlaytestTrivialityOptOut {
|
|
567
|
+
id: string;
|
|
568
|
+
reason: string;
|
|
569
|
+
}
|
|
570
|
+
interface IPlaytestViewport {
|
|
571
|
+
height: number;
|
|
572
|
+
width: number;
|
|
573
|
+
}
|
|
574
|
+
interface IPlaytestReport {
|
|
575
|
+
after?: IPlaytestTransformSample;
|
|
576
|
+
assertionResults?: IPlaytestAssertionResult[];
|
|
577
|
+
before?: IPlaytestTransformSample;
|
|
578
|
+
capture?: IPlaytestCaptureProvenance;
|
|
579
|
+
diagnostics: IPlaytestDiagnostic[];
|
|
580
|
+
diagnosticsPolicy?: IPlaytestDiagnosticsPolicy;
|
|
581
|
+
distance: number;
|
|
582
|
+
effectLog?: unknown;
|
|
583
|
+
entity: string;
|
|
584
|
+
expectAxis?: string;
|
|
585
|
+
expectMoved: boolean;
|
|
586
|
+
follow?: IPlaytestFollowReport;
|
|
587
|
+
frames: number;
|
|
588
|
+
movementDelta?: PlaytestVec3;
|
|
589
|
+
observations?: IPlaytestObservations;
|
|
590
|
+
pathLength?: number;
|
|
591
|
+
setup?: IPlaytestSetupApplication;
|
|
592
|
+
/**
|
|
593
|
+
* The target the run executed on — `browser`, `android`, `desktop`, `ios`.
|
|
594
|
+
*
|
|
595
|
+
* Not the scenario file's `target` field, which the two differ from routinely:
|
|
596
|
+
* `examples/native-smoke/playtests/*.json` say `"target": "web"` and are driven with
|
|
597
|
+
* `--target android`. Evaluators that must know what the lane can observe read this one.
|
|
598
|
+
*/
|
|
599
|
+
target?: string;
|
|
600
|
+
trivialityOptOuts: IPlaytestTrivialityOptOut[];
|
|
601
|
+
}
|
|
602
|
+
|
|
603
|
+
type Vec3 = [number, number, number];
|
|
604
|
+
interface IPlaytestDiagnostic {
|
|
605
|
+
artifactPath?: string;
|
|
606
|
+
code: string;
|
|
607
|
+
exportName?: string;
|
|
608
|
+
gate?: "waived-headless";
|
|
609
|
+
message: string;
|
|
610
|
+
modulePath?: string;
|
|
611
|
+
observedRuntimePath?: string;
|
|
612
|
+
path?: string;
|
|
613
|
+
resourceId?: string;
|
|
614
|
+
severity: "error" | "warning";
|
|
615
|
+
sourcePath?: string;
|
|
616
|
+
suggestion?: string;
|
|
617
|
+
systemId?: string;
|
|
618
|
+
}
|
|
619
|
+
interface IPlaytestAssertionResult {
|
|
620
|
+
details?: Record<string, unknown>;
|
|
621
|
+
id: string;
|
|
622
|
+
pass: boolean;
|
|
623
|
+
}
|
|
624
|
+
interface IPlaytestVisualElementRegionObservation {
|
|
625
|
+
assertionIndex: number;
|
|
626
|
+
bounds?: IPlaytestVisualRegionBounds;
|
|
627
|
+
darkPixelRatio?: number;
|
|
628
|
+
element: IPlaytestVisualRegionTarget;
|
|
629
|
+
nonblankPixelRatio?: number;
|
|
630
|
+
rendered: boolean;
|
|
631
|
+
}
|
|
632
|
+
interface IPlaytestObservations {
|
|
633
|
+
tone?: IPlaytestToneCaptureObservation[];
|
|
634
|
+
animation?: unknown;
|
|
635
|
+
components?: Record<string, Record<string, {
|
|
636
|
+
after?: unknown;
|
|
637
|
+
before?: unknown;
|
|
638
|
+
}>>;
|
|
639
|
+
componentSeries?: Array<{
|
|
640
|
+
label: string;
|
|
641
|
+
snapshots: Record<string, Record<string, unknown>>;
|
|
642
|
+
tick: number;
|
|
643
|
+
}>;
|
|
644
|
+
console: Array<{
|
|
645
|
+
source?: "browser-console" | "page-error" | "unhandled-rejection";
|
|
646
|
+
text: string;
|
|
647
|
+
type: string;
|
|
648
|
+
}>;
|
|
649
|
+
contacts?: unknown;
|
|
650
|
+
debugColliderCount?: number;
|
|
651
|
+
/**
|
|
652
|
+
* Host-measured device lifecycle: the phases a `lifecycle` step drove and what the device said
|
|
653
|
+
* about the app at each one. Produced by the android target, never by the game.
|
|
654
|
+
*/
|
|
655
|
+
deviceLifecycle?: IPlaytestDeviceLifecycleObservation;
|
|
656
|
+
/** Host-measured device thermal, power and battery state; produced by the android target. */
|
|
657
|
+
deviceMetrics?: IPlaytestDeviceMetricsObservation;
|
|
658
|
+
effectLog?: unknown;
|
|
659
|
+
effectLogBefore?: unknown;
|
|
660
|
+
effectLogSeries?: Array<{
|
|
661
|
+
label: string;
|
|
662
|
+
snapshot: unknown;
|
|
663
|
+
tick: number;
|
|
664
|
+
}>;
|
|
665
|
+
entityTransforms?: Record<string, {
|
|
666
|
+
halfExtents?: Vec3;
|
|
667
|
+
position?: Vec3;
|
|
668
|
+
scale?: Vec3;
|
|
669
|
+
}>;
|
|
670
|
+
framebufferCoverage?: IPlaytestFramebufferCoverageObservation;
|
|
671
|
+
/** The per-object geometry capture report, present only when the scenario requested one. */
|
|
672
|
+
geometry?: JsonValue;
|
|
673
|
+
hud: Record<string, {
|
|
674
|
+
after?: unknown;
|
|
675
|
+
before?: unknown;
|
|
676
|
+
}>;
|
|
677
|
+
overlayNodes?: Record<string, {
|
|
678
|
+
after?: unknown;
|
|
679
|
+
before?: unknown;
|
|
680
|
+
}>;
|
|
681
|
+
network: Array<{
|
|
682
|
+
method: string;
|
|
683
|
+
url: string;
|
|
684
|
+
}>;
|
|
685
|
+
physicsDebug?: unknown;
|
|
686
|
+
physicsDebugBefore?: unknown;
|
|
687
|
+
physicsDebugSeries?: Array<{
|
|
688
|
+
label: string;
|
|
689
|
+
snapshot: unknown;
|
|
690
|
+
tick: number;
|
|
691
|
+
}>;
|
|
692
|
+
performanceSeries?: unknown[];
|
|
693
|
+
/** Bounded shader/pipeline creation capture from the engine's renderer boundary. */
|
|
694
|
+
pipelineCensus?: JsonValue;
|
|
695
|
+
renderChain?: IPlaytestRenderChainObservation;
|
|
696
|
+
resources: Record<string, {
|
|
697
|
+
after?: unknown;
|
|
698
|
+
before?: unknown;
|
|
699
|
+
}>;
|
|
700
|
+
/** Lights, materials, fog, background, camera framing and world extent, as the bridge found them. */
|
|
701
|
+
scene?: IPlaytestSceneObservation;
|
|
702
|
+
sceneNodes?: IPlaytestSceneNodesObservation[];
|
|
703
|
+
/** The startup observation the runner waited on, with the rule it resolved under. */
|
|
704
|
+
startup?: {
|
|
705
|
+
compileSettled?: boolean;
|
|
706
|
+
phase: string;
|
|
707
|
+
progress: number;
|
|
708
|
+
rule?: string;
|
|
709
|
+
timeline?: IPlaytestStartupTimeline;
|
|
710
|
+
};
|
|
711
|
+
resourceSeries?: Array<{
|
|
712
|
+
label: string;
|
|
713
|
+
snapshots: Record<string, unknown>;
|
|
714
|
+
tick: number;
|
|
715
|
+
}>;
|
|
716
|
+
runtimeObservations?: unknown;
|
|
717
|
+
runtimeDiagnostics?: unknown;
|
|
718
|
+
runtimeDiagnosticsBefore?: unknown;
|
|
719
|
+
signals?: unknown[];
|
|
720
|
+
signalSeries?: Array<{
|
|
721
|
+
label: string;
|
|
722
|
+
signals: unknown[];
|
|
723
|
+
tick: number;
|
|
724
|
+
}>;
|
|
725
|
+
visibility?: Record<string, unknown>;
|
|
726
|
+
visual?: {
|
|
727
|
+
captureFailure?: {
|
|
728
|
+
code: "TN_CAPTURE_BLANK";
|
|
729
|
+
label: string;
|
|
730
|
+
reason: string;
|
|
731
|
+
};
|
|
732
|
+
changedPixelRatio?: number;
|
|
733
|
+
comparisonSource?: string;
|
|
734
|
+
elementRegions?: IPlaytestVisualElementRegionObservation[];
|
|
735
|
+
nonblankRegions?: Array<{
|
|
736
|
+
darkPixelRatio?: number;
|
|
737
|
+
height: number;
|
|
738
|
+
nonblankPixelRatio: number;
|
|
739
|
+
width: number;
|
|
740
|
+
x: number;
|
|
741
|
+
y: number;
|
|
742
|
+
}>;
|
|
743
|
+
/** Visual frame observations only; performance samples live in performanceSeries. */
|
|
744
|
+
runtimeDiagnosticsSeries?: unknown[];
|
|
745
|
+
};
|
|
746
|
+
}
|
|
747
|
+
/**
|
|
748
|
+
* The policy the evaluator actually applies, defaults included.
|
|
749
|
+
*
|
|
750
|
+
* `target` is the target the run *executed on*, not the scenario file's `target` field — the two
|
|
751
|
+
* differ routinely, because `examples/native-smoke/playtests/*.json` say `"target": "web"` and are
|
|
752
|
+
* driven with `--target android`.
|
|
753
|
+
*
|
|
754
|
+
* Why the target matters: the three channels default to on, and the evaluator applies that default
|
|
755
|
+
* on every run. On a device lane the network observation is hardwired empty, so
|
|
756
|
+
* `noNetworkErrors: true` was compared against an empty array and reported a passing row — a green
|
|
757
|
+
* computed from evidence the target structurally cannot produce, which is the one thing this
|
|
758
|
+
* harness exists not to do. The asymmetry was visible in the scenarios too: one that spelled out
|
|
759
|
+
* `noNetworkErrors: true` failed honestly with `TN_PLAYTEST_UNSUPPORTED_ON_TARGET`, and the same
|
|
760
|
+
* scenario with the field omitted passed.
|
|
761
|
+
*
|
|
762
|
+
* So on a network-blind target the default is **off, with the reason recorded in the policy the
|
|
763
|
+
* report prints**. An explicit `true` is left exactly as written, because that is a scenario asking
|
|
764
|
+
* for something the target cannot do, and the runner still fails it by name.
|
|
765
|
+
*/
|
|
766
|
+
declare function resolveDiagnosticsPolicy(policy: IPlaytestDiagnosticsAssertion | undefined, target?: string): IPlaytestDiagnosticsPolicy;
|
|
767
|
+
interface IPlaytestFramebufferCoverageObservation {
|
|
768
|
+
boundarySource: "scenario-steps" | "video-backdrop-dominance";
|
|
769
|
+
firstViolation?: {
|
|
770
|
+
frameIndex: number;
|
|
771
|
+
grid: {
|
|
772
|
+
columns: number;
|
|
773
|
+
rows: number;
|
|
774
|
+
samples: Array<[number, number, number]>;
|
|
775
|
+
};
|
|
776
|
+
screenshotPath: string;
|
|
777
|
+
};
|
|
778
|
+
frameCount: number;
|
|
779
|
+
unreadableReason?: string;
|
|
780
|
+
windowCompleted: boolean;
|
|
781
|
+
windowStarted: boolean;
|
|
782
|
+
}
|
|
783
|
+
|
|
784
|
+
type PlaytestDiagnosticCode = "TN_PLAYTEST_ANDROID_LIFECYCLE_NOT_APPLIED" | "TN_PLAYTEST_ANDROID_LIFECYCLE_PHYSICS_UNOBSERVED" | "TN_PLAYTEST_ANDROID_LIFECYCLE_SESSION_CHANGED" | "TN_PLAYTEST_ANDROID_LIFECYCLE_UNOBSERVED" | "TN_PLAYTEST_BRIDGE_INCOMPATIBLE" | "TN_PLAYTEST_BRIDGE_CAPABILITY_UNKNOWN" | "TN_PLAYTEST_BRIDGE_MISSING" | "TN_PLAYTEST_BRIDGE_NOT_READY" | "TN_PLAYTEST_CAPTURE_PROVENANCE_MISSING" | "TN_PLAYTEST_CAPABILITY_MISSING" | "TN_PLAYTEST_DEVICE_FAILED" | "TN_PLAYTEST_HOST_EXITED" | "TN_PLAYTEST_MAILBOX_POLL_STALLED" | "TN_PLAYTEST_OBSERVATION_UNAVAILABLE" | "TN_PLAYTEST_OPERATION_TIMEOUT" | "TN_PLAYTEST_PAGE_CLOSED" | "TN_PLAYTEST_PAGE_CRASHED" | "TN_PLAYTEST_PAGE_NAVIGATED" | "TN_PLAYTEST_PAYLOAD_TOO_LARGE" | "TN_PLAYTEST_SERVER_FAILED" | "TN_PLAYTEST_SETUP_UNAPPLIED" | "TN_PLAYTEST_START_TICK_INVALID" | "TN_PLAYTEST_STARTUP_ABORTED" | "TN_PLAYTEST_STARTUP_HOST_EXITED" | "TN_PLAYTEST_STARTUP_NOT_READY" | "TN_PLAYTEST_UNSUPPORTED_ON_TARGET";
|
|
785
|
+
interface IPlaytestProtocolDiagnostic {
|
|
786
|
+
capability?: string;
|
|
787
|
+
code: PlaytestDiagnosticCode;
|
|
788
|
+
fix: {
|
|
789
|
+
instruction: string;
|
|
790
|
+
nextCommand?: string;
|
|
791
|
+
};
|
|
792
|
+
message: string;
|
|
793
|
+
path?: string;
|
|
794
|
+
severity: "error";
|
|
795
|
+
}
|
|
796
|
+
declare function playtestDiagnostic(code: PlaytestDiagnosticCode, message: string, instruction: string, details?: Pick<IPlaytestProtocolDiagnostic, "capability" | "path"> & {
|
|
797
|
+
nextCommand?: string;
|
|
798
|
+
}): IPlaytestProtocolDiagnostic;
|
|
799
|
+
|
|
800
|
+
export { viewportPresentationCommands as $, resolveDiagnosticsPolicy as A, summarizeDeviceMetrics as B, type IAndroidAppState as C, DEVICE_METRICS_CADENCE_MS as D, type IAndroidPointer as E, type IAndroidPointerInjection as F, type IAndroidDriver as G, HOT_START_TEMPERATURE_C as H, type IPlaytestReport as I, AdbAndroidDriver as J, type IAndroidDriverOptions as K, type IAndroidLifecycleOperation as L, type IAndroidTouchViewport as M, type IPlaytestDeviceLifecycleObservation as N, type IPlaytestDeviceLifecyclePhase as O, type PlaytestDeviceMeasurement as P, type IPlaytestDeviceLifecyclePhysics as Q, type IPlaytestDeviceLifecycleSteps as R, androidTouchBatches as S, discoverAdb as T, keyboardIsShown as U, parseAndroidConsole as V, parseAndroidTouchViewport as W, rotatedTouchPosition as X, tapCommand as Y, touchPositionForViewport as Z, touchRotationFromWindowDump as _, type IPlaytestAssertionResult as a, viewportPresentationObserved as a0, viewportRestoreCommands as a1, type IPlaytestDiagnostic as b, DEVICE_METRICS_MAX_SAMPLES as c, DeviceMetricsError as d, DeviceMetricsRecorder as e, type IPlaytestCaptureProvenance as f, type IPlaytestDeviceBattery as g, type IPlaytestDeviceMetricsObservation as h, type IPlaytestDeviceMetricsSample as i, type IPlaytestDeviceMetricsVerdict as j, type IPlaytestDeviceThermal as k, type IPlaytestDiagnosticsPolicy as l, type IPlaytestFramebufferCoverageObservation as m, type IPlaytestObservations as n, type IPlaytestProtocolDiagnostic as o, type IPlaytestSetupApplication as p, type IPlaytestSetupRecord as q, type IPlaytestTrivialityOptOut as r, type IPlaytestVisualElementRegionObservation as s, type PlaytestDevicePowerRails as t, type PlaytestVec3 as u, parseDeviceBattery as v, parseDeviceCurrent as w, parseDevicePowerRails as x, parseDeviceThermal as y, playtestDiagnostic as z };
|