@astur-mobile/core 0.5.0-beta.3 → 0.5.0-beta.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/dist/flutter/network.d.ts +34 -0
- package/dist/flutter/network.d.ts.map +1 -0
- package/dist/flutter/network.js +121 -0
- package/dist/flutter/network.js.map +1 -0
- package/dist/flutter/vmService.d.ts +170 -0
- package/dist/flutter/vmService.d.ts.map +1 -0
- package/dist/flutter/vmService.js +630 -0
- package/dist/flutter/vmService.js.map +1 -0
- package/dist/image.d.ts +42 -0
- package/dist/image.d.ts.map +1 -0
- package/dist/image.js +87 -0
- package/dist/image.js.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/dist/keyboard.d.ts +11 -0
- package/dist/keyboard.d.ts.map +1 -1
- package/dist/keyboard.js +13 -0
- package/dist/keyboard.js.map +1 -1
- package/dist/locator.d.ts +39 -0
- package/dist/locator.d.ts.map +1 -1
- package/dist/locator.js +77 -0
- package/dist/locator.js.map +1 -1
- package/dist/reactNative/network.d.ts +140 -0
- package/dist/reactNative/network.d.ts.map +1 -0
- package/dist/reactNative/network.js +382 -0
- package/dist/reactNative/network.js.map +1 -0
- package/dist/session.d.ts +41 -1
- package/dist/session.d.ts.map +1 -1
- package/dist/session.js +48 -3
- package/dist/session.js.map +1 -1
- package/package.json +6 -2
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import type { NetworkCapabilities, NetworkRedactionOptions, NetworkRequestRecord } from '@astur-mobile/protocol';
|
|
2
|
+
/**
|
|
3
|
+
* Network observation for React Native, backed by the CDP `Network` domain that
|
|
4
|
+
* RN's own DevTools ("Fusebox") uses. The reporter lives in `ReactCommon` — the
|
|
5
|
+
* shared C++ layer — so one client covers Android and iOS identically.
|
|
6
|
+
*
|
|
7
|
+
* Astur is a plain CDP client here. It does not stand in for Metro: the app
|
|
8
|
+
* dials out to the dev server, the dev server proxies debugger sessions, and
|
|
9
|
+
* Astur connects to that proxy the same way React Native DevTools does.
|
|
10
|
+
*
|
|
11
|
+
* ## What is covered
|
|
12
|
+
*
|
|
13
|
+
* Whatever goes through RN's `XMLHttpRequest` — which is RN's own `fetch`
|
|
14
|
+
* polyfill, `axios`, and most HTTP libraries in the ecosystem, because they all
|
|
15
|
+
* bottom out there. Clients that bypass it are invisible, and the important
|
|
16
|
+
* case in practice is **Expo's native `fetch`** (`expo/fetch`, installed as the
|
|
17
|
+
* global `fetch` from SDK 52): it is implemented in native code and never
|
|
18
|
+
* touches RN's networking module, so it emits no CDP events at all. This was
|
|
19
|
+
* measured, not assumed — see `coverage` on {@link REACT_NATIVE_NETWORK_CAPABILITIES}.
|
|
20
|
+
*
|
|
21
|
+
* ## Why a dev build is required
|
|
22
|
+
*
|
|
23
|
+
* The reporter is behind a compile-time `REACT_NATIVE_DEBUGGER_ENABLED` flag; in
|
|
24
|
+
* a release build the code is not present and `isDebuggingEnabled()` returns
|
|
25
|
+
* false. There is nothing to attach to, exactly as with Flutter's release AOT
|
|
26
|
+
* builds. This cannot be worked around from outside the app.
|
|
27
|
+
*/
|
|
28
|
+
/** Metro's default port, and the default the app itself dials out to. */
|
|
29
|
+
export declare const DEFAULT_METRO_URL = "http://127.0.0.1:8081";
|
|
30
|
+
export declare const REACT_NATIVE_NETWORK_CAPABILITIES: NetworkCapabilities;
|
|
31
|
+
interface InspectorTarget {
|
|
32
|
+
webSocketDebuggerUrl?: string;
|
|
33
|
+
appId?: string;
|
|
34
|
+
title?: string;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Lists debuggable targets on a Metro dev server, newest last.
|
|
38
|
+
*
|
|
39
|
+
* Returns `[]` rather than throwing when the server is absent — "no dev server"
|
|
40
|
+
* is the normal case for a release build and must read as unsupported, not as
|
|
41
|
+
* a failure.
|
|
42
|
+
*/
|
|
43
|
+
export declare function listInspectorTargets(devServerUrl: string, timeoutMs?: number): Promise<InspectorTarget[]>;
|
|
44
|
+
/**
|
|
45
|
+
* Picks the target belonging to `appId`. Metro keys targets by application id,
|
|
46
|
+
* which is the package name on Android and the bundle id on iOS — the same
|
|
47
|
+
* value Astur already knows as the app under test.
|
|
48
|
+
*
|
|
49
|
+
* When `appId` is known the match is required, never best-effort. A dev server
|
|
50
|
+
* left running for a different project would otherwise hand a native or Flutter
|
|
51
|
+
* session someone else's app, and it would report that app's traffic as its
|
|
52
|
+
* own — a wrong answer is worse here than "unsupported". Only a session that
|
|
53
|
+
* cannot name its app falls back to the newest target.
|
|
54
|
+
*/
|
|
55
|
+
export declare function selectInspectorTarget(targets: InspectorTarget[], appId?: string): InspectorTarget | undefined;
|
|
56
|
+
/**
|
|
57
|
+
* A CDP client that keeps a live `Network` subscription against a React Native
|
|
58
|
+
* app and buffers what it sees.
|
|
59
|
+
*
|
|
60
|
+
* Reconnects on its own. Every JS reload replaces the inspector page and closes
|
|
61
|
+
* the debugger socket with `CONNECTION_LOST`; a test that relaunches the app
|
|
62
|
+
* between specs would otherwise observe traffic once and silently nothing after
|
|
63
|
+
* — the same failure mode the Flutter backend hit with per-isolate state.
|
|
64
|
+
*/
|
|
65
|
+
export declare class ReactNativeNetworkObserver {
|
|
66
|
+
private readonly devServerUrl;
|
|
67
|
+
private readonly appId?;
|
|
68
|
+
private socket?;
|
|
69
|
+
private nextId;
|
|
70
|
+
private readonly pending;
|
|
71
|
+
private readonly exchanges;
|
|
72
|
+
private closed;
|
|
73
|
+
private reconnectTimer?;
|
|
74
|
+
/**
|
|
75
|
+
* Whether a debuggable target was ever found.
|
|
76
|
+
*
|
|
77
|
+
* Reconnecting is only correct for a session that had one: a release build
|
|
78
|
+
* has none and never will, and retrying there would poll the dev server
|
|
79
|
+
* forever for a session that can never observe anything.
|
|
80
|
+
*/
|
|
81
|
+
private everAttached;
|
|
82
|
+
constructor(devServerUrl: string, appId?: string | undefined);
|
|
83
|
+
/**
|
|
84
|
+
* Connects and subscribes. Resolves `false` when there is no debuggable
|
|
85
|
+
* target — a release build, or Metro not running — so the caller can report
|
|
86
|
+
* `observe: false` with a reason instead of throwing.
|
|
87
|
+
*/
|
|
88
|
+
attach(): Promise<boolean>;
|
|
89
|
+
private open;
|
|
90
|
+
/**
|
|
91
|
+
* Waits until the subscription is live again, up to `timeoutMs`.
|
|
92
|
+
*
|
|
93
|
+
* Relaunching the app tears the inspector page down and stands a new one up,
|
|
94
|
+
* and in between the dev server lists no target at all. A fire-and-forget
|
|
95
|
+
* reconnect loses that race and then observes nothing for the rest of the
|
|
96
|
+
* test, so callers that can afford to wait — `clear()` and the capabilities
|
|
97
|
+
* probe — wait, and thereby guarantee that traffic caused after they return
|
|
98
|
+
* is seen.
|
|
99
|
+
*
|
|
100
|
+
* The default budget is generous because a debug build fetches its bundle
|
|
101
|
+
* from Metro on every cold start and can take tens of seconds to register its
|
|
102
|
+
* inspector page. A short window silently expires before the app is back.
|
|
103
|
+
*/
|
|
104
|
+
ensureLive(timeoutMs?: number): Promise<boolean>;
|
|
105
|
+
private ensureAttached;
|
|
106
|
+
/**
|
|
107
|
+
* Re-attaches after a reload. Buffered records are deliberately kept: they
|
|
108
|
+
* describe traffic the test already caused, and dropping them would make
|
|
109
|
+
* observation depend on whether the app happened to reload mid-test.
|
|
110
|
+
*/
|
|
111
|
+
/**
|
|
112
|
+
* Keeps trying to re-attach until it succeeds or the session ends.
|
|
113
|
+
*
|
|
114
|
+
* Deliberately unbounded rather than a single retry with a deadline. A debug
|
|
115
|
+
* build reloads its bundle from Metro on every relaunch and can be gone for
|
|
116
|
+
* tens of seconds; a bounded window expires first, and the observer then sits
|
|
117
|
+
* detached for the rest of the run while every later read returns nothing.
|
|
118
|
+
* One localhost request per second while detached is the cheaper mistake.
|
|
119
|
+
*/
|
|
120
|
+
private scheduleReconnect;
|
|
121
|
+
private send;
|
|
122
|
+
private request;
|
|
123
|
+
private onMessage;
|
|
124
|
+
private consume;
|
|
125
|
+
private captureBody;
|
|
126
|
+
/** Everything observed so far, oldest first, redacted per `options`. */
|
|
127
|
+
records(options?: NetworkRedactionOptions): NetworkRequestRecord[];
|
|
128
|
+
/**
|
|
129
|
+
* Drops the buffer and re-enables the domain.
|
|
130
|
+
*
|
|
131
|
+
* Re-enabling matters for the same reason it does on Flutter: a reload
|
|
132
|
+
* replaces the runtime and takes the subscription with it. Enabling here —
|
|
133
|
+
* which the fixture calls between tests — is what keeps observation working
|
|
134
|
+
* past the first spec.
|
|
135
|
+
*/
|
|
136
|
+
clear(): Promise<void>;
|
|
137
|
+
dispose(): void;
|
|
138
|
+
}
|
|
139
|
+
export {};
|
|
140
|
+
//# sourceMappingURL=network.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"network.d.ts","sourceRoot":"","sources":["../../src/reactNative/network.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,mBAAmB,EACnB,uBAAuB,EACvB,oBAAoB,EACrB,MAAM,wBAAwB,CAAC;AAIhC;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,yEAAyE;AACzE,eAAO,MAAM,iBAAiB,0BAA0B,CAAC;AAEzD,eAAO,MAAM,iCAAiC,EAAE,mBAS/C,CAAC;AAEF,UAAU,eAAe;IACvB,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAyBD;;;;;;GAMG;AACH,wBAAsB,oBAAoB,CACxC,YAAY,EAAE,MAAM,EACpB,SAAS,SAAQ,GAChB,OAAO,CAAC,eAAe,EAAE,CAAC,CAa5B;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,eAAe,EAAE,EAC1B,KAAK,CAAC,EAAE,MAAM,GACb,eAAe,GAAG,SAAS,CAS7B;AAED;;;;;;;;GAQG;AACH,qBAAa,0BAA0B;IAiBnC,OAAO,CAAC,QAAQ,CAAC,YAAY;IAC7B,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC;IAjBzB,OAAO,CAAC,MAAM,CAAC,CAAY;IAC3B,OAAO,CAAC,MAAM,CAAK;IACnB,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAoD;IAC5E,OAAO,CAAC,QAAQ,CAAC,SAAS,CAA+B;IACzD,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,cAAc,CAAC,CAAgC;IACvD;;;;;;OAMG;IACH,OAAO,CAAC,YAAY,CAAS;gBAGV,YAAY,EAAE,MAAM,EACpB,KAAK,CAAC,EAAE,MAAM,YAAA;IAGjC;;;;OAIG;IACG,MAAM,IAAI,OAAO,CAAC,OAAO,CAAC;YAQlB,IAAI;IAsClB;;;;;;;;;;;;;OAaG;IACG,UAAU,CAAC,SAAS,SAAS,GAAG,OAAO,CAAC,OAAO,CAAC;YAIxC,cAAc;IAqB5B;;;;OAIG;IACH;;;;;;;;OAQG;IACH,OAAO,CAAC,iBAAiB;IAoBzB,OAAO,CAAC,IAAI;IAWZ,OAAO,CAAC,OAAO;IASf,OAAO,CAAC,SAAS;IAmBjB,OAAO,CAAC,OAAO;YAuDD,WAAW;IAWzB,wEAAwE;IACxE,OAAO,CAAC,OAAO,CAAC,EAAE,uBAAuB,GAAG,oBAAoB,EAAE;IA4BlE;;;;;;;OAOG;IACG,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAO5B,OAAO,IAAI,IAAI;CAchB"}
|
|
@@ -0,0 +1,382 @@
|
|
|
1
|
+
import { applyBodyLimit, redactHeaders, resolveRedactionOptions } from '../flutter/network.js';
|
|
2
|
+
/**
|
|
3
|
+
* Network observation for React Native, backed by the CDP `Network` domain that
|
|
4
|
+
* RN's own DevTools ("Fusebox") uses. The reporter lives in `ReactCommon` — the
|
|
5
|
+
* shared C++ layer — so one client covers Android and iOS identically.
|
|
6
|
+
*
|
|
7
|
+
* Astur is a plain CDP client here. It does not stand in for Metro: the app
|
|
8
|
+
* dials out to the dev server, the dev server proxies debugger sessions, and
|
|
9
|
+
* Astur connects to that proxy the same way React Native DevTools does.
|
|
10
|
+
*
|
|
11
|
+
* ## What is covered
|
|
12
|
+
*
|
|
13
|
+
* Whatever goes through RN's `XMLHttpRequest` — which is RN's own `fetch`
|
|
14
|
+
* polyfill, `axios`, and most HTTP libraries in the ecosystem, because they all
|
|
15
|
+
* bottom out there. Clients that bypass it are invisible, and the important
|
|
16
|
+
* case in practice is **Expo's native `fetch`** (`expo/fetch`, installed as the
|
|
17
|
+
* global `fetch` from SDK 52): it is implemented in native code and never
|
|
18
|
+
* touches RN's networking module, so it emits no CDP events at all. This was
|
|
19
|
+
* measured, not assumed — see `coverage` on {@link REACT_NATIVE_NETWORK_CAPABILITIES}.
|
|
20
|
+
*
|
|
21
|
+
* ## Why a dev build is required
|
|
22
|
+
*
|
|
23
|
+
* The reporter is behind a compile-time `REACT_NATIVE_DEBUGGER_ENABLED` flag; in
|
|
24
|
+
* a release build the code is not present and `isDebuggingEnabled()` returns
|
|
25
|
+
* false. There is nothing to attach to, exactly as with Flutter's release AOT
|
|
26
|
+
* builds. This cannot be worked around from outside the app.
|
|
27
|
+
*/
|
|
28
|
+
/** Metro's default port, and the default the app itself dials out to. */
|
|
29
|
+
export const DEFAULT_METRO_URL = 'http://127.0.0.1:8081';
|
|
30
|
+
export const REACT_NATIVE_NETWORK_CAPABILITIES = {
|
|
31
|
+
observe: true,
|
|
32
|
+
intercept: false,
|
|
33
|
+
transports: ['http'],
|
|
34
|
+
responseBodies: true,
|
|
35
|
+
coverage: "React Native XMLHttpRequest traffic (RN's fetch polyfill and axios included) via the CDP Network domain; "
|
|
36
|
+
+ "excludes Expo's native fetch, WebView, and native SDK requests, and needs a debug build attached to Metro",
|
|
37
|
+
adapterRequired: true
|
|
38
|
+
};
|
|
39
|
+
/**
|
|
40
|
+
* Lists debuggable targets on a Metro dev server, newest last.
|
|
41
|
+
*
|
|
42
|
+
* Returns `[]` rather than throwing when the server is absent — "no dev server"
|
|
43
|
+
* is the normal case for a release build and must read as unsupported, not as
|
|
44
|
+
* a failure.
|
|
45
|
+
*/
|
|
46
|
+
export async function listInspectorTargets(devServerUrl, timeoutMs = 2_000) {
|
|
47
|
+
try {
|
|
48
|
+
const response = await fetch(new URL('/json/list', devServerUrl), {
|
|
49
|
+
signal: AbortSignal.timeout(timeoutMs)
|
|
50
|
+
});
|
|
51
|
+
if (!response.ok) {
|
|
52
|
+
return [];
|
|
53
|
+
}
|
|
54
|
+
const targets = await response.json();
|
|
55
|
+
return Array.isArray(targets) ? targets : [];
|
|
56
|
+
}
|
|
57
|
+
catch {
|
|
58
|
+
return [];
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Picks the target belonging to `appId`. Metro keys targets by application id,
|
|
63
|
+
* which is the package name on Android and the bundle id on iOS — the same
|
|
64
|
+
* value Astur already knows as the app under test.
|
|
65
|
+
*
|
|
66
|
+
* When `appId` is known the match is required, never best-effort. A dev server
|
|
67
|
+
* left running for a different project would otherwise hand a native or Flutter
|
|
68
|
+
* session someone else's app, and it would report that app's traffic as its
|
|
69
|
+
* own — a wrong answer is worse here than "unsupported". Only a session that
|
|
70
|
+
* cannot name its app falls back to the newest target.
|
|
71
|
+
*/
|
|
72
|
+
export function selectInspectorTarget(targets, appId) {
|
|
73
|
+
const connectable = targets.filter((target) => Boolean(target.webSocketDebuggerUrl));
|
|
74
|
+
if (connectable.length === 0) {
|
|
75
|
+
return undefined;
|
|
76
|
+
}
|
|
77
|
+
if (appId) {
|
|
78
|
+
return connectable.filter((target) => target.appId === appId).at(-1);
|
|
79
|
+
}
|
|
80
|
+
return connectable.at(-1);
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* A CDP client that keeps a live `Network` subscription against a React Native
|
|
84
|
+
* app and buffers what it sees.
|
|
85
|
+
*
|
|
86
|
+
* Reconnects on its own. Every JS reload replaces the inspector page and closes
|
|
87
|
+
* the debugger socket with `CONNECTION_LOST`; a test that relaunches the app
|
|
88
|
+
* between specs would otherwise observe traffic once and silently nothing after
|
|
89
|
+
* — the same failure mode the Flutter backend hit with per-isolate state.
|
|
90
|
+
*/
|
|
91
|
+
export class ReactNativeNetworkObserver {
|
|
92
|
+
devServerUrl;
|
|
93
|
+
appId;
|
|
94
|
+
socket;
|
|
95
|
+
nextId = 1;
|
|
96
|
+
pending = new Map();
|
|
97
|
+
exchanges = new Map();
|
|
98
|
+
closed = false;
|
|
99
|
+
reconnectTimer;
|
|
100
|
+
/**
|
|
101
|
+
* Whether a debuggable target was ever found.
|
|
102
|
+
*
|
|
103
|
+
* Reconnecting is only correct for a session that had one: a release build
|
|
104
|
+
* has none and never will, and retrying there would poll the dev server
|
|
105
|
+
* forever for a session that can never observe anything.
|
|
106
|
+
*/
|
|
107
|
+
everAttached = false;
|
|
108
|
+
constructor(devServerUrl, appId) {
|
|
109
|
+
this.devServerUrl = devServerUrl;
|
|
110
|
+
this.appId = appId;
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Connects and subscribes. Resolves `false` when there is no debuggable
|
|
114
|
+
* target — a release build, or Metro not running — so the caller can report
|
|
115
|
+
* `observe: false` with a reason instead of throwing.
|
|
116
|
+
*/
|
|
117
|
+
async attach() {
|
|
118
|
+
const target = selectInspectorTarget(await listInspectorTargets(this.devServerUrl), this.appId);
|
|
119
|
+
if (!target?.webSocketDebuggerUrl) {
|
|
120
|
+
return false;
|
|
121
|
+
}
|
|
122
|
+
return this.open(target.webSocketDebuggerUrl);
|
|
123
|
+
}
|
|
124
|
+
async open(url) {
|
|
125
|
+
const connected = await new Promise((resolve) => {
|
|
126
|
+
let socket;
|
|
127
|
+
try {
|
|
128
|
+
// The Origin header is mandatory and must equal the dev server's own
|
|
129
|
+
// base URL. React Native's proxy rejects a missing Origin with 401, and
|
|
130
|
+
// Expo's dev server terminates any socket whose Origin host differs
|
|
131
|
+
// from its own — so "no header" and "close enough" both fail, in two
|
|
132
|
+
// different ways, several layers apart.
|
|
133
|
+
socket = new WebSocket(url, {
|
|
134
|
+
headers: { Origin: new URL(this.devServerUrl).origin }
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
catch {
|
|
138
|
+
resolve(false);
|
|
139
|
+
return;
|
|
140
|
+
}
|
|
141
|
+
const settle = (value) => { resolve(value); };
|
|
142
|
+
socket.addEventListener('open', () => settle(true), { once: true });
|
|
143
|
+
socket.addEventListener('error', () => settle(false), { once: true });
|
|
144
|
+
socket.addEventListener('message', (event) => this.onMessage(event));
|
|
145
|
+
socket.addEventListener('close', () => {
|
|
146
|
+
if (this.socket === socket) {
|
|
147
|
+
this.socket = undefined;
|
|
148
|
+
this.scheduleReconnect();
|
|
149
|
+
}
|
|
150
|
+
settle(false);
|
|
151
|
+
});
|
|
152
|
+
this.socket = socket;
|
|
153
|
+
});
|
|
154
|
+
if (connected) {
|
|
155
|
+
this.everAttached = true;
|
|
156
|
+
this.send('Network.enable');
|
|
157
|
+
}
|
|
158
|
+
return connected;
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* Waits until the subscription is live again, up to `timeoutMs`.
|
|
162
|
+
*
|
|
163
|
+
* Relaunching the app tears the inspector page down and stands a new one up,
|
|
164
|
+
* and in between the dev server lists no target at all. A fire-and-forget
|
|
165
|
+
* reconnect loses that race and then observes nothing for the rest of the
|
|
166
|
+
* test, so callers that can afford to wait — `clear()` and the capabilities
|
|
167
|
+
* probe — wait, and thereby guarantee that traffic caused after they return
|
|
168
|
+
* is seen.
|
|
169
|
+
*
|
|
170
|
+
* The default budget is generous because a debug build fetches its bundle
|
|
171
|
+
* from Metro on every cold start and can take tens of seconds to register its
|
|
172
|
+
* inspector page. A short window silently expires before the app is back.
|
|
173
|
+
*/
|
|
174
|
+
async ensureLive(timeoutMs = 45_000) {
|
|
175
|
+
return this.ensureAttached(timeoutMs);
|
|
176
|
+
}
|
|
177
|
+
async ensureAttached(timeoutMs = 45_000) {
|
|
178
|
+
if (this.socket?.readyState === 1) {
|
|
179
|
+
return true;
|
|
180
|
+
}
|
|
181
|
+
if (this.closed || !this.everAttached) {
|
|
182
|
+
return false;
|
|
183
|
+
}
|
|
184
|
+
const deadline = Date.now() + timeoutMs;
|
|
185
|
+
while (Date.now() < deadline && !this.closed) {
|
|
186
|
+
if (await this.attach().catch(() => false)) {
|
|
187
|
+
return true;
|
|
188
|
+
}
|
|
189
|
+
await new Promise((resolve) => {
|
|
190
|
+
const timer = setTimeout(resolve, 250);
|
|
191
|
+
timer.unref?.();
|
|
192
|
+
});
|
|
193
|
+
}
|
|
194
|
+
return false;
|
|
195
|
+
}
|
|
196
|
+
/**
|
|
197
|
+
* Re-attaches after a reload. Buffered records are deliberately kept: they
|
|
198
|
+
* describe traffic the test already caused, and dropping them would make
|
|
199
|
+
* observation depend on whether the app happened to reload mid-test.
|
|
200
|
+
*/
|
|
201
|
+
/**
|
|
202
|
+
* Keeps trying to re-attach until it succeeds or the session ends.
|
|
203
|
+
*
|
|
204
|
+
* Deliberately unbounded rather than a single retry with a deadline. A debug
|
|
205
|
+
* build reloads its bundle from Metro on every relaunch and can be gone for
|
|
206
|
+
* tens of seconds; a bounded window expires first, and the observer then sits
|
|
207
|
+
* detached for the rest of the run while every later read returns nothing.
|
|
208
|
+
* One localhost request per second while detached is the cheaper mistake.
|
|
209
|
+
*/
|
|
210
|
+
scheduleReconnect() {
|
|
211
|
+
if (this.closed || this.reconnectTimer || !this.everAttached) {
|
|
212
|
+
return;
|
|
213
|
+
}
|
|
214
|
+
this.reconnectTimer = setTimeout(() => {
|
|
215
|
+
this.reconnectTimer = undefined;
|
|
216
|
+
if (this.closed || this.socket) {
|
|
217
|
+
return;
|
|
218
|
+
}
|
|
219
|
+
void this.attach()
|
|
220
|
+
.catch(() => false)
|
|
221
|
+
.then((attached) => {
|
|
222
|
+
if (!attached) {
|
|
223
|
+
this.scheduleReconnect();
|
|
224
|
+
}
|
|
225
|
+
});
|
|
226
|
+
}, 1_000);
|
|
227
|
+
this.reconnectTimer.unref?.();
|
|
228
|
+
}
|
|
229
|
+
send(method, params = {}) {
|
|
230
|
+
const id = this.nextId++;
|
|
231
|
+
try {
|
|
232
|
+
this.socket?.send(JSON.stringify({ id, method, params }));
|
|
233
|
+
}
|
|
234
|
+
catch {
|
|
235
|
+
// A send on a socket that just closed is not an error worth surfacing —
|
|
236
|
+
// the reconnect path will re-enable the domain.
|
|
237
|
+
}
|
|
238
|
+
return id;
|
|
239
|
+
}
|
|
240
|
+
request(method, params = {}) {
|
|
241
|
+
return new Promise((resolve) => {
|
|
242
|
+
const id = this.send(method, params);
|
|
243
|
+
const timer = setTimeout(() => { this.pending.delete(id); resolve({}); }, 5_000);
|
|
244
|
+
timer.unref?.();
|
|
245
|
+
this.pending.set(id, (message) => { clearTimeout(timer); resolve(message); });
|
|
246
|
+
});
|
|
247
|
+
}
|
|
248
|
+
onMessage(event) {
|
|
249
|
+
let message;
|
|
250
|
+
try {
|
|
251
|
+
message = JSON.parse(String(event.data));
|
|
252
|
+
}
|
|
253
|
+
catch {
|
|
254
|
+
return;
|
|
255
|
+
}
|
|
256
|
+
if (message.id !== undefined) {
|
|
257
|
+
this.pending.get(message.id)?.(message);
|
|
258
|
+
this.pending.delete(message.id);
|
|
259
|
+
return;
|
|
260
|
+
}
|
|
261
|
+
if (!message.method?.startsWith('Network.')) {
|
|
262
|
+
return;
|
|
263
|
+
}
|
|
264
|
+
this.consume(message.method, message.params ?? {});
|
|
265
|
+
}
|
|
266
|
+
consume(method, params) {
|
|
267
|
+
const id = typeof params.requestId === 'string' ? params.requestId : undefined;
|
|
268
|
+
if (!id) {
|
|
269
|
+
return;
|
|
270
|
+
}
|
|
271
|
+
if (method === 'Network.requestWillBeSent') {
|
|
272
|
+
const request = (params.request ?? {});
|
|
273
|
+
this.exchanges.set(id, {
|
|
274
|
+
id,
|
|
275
|
+
method: typeof request.method === 'string' ? request.method.toUpperCase() : 'GET',
|
|
276
|
+
url: typeof request.url === 'string' ? request.url : '',
|
|
277
|
+
requestHeaders: (request.headers ?? {})
|
|
278
|
+
});
|
|
279
|
+
return;
|
|
280
|
+
}
|
|
281
|
+
const exchange = this.exchanges.get(id);
|
|
282
|
+
if (!exchange) {
|
|
283
|
+
return;
|
|
284
|
+
}
|
|
285
|
+
if (method === 'Network.requestWillBeSentExtraInfo') {
|
|
286
|
+
// The only start time RN reports. `requestWillBeSent` carries no
|
|
287
|
+
// timestamp at all, so without this event a record has no `startedAt`.
|
|
288
|
+
const timing = (params.connectTiming ?? {});
|
|
289
|
+
const requestTime = Number(timing.requestTime);
|
|
290
|
+
if (Number.isFinite(requestTime)) {
|
|
291
|
+
exchange.startedAtSeconds = requestTime;
|
|
292
|
+
}
|
|
293
|
+
return;
|
|
294
|
+
}
|
|
295
|
+
if (method === 'Network.responseReceived') {
|
|
296
|
+
const response = (params.response ?? {});
|
|
297
|
+
exchange.status = Number(response.status);
|
|
298
|
+
exchange.responseHeaders = (response.headers ?? {});
|
|
299
|
+
return;
|
|
300
|
+
}
|
|
301
|
+
if (method === 'Network.loadingFinished') {
|
|
302
|
+
exchange.endedAtSeconds = Number(params.timestamp);
|
|
303
|
+
// Bodies must be pulled now, while the request is still retained. After a
|
|
304
|
+
// reload the requestId is gone and the body with it, so deferring this to
|
|
305
|
+
// read time would return nothing for exactly the traffic a test cares about.
|
|
306
|
+
void this.captureBody(exchange);
|
|
307
|
+
return;
|
|
308
|
+
}
|
|
309
|
+
if (method === 'Network.loadingFailed') {
|
|
310
|
+
exchange.endedAtSeconds = Number(params.timestamp);
|
|
311
|
+
exchange.error = typeof params.errorText === 'string' ? params.errorText : 'Request failed';
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
async captureBody(exchange) {
|
|
315
|
+
const message = await this.request('Network.getResponseBody', { requestId: exchange.id });
|
|
316
|
+
const body = message.result?.body;
|
|
317
|
+
if (typeof body !== 'string') {
|
|
318
|
+
return;
|
|
319
|
+
}
|
|
320
|
+
exchange.body = message.result?.base64Encoded === true
|
|
321
|
+
? Buffer.from(body, 'base64').toString('utf8')
|
|
322
|
+
: body;
|
|
323
|
+
}
|
|
324
|
+
/** Everything observed so far, oldest first, redacted per `options`. */
|
|
325
|
+
records(options) {
|
|
326
|
+
const resolved = resolveRedactionOptions(options);
|
|
327
|
+
return [...this.exchanges.values()].map((exchange) => ({
|
|
328
|
+
id: exchange.id,
|
|
329
|
+
transport: 'http',
|
|
330
|
+
method: exchange.method,
|
|
331
|
+
url: exchange.url,
|
|
332
|
+
requestHeaders: redactHeaders(exchange.requestHeaders, resolved.redactHeaders),
|
|
333
|
+
...(exchange.responseHeaders
|
|
334
|
+
? { responseHeaders: redactHeaders(exchange.responseHeaders, resolved.redactHeaders) }
|
|
335
|
+
: {}),
|
|
336
|
+
...(exchange.status === undefined || Number.isNaN(exchange.status)
|
|
337
|
+
? {}
|
|
338
|
+
: { status: exchange.status }),
|
|
339
|
+
// CDP reports epoch seconds as a float; the public contract is epoch ms.
|
|
340
|
+
startedAt: Math.round((exchange.startedAtSeconds ?? 0) * 1000),
|
|
341
|
+
...(exchange.startedAtSeconds !== undefined
|
|
342
|
+
&& exchange.endedAtSeconds !== undefined
|
|
343
|
+
&& exchange.endedAtSeconds >= exchange.startedAtSeconds
|
|
344
|
+
? { durationMs: Math.round((exchange.endedAtSeconds - exchange.startedAtSeconds) * 1000) }
|
|
345
|
+
: {}),
|
|
346
|
+
...(exchange.status === undefined
|
|
347
|
+
? {}
|
|
348
|
+
: applyBodyLimit(exchange.body, resolved.maxBodyBytes)),
|
|
349
|
+
...(exchange.error ? { error: exchange.error } : {})
|
|
350
|
+
}));
|
|
351
|
+
}
|
|
352
|
+
/**
|
|
353
|
+
* Drops the buffer and re-enables the domain.
|
|
354
|
+
*
|
|
355
|
+
* Re-enabling matters for the same reason it does on Flutter: a reload
|
|
356
|
+
* replaces the runtime and takes the subscription with it. Enabling here —
|
|
357
|
+
* which the fixture calls between tests — is what keeps observation working
|
|
358
|
+
* past the first spec.
|
|
359
|
+
*/
|
|
360
|
+
async clear() {
|
|
361
|
+
this.exchanges.clear();
|
|
362
|
+
if (await this.ensureAttached()) {
|
|
363
|
+
this.send('Network.enable');
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
dispose() {
|
|
367
|
+
this.closed = true;
|
|
368
|
+
if (this.reconnectTimer) {
|
|
369
|
+
clearTimeout(this.reconnectTimer);
|
|
370
|
+
this.reconnectTimer = undefined;
|
|
371
|
+
}
|
|
372
|
+
try {
|
|
373
|
+
this.socket?.close();
|
|
374
|
+
}
|
|
375
|
+
catch {
|
|
376
|
+
// Already gone; nothing to release.
|
|
377
|
+
}
|
|
378
|
+
this.socket = undefined;
|
|
379
|
+
this.exchanges.clear();
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
//# sourceMappingURL=network.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"network.js","sourceRoot":"","sources":["../../src/reactNative/network.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AAE/F;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,yEAAyE;AACzE,MAAM,CAAC,MAAM,iBAAiB,GAAG,uBAAuB,CAAC;AAEzD,MAAM,CAAC,MAAM,iCAAiC,GAAwB;IACpE,OAAO,EAAE,IAAI;IACb,SAAS,EAAE,KAAK;IAChB,UAAU,EAAE,CAAC,MAAM,CAAC;IACpB,cAAc,EAAE,IAAI;IACpB,QAAQ,EACN,2GAA2G;UACzG,2GAA2G;IAC/G,eAAe,EAAE,IAAI;CACtB,CAAC;AA+BF;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,oBAAoB,CACxC,YAAoB,EACpB,SAAS,GAAG,KAAK;IAEjB,IAAI,CAAC;QACH,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,IAAI,GAAG,CAAC,YAAY,EAAE,YAAY,CAAC,EAAE;YAChE,MAAM,EAAE,WAAW,CAAC,OAAO,CAAC,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C;QACxB,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,CAAC;IACzB,CAAC;CACF"}
|
package/dist/session.d.ts
CHANGED
|
@@ -2,6 +2,16 @@ import type { Coordinates, DeviceFileEntry, DeviceInfo, DeviceOrientation, Docto
|
|
|
2
2
|
import { type RuntimeInspectorSessionOptions } from './inspector.js';
|
|
3
3
|
import { MobileLocator } from './locator.js';
|
|
4
4
|
import { WebContext, type WebEvaluator } from './webBridge.js';
|
|
5
|
+
export interface AsturScreenshotOptions extends ScreenshotOptions {
|
|
6
|
+
/**
|
|
7
|
+
* Regions to paint over before the image is returned, for content that is
|
|
8
|
+
* legitimately different every run — a clock, a live counter, an avatar.
|
|
9
|
+
*
|
|
10
|
+
* A locator that matches nothing is skipped rather than throwing: masking an
|
|
11
|
+
* element that only appears sometimes is a normal reason to mask it.
|
|
12
|
+
*/
|
|
13
|
+
mask?: MobileLocator[];
|
|
14
|
+
}
|
|
5
15
|
export interface PlatformDriver {
|
|
6
16
|
readonly platform: PlatformName;
|
|
7
17
|
doctor(): Promise<DoctorCheck[]>;
|
|
@@ -60,6 +70,12 @@ export interface PlatformSession {
|
|
|
60
70
|
listFiles?(remotePath: string): Promise<DeviceFileEntry[]>;
|
|
61
71
|
getKeyboardState?(): Promise<KeyboardState>;
|
|
62
72
|
dismissKeyboard?(): Promise<void>;
|
|
73
|
+
/**
|
|
74
|
+
* Types into whatever currently holds keyboard focus, with no element to
|
|
75
|
+
* target. See {@link AsturDevice.keyboard.type} for when that is the only
|
|
76
|
+
* option.
|
|
77
|
+
*/
|
|
78
|
+
typeText?(text: string): Promise<void>;
|
|
63
79
|
/**
|
|
64
80
|
* What this session can see of the app's network traffic. A driver that
|
|
65
81
|
* cannot observe anything omits these entirely, and {@link AsturDevice.network}
|
|
@@ -149,6 +165,28 @@ export declare class AsturDevice {
|
|
|
149
165
|
isVisible: () => Promise<boolean>;
|
|
150
166
|
dismiss: () => Promise<void>;
|
|
151
167
|
hide: () => Promise<void>;
|
|
168
|
+
/**
|
|
169
|
+
* Types into whatever currently holds keyboard focus.
|
|
170
|
+
*
|
|
171
|
+
* Prefer `locator.fill()` — it resolves the field, clears it, and verifies
|
|
172
|
+
* the value landed. Reach for this only when there is no element to target:
|
|
173
|
+
* a custom control whose real input never reaches the accessibility tree.
|
|
174
|
+
* A multi-box OTP field is the usual case — the boxes are plain views and
|
|
175
|
+
* the `UITextField`/`TextInput` behind them is hidden, so `getByType` finds
|
|
176
|
+
* nothing to fill.
|
|
177
|
+
*
|
|
178
|
+
* Focus the control first (a tap on the box normally does it), then:
|
|
179
|
+
*
|
|
180
|
+
* ```ts
|
|
181
|
+
* await device.getByTestId('otp-input').tap();
|
|
182
|
+
* await device.keyboard.type('123456');
|
|
183
|
+
* ```
|
|
184
|
+
*
|
|
185
|
+
* Because it targets focus rather than an element, nothing verifies where
|
|
186
|
+
* the characters landed — that is the trade for reaching a control the tree
|
|
187
|
+
* cannot describe.
|
|
188
|
+
*/
|
|
189
|
+
type: (text: string) => Promise<void>;
|
|
152
190
|
show: (target?: MobileLocator | ElementSelector) => Promise<void>;
|
|
153
191
|
};
|
|
154
192
|
readonly files: {
|
|
@@ -198,7 +236,9 @@ export declare class AsturDevice {
|
|
|
198
236
|
isLocked(): Promise<boolean>;
|
|
199
237
|
swipe(gesture: SwipeGesture): Promise<void>;
|
|
200
238
|
drag(gesture: DragGesture): Promise<void>;
|
|
201
|
-
screenshot(options?:
|
|
239
|
+
screenshot(options?: AsturScreenshotOptions): Promise<Buffer>;
|
|
240
|
+
/** Identifies the device a baseline belongs to. See {@link screenshotKey}. */
|
|
241
|
+
screenshotKey(): Promise<string>;
|
|
202
242
|
startRecording(): Promise<void>;
|
|
203
243
|
stopRecording(options?: RecordingStopOptions): Promise<Buffer | undefined>;
|
|
204
244
|
tree(): Promise<MobileElementSnapshot>;
|
package/dist/session.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../src/session.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,WAAW,EACX,eAAe,EACf,UAAU,EACV,iBAAiB,EACjB,WAAW,EACX,WAAW,EACX,gBAAgB,EAChB,kBAAkB,EAClB,iBAAiB,EACjB,uBAAuB,EACvB,kBAAkB,EAClB,uBAAuB,EACvB,eAAe,EACf,iBAAiB,EACjB,kBAAkB,EAClB,aAAa,EACb,gBAAgB,EAChB,aAAa,EACb,iBAAiB,EACjB,mBAAmB,EACnB,uBAAuB,EACvB,oBAAoB,EACpB,oBAAoB,EACpB,qBAAqB,EACrB,UAAU,EACV,sBAAsB,EACtB,YAAY,EACZ,gBAAgB,EAChB,iBAAiB,EACjB,oBAAoB,EACpB,mBAAmB,EACnB,iBAAiB,EACjB,YAAY,EACZ,UAAU,EACV,sBAAsB,EACtB,YAAY,EACZ,WAAW,EACX,eAAe,EACf,YAAY,EACZ,MAAM,EACN,eAAe,EACf,eAAe,EAChB,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../src/session.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,WAAW,EACX,eAAe,EACf,UAAU,EACV,iBAAiB,EACjB,WAAW,EACX,WAAW,EACX,gBAAgB,EAChB,kBAAkB,EAClB,iBAAiB,EACjB,uBAAuB,EACvB,kBAAkB,EAClB,uBAAuB,EACvB,eAAe,EACf,iBAAiB,EACjB,kBAAkB,EAClB,aAAa,EACb,gBAAgB,EAChB,aAAa,EACb,iBAAiB,EACjB,mBAAmB,EACnB,uBAAuB,EACvB,oBAAoB,EACpB,oBAAoB,EACpB,qBAAqB,EACrB,UAAU,EACV,sBAAsB,EACtB,YAAY,EACZ,gBAAgB,EAChB,iBAAiB,EACjB,oBAAoB,EACpB,mBAAmB,EACnB,iBAAiB,EACjB,YAAY,EACZ,UAAU,EACV,sBAAsB,EACtB,YAAY,EACZ,WAAW,EACX,eAAe,EACf,YAAY,EACZ,MAAM,EACN,eAAe,E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