@delacour/warden-e2e 0.11.0 → 0.12.1
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/{chunk-ggcjzrvh.mjs → chunk-rbbn127e.mjs} +365 -216
- package/index.mjs +5 -2
- package/package.json +2 -2
- package/preload.mjs +570 -419
- package/types/e2e/src/devtools/native-log-tail.d.ts +13 -0
- package/types/e2e/src/devtools/native-log.d.ts +14 -1
- package/types/e2e/src/runner/failure.d.ts +2 -0
- package/types/e2e/src/session.d.ts +1 -1
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/** Console tail of a native log: the last few lines worth reading next to a failure. */
|
|
2
|
+
export declare const TAIL_LINES = 20;
|
|
3
|
+
/** `ndjson` of `log show` → up to {@link TAIL_LINES} readable lines; unresolved messages are never shown. */
|
|
4
|
+
export declare function iosTail(ndjson: string): string[];
|
|
5
|
+
/** How many of a `log show` ndjson's messages could not be composed (`<compose failure …>`). */
|
|
6
|
+
export declare function unresolvedShare(ndjson: string): {
|
|
7
|
+
unresolved: number;
|
|
8
|
+
total: number;
|
|
9
|
+
};
|
|
10
|
+
/** `logcat -v epoch` text → up to {@link TAIL_LINES} lines, E/F/W first. */
|
|
11
|
+
export declare function androidTail(logcat: string): string[];
|
|
12
|
+
/** Console block for a failed attempt: a header, then each line indented. Empty for no lines. */
|
|
13
|
+
export declare function formatNativeTail(lines: readonly string[]): string[];
|
|
@@ -39,12 +39,25 @@ export type NativeLogWindow = {
|
|
|
39
39
|
export type NativeCapture = {
|
|
40
40
|
files: string[];
|
|
41
41
|
problems: string[];
|
|
42
|
+
/** the last readable lines (errors first, at most 20) to print next to the failure */
|
|
43
|
+
tail: string[];
|
|
42
44
|
};
|
|
45
|
+
/** `log config` flag name for the opt-out of private data on the simulator. */
|
|
46
|
+
export declare const NATIVE_PRIVATE_DATA_ENV = "WARDEN_NATIVE_LOG_PRIVATE";
|
|
47
|
+
/**
|
|
48
|
+
* Makes sure the simulator's own logd keeps `%{private}` values readable (`log config --mode private_data:on`)
|
|
49
|
+
* so `native.log` shows them instead of `<private>`. It must be set before the app logs: what logd redacts when
|
|
50
|
+
* it writes cannot be recovered when it is read. Skipped when `log config --status` already lists `PRIVATE_DATA`
|
|
51
|
+
* (the case on the iOS 27.0 simulator, which refuses the change with "Simulator unable to set system mode").
|
|
52
|
+
* The sim is a leased, disposable test device. Resolves with a problem string, never throws.
|
|
53
|
+
*/
|
|
54
|
+
export declare function enableNativePrivateData(udid: string, exec: Exec, timeoutMs?: number): Promise<string | undefined>;
|
|
43
55
|
export declare function realNativeFs(): NativeFs;
|
|
44
56
|
export declare function realNativeLogDeps(exec: Exec, adb: string): NativeLogDeps;
|
|
45
57
|
/**
|
|
46
58
|
* `native.log` (and iOS `.ips` crash reports) for a failed attempt, read after the fact: iOS
|
|
47
|
-
* `simctl spawn log show`
|
|
59
|
+
* `simctl spawn log show` (inside the simulator, so format strings resolve against the runtime's own shared cache)
|
|
60
|
+
* for the app's process over the attempt's window, Android `logcat -d` for its pid
|
|
48
61
|
* plus the crash buffer. Reading afterwards needs no stream to start, stop or leak. Never throws.
|
|
49
62
|
*/
|
|
50
63
|
export declare function captureNativeLog(target: NativeTarget, deps: NativeLogDeps, win: NativeLogWindow): Promise<NativeCapture>;
|
|
@@ -13,6 +13,8 @@ export type CaptureBudget = () => number;
|
|
|
13
13
|
export type FailureCapture = {
|
|
14
14
|
/** files written into `dir`, relative to it */
|
|
15
15
|
files: string[];
|
|
16
|
+
/** readable lines to print next to the failure (native log tail); absent for captures that have none */
|
|
17
|
+
tail?: string[];
|
|
16
18
|
/** what could not be captured, for the trace */
|
|
17
19
|
problems: string[];
|
|
18
20
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type DevtoolsFacet, type DevtoolsResult } from "./devtools/devtools.types";
|
|
2
|
-
import type
|
|
2
|
+
import { type NativeLogDeps } from "./devtools/native-log";
|
|
3
3
|
import type { Driver, DriverResult } from "./driver/driver.types";
|
|
4
4
|
import { type HidRecoveryDeps } from "./driver/ios/hid-recovery";
|
|
5
5
|
import { type E2eEnv } from "./env";
|