@qawolf/run-globals-ios 0.0.18
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 +232 -0
- package/dist/audio.d.ts +98 -0
- package/dist/audio.d.ts.map +1 -0
- package/dist/audio.js +145 -0
- package/dist/audio.js.map +1 -0
- package/dist/barcode.d.ts +58 -0
- package/dist/barcode.d.ts.map +1 -0
- package/dist/barcode.js +45 -0
- package/dist/barcode.js.map +1 -0
- package/dist/beacon.d.ts +48 -0
- package/dist/beacon.d.ts.map +1 -0
- package/dist/beacon.js +49 -0
- package/dist/beacon.js.map +1 -0
- package/dist/configuration-profile.d.ts +27 -0
- package/dist/configuration-profile.d.ts.map +1 -0
- package/dist/configuration-profile.js +40 -0
- package/dist/configuration-profile.js.map +1 -0
- package/dist/gateway.d.ts +443 -0
- package/dist/gateway.d.ts.map +1 -0
- package/dist/gateway.js +433 -0
- package/dist/gateway.js.map +1 -0
- package/dist/index.d.ts +40 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +38 -0
- package/dist/index.js.map +1 -0
- package/dist/injectionHelpers.d.ts +18 -0
- package/dist/injectionHelpers.d.ts.map +1 -0
- package/dist/injectionHelpers.js +68 -0
- package/dist/injectionHelpers.js.map +1 -0
- package/dist/media.d.ts +79 -0
- package/dist/media.d.ts.map +1 -0
- package/dist/media.js +82 -0
- package/dist/media.js.map +1 -0
- package/dist/photo.d.ts +117 -0
- package/dist/photo.d.ts.map +1 -0
- package/dist/photo.js +143 -0
- package/dist/photo.js.map +1 -0
- package/dist/typings.d.ts +773 -0
- package/dist/webview.d.ts +23 -0
- package/dist/webview.d.ts.map +1 -0
- package/dist/webview.js +25 -0
- package/dist/webview.js.map +1 -0
- package/package.json +68 -0
|
@@ -0,0 +1,773 @@
|
|
|
1
|
+
// Generated by dts-bundle-generator v9.5.1
|
|
2
|
+
|
|
3
|
+
import { Browser } from 'webdriverio';
|
|
4
|
+
import { z } from 'zod';
|
|
5
|
+
|
|
6
|
+
declare const SpeakerRecordingSessionSchema: z.ZodObject<{
|
|
7
|
+
id: z.ZodString;
|
|
8
|
+
status: z.ZodString;
|
|
9
|
+
}, z.core.$strip>;
|
|
10
|
+
/**
|
|
11
|
+
* Represents an active speaker recording session
|
|
12
|
+
*/
|
|
13
|
+
export type SpeakerRecordingSession = z.input<typeof SpeakerRecordingSessionSchema>;
|
|
14
|
+
declare const SpeakerRecordingFileSchema: z.ZodObject<{
|
|
15
|
+
filename: z.ZodString;
|
|
16
|
+
fingerprint: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
|
|
17
|
+
duration: z.ZodOptional<z.ZodNumber>;
|
|
18
|
+
}, z.core.$strip>;
|
|
19
|
+
/**
|
|
20
|
+
* Represents a recorded audio file with optional fingerprint data
|
|
21
|
+
*/
|
|
22
|
+
export type SpeakerRecordingFile = z.input<typeof SpeakerRecordingFileSchema>;
|
|
23
|
+
declare const AudioFingerprintSchema: z.ZodObject<{
|
|
24
|
+
fingerprint: z.ZodArray<z.ZodNumber>;
|
|
25
|
+
duration: z.ZodNumber;
|
|
26
|
+
}, z.core.$strip>;
|
|
27
|
+
/**
|
|
28
|
+
* Represents the audio fingerprint calculation result
|
|
29
|
+
*/
|
|
30
|
+
export type AudioFingerprint = z.input<typeof AudioFingerprintSchema>;
|
|
31
|
+
/**
|
|
32
|
+
* Start audio recording on the iOS device.
|
|
33
|
+
* This creates a new recording session and returns a session identifier
|
|
34
|
+
* that must be used to stop the recording.
|
|
35
|
+
*
|
|
36
|
+
* @param driver - The WebDriverIO browser instance
|
|
37
|
+
* @returns Promise resolving to the audio session information
|
|
38
|
+
* @example
|
|
39
|
+
* ```typescript
|
|
40
|
+
* const session = await ios.startSpeakerRecording(driver);
|
|
41
|
+
* console.log(`Recording started with session ID: ${session.id}`);
|
|
42
|
+
* ```
|
|
43
|
+
*/
|
|
44
|
+
export declare function startSpeakerRecording(driver: Browser): Promise<SpeakerRecordingSession>;
|
|
45
|
+
/**
|
|
46
|
+
* Stop audio recording and finalize the audio file.
|
|
47
|
+
* This also calculates the audio fingerprint automatically.
|
|
48
|
+
*
|
|
49
|
+
* @param driver - The WebDriverIO browser instance
|
|
50
|
+
* @param sessionId - The session ID returned from startRecording
|
|
51
|
+
* @returns Promise resolving to the audio file information including fingerprint
|
|
52
|
+
* @example
|
|
53
|
+
* ```typescript
|
|
54
|
+
* const file = await ios.stopSpeakerRecording(driver, session.id);
|
|
55
|
+
* console.log(`Recording saved to: ${file.filename}`);
|
|
56
|
+
* if (file.fingerprint) {
|
|
57
|
+
* console.log(`Fingerprint has ${file.fingerprint.length} values`);
|
|
58
|
+
* }
|
|
59
|
+
* ```
|
|
60
|
+
*/
|
|
61
|
+
export declare function stopSpeakerRecording(driver: Browser, sessionId: string): Promise<SpeakerRecordingFile>;
|
|
62
|
+
/**
|
|
63
|
+
* Download a recorded audio file as a Buffer.
|
|
64
|
+
* The audio file is returned in WAV format.
|
|
65
|
+
*
|
|
66
|
+
* @param driver - The WebDriverIO browser instance
|
|
67
|
+
* @param filename - The filename returned from stopRecording
|
|
68
|
+
* @returns Promise resolving to the audio file contents as a Buffer
|
|
69
|
+
* @example
|
|
70
|
+
* ```typescript
|
|
71
|
+
* const audioBuffer = await ios.downloadSpeakerRecording(driver, file.filename);
|
|
72
|
+
* fs.writeFileSync('/tmp/recording.wav', audioBuffer);
|
|
73
|
+
* ```
|
|
74
|
+
*/
|
|
75
|
+
export declare function downloadSpeakerRecording(driver: Browser, filename: string): Promise<Buffer>;
|
|
76
|
+
/**
|
|
77
|
+
* Calculate audio fingerprint from audio data.
|
|
78
|
+
* Accepts either a Buffer or base64-encoded string of WAV audio data.
|
|
79
|
+
*
|
|
80
|
+
* @param driver - The WebDriverIO browser instance
|
|
81
|
+
* @param audioData - Audio data as Buffer or base64 string (WAV format)
|
|
82
|
+
* @returns Promise resolving to the fingerprint calculation result
|
|
83
|
+
* @example
|
|
84
|
+
* ```typescript
|
|
85
|
+
* const audioBuffer = fs.readFileSync('/tmp/reference.wav');
|
|
86
|
+
* const fingerprint = await ios.calculateAudioFingerprint(driver, audioBuffer);
|
|
87
|
+
* console.log(`Duration: ${fingerprint.duration}s`);
|
|
88
|
+
* console.log(`Fingerprint: ${fingerprint.fingerprint.slice(0, 10).join(', ')}...`);
|
|
89
|
+
* ```
|
|
90
|
+
*/
|
|
91
|
+
export declare function calculateAudioFingerprint(driver: Browser, audioData: Buffer | string): Promise<AudioFingerprint>;
|
|
92
|
+
declare const PhotoAssetSchema: z.ZodObject<{
|
|
93
|
+
localIdentifier: z.ZodString;
|
|
94
|
+
mediaType: z.ZodString;
|
|
95
|
+
mediaSubtype: z.ZodString;
|
|
96
|
+
creationDate: z.ZodString;
|
|
97
|
+
modificationDate: z.ZodString;
|
|
98
|
+
pixelWidth: z.ZodNumber;
|
|
99
|
+
pixelHeight: z.ZodNumber;
|
|
100
|
+
duration: z.ZodNumber;
|
|
101
|
+
isFavorite: z.ZodBoolean;
|
|
102
|
+
isHidden: z.ZodBoolean;
|
|
103
|
+
}, z.core.$strip>;
|
|
104
|
+
/**
|
|
105
|
+
* Represents a photo or video asset in the Photos library
|
|
106
|
+
*/
|
|
107
|
+
export type PhotoAsset = z.input<typeof PhotoAssetSchema>;
|
|
108
|
+
declare const SavePhotoResultSchema: z.ZodObject<{
|
|
109
|
+
success: z.ZodBoolean;
|
|
110
|
+
message: z.ZodOptional<z.ZodString>;
|
|
111
|
+
}, z.core.$strip>;
|
|
112
|
+
/**
|
|
113
|
+
* Result of saving a photo to the Photos library
|
|
114
|
+
*/
|
|
115
|
+
export type SavePhotoResult = z.input<typeof SavePhotoResultSchema>;
|
|
116
|
+
declare const ListPhotosResultSchema: z.ZodObject<{
|
|
117
|
+
success: z.ZodBoolean;
|
|
118
|
+
assets: z.ZodArray<z.ZodObject<{
|
|
119
|
+
localIdentifier: z.ZodString;
|
|
120
|
+
mediaType: z.ZodString;
|
|
121
|
+
mediaSubtype: z.ZodString;
|
|
122
|
+
creationDate: z.ZodString;
|
|
123
|
+
modificationDate: z.ZodString;
|
|
124
|
+
pixelWidth: z.ZodNumber;
|
|
125
|
+
pixelHeight: z.ZodNumber;
|
|
126
|
+
duration: z.ZodNumber;
|
|
127
|
+
isFavorite: z.ZodBoolean;
|
|
128
|
+
isHidden: z.ZodBoolean;
|
|
129
|
+
}, z.core.$strip>>;
|
|
130
|
+
totalCount: z.ZodNumber;
|
|
131
|
+
}, z.core.$strip>;
|
|
132
|
+
/**
|
|
133
|
+
* Result of listing photos from the Photos library
|
|
134
|
+
*/
|
|
135
|
+
export type ListPhotosResult = z.input<typeof ListPhotosResultSchema>;
|
|
136
|
+
declare const DeletePhotosResultSchema: z.ZodObject<{
|
|
137
|
+
success: z.ZodBoolean;
|
|
138
|
+
deletedCount: z.ZodNumber;
|
|
139
|
+
message: z.ZodOptional<z.ZodString>;
|
|
140
|
+
}, z.core.$strip>;
|
|
141
|
+
/**
|
|
142
|
+
* Result of deleting all photos from the Photos library
|
|
143
|
+
*/
|
|
144
|
+
export type DeletePhotosResult = z.input<typeof DeletePhotosResultSchema>;
|
|
145
|
+
/**
|
|
146
|
+
* Save an image file from the filesystem to the device Photos library.
|
|
147
|
+
* This function handles the entire workflow:
|
|
148
|
+
* 1. Reads the file from the filesystem
|
|
149
|
+
* 2. Pushes it to the device's app container
|
|
150
|
+
* 3. Saves it to Photos library via the iOS agent
|
|
151
|
+
* 4. Cleans up the temporary file from the device
|
|
152
|
+
*
|
|
153
|
+
* @param driver - The WebDriverIO browser instance
|
|
154
|
+
* @param filePath - Absolute path to the file on the filesystem
|
|
155
|
+
* @returns Promise resolving to the save operation result
|
|
156
|
+
* @example
|
|
157
|
+
* ```typescript
|
|
158
|
+
* const result = await ios.savePhoto(driver, '/Users/me/photo.jpg');
|
|
159
|
+
* if (result.success) {
|
|
160
|
+
* console.log('Photo saved to library');
|
|
161
|
+
* }
|
|
162
|
+
* ```
|
|
163
|
+
*/
|
|
164
|
+
export declare function savePhoto(driver: Browser, filePath: string): Promise<SavePhotoResult>;
|
|
165
|
+
/**
|
|
166
|
+
* List all photos and videos from the Photos library.
|
|
167
|
+
* Returns full protocol response with success status, assets array, and total count.
|
|
168
|
+
*
|
|
169
|
+
* @param driver - The WebDriverIO browser instance
|
|
170
|
+
* @returns Promise resolving to list result with assets and count
|
|
171
|
+
* @example
|
|
172
|
+
* ```typescript
|
|
173
|
+
* const result = await ios.listPhotos(driver);
|
|
174
|
+
* console.log(`Found ${result.totalCount} photos in library`);
|
|
175
|
+
* result.assets.forEach(asset => {
|
|
176
|
+
* console.log(`${asset.mediaType}: ${asset.localIdentifier}`);
|
|
177
|
+
* });
|
|
178
|
+
* ```
|
|
179
|
+
*/
|
|
180
|
+
export declare function listPhotos(driver: Browser): Promise<ListPhotosResult>;
|
|
181
|
+
/**
|
|
182
|
+
* Delete all photos and videos from the Photos library.
|
|
183
|
+
* This is useful for cleaning up test data between test runs.
|
|
184
|
+
*
|
|
185
|
+
* @param driver - The WebDriverIO browser instance
|
|
186
|
+
* @returns Promise resolving to delete result with count and message
|
|
187
|
+
* @example
|
|
188
|
+
* ```typescript
|
|
189
|
+
* const result = await ios.deleteAllPhotos(driver);
|
|
190
|
+
* console.log(`Deleted ${result.deletedCount} photos`);
|
|
191
|
+
* ```
|
|
192
|
+
*/
|
|
193
|
+
export declare function deleteAllPhotos(driver: Browser): Promise<DeletePhotosResult>;
|
|
194
|
+
declare const ConfigurationProfileOptionsSchema: z.ZodObject<{
|
|
195
|
+
profileString: z.ZodString;
|
|
196
|
+
}, z.core.$strip>;
|
|
197
|
+
/**
|
|
198
|
+
* Options for installing a configuration profile
|
|
199
|
+
*/
|
|
200
|
+
export type ConfigurationProfileOptions = z.input<typeof ConfigurationProfileOptionsSchema>;
|
|
201
|
+
/**
|
|
202
|
+
* Install a configuration profile on the iOS device.
|
|
203
|
+
*
|
|
204
|
+
* @param driver - The WebDriverIO browser instance
|
|
205
|
+
* @param profileString - The configuration profile plist string
|
|
206
|
+
* @returns A function to uninstall the configuration profile
|
|
207
|
+
* @example
|
|
208
|
+
* ```typescript
|
|
209
|
+
* const uninstall = await ios.installConfigurationProfile(driver, profilePlistString);
|
|
210
|
+
* // ... run your test ...
|
|
211
|
+
* await uninstall(); // Clean up after the test
|
|
212
|
+
* ```
|
|
213
|
+
*/
|
|
214
|
+
export declare function installConfigurationProfile(driver: Browser, profileString: string): Promise<() => Promise<unknown>>;
|
|
215
|
+
declare const RouteTypeSchema: z.ZodEnum<{
|
|
216
|
+
direct: "direct";
|
|
217
|
+
"http-proxy": "http-proxy";
|
|
218
|
+
wireguard: "wireguard";
|
|
219
|
+
openvpn: "openvpn";
|
|
220
|
+
relay: "relay";
|
|
221
|
+
}>;
|
|
222
|
+
export type RouteType = z.infer<typeof RouteTypeSchema>;
|
|
223
|
+
declare const TunnelStatusSchema: z.ZodEnum<{
|
|
224
|
+
down: "down";
|
|
225
|
+
starting: "starting";
|
|
226
|
+
up: "up";
|
|
227
|
+
error: "error";
|
|
228
|
+
}>;
|
|
229
|
+
export type TunnelStatus = z.infer<typeof TunnelStatusSchema>;
|
|
230
|
+
declare const TunnelStateSchema: z.ZodObject<{
|
|
231
|
+
status: z.ZodEnum<{
|
|
232
|
+
down: "down";
|
|
233
|
+
starting: "starting";
|
|
234
|
+
up: "up";
|
|
235
|
+
error: "error";
|
|
236
|
+
}>;
|
|
237
|
+
interface: z.ZodOptional<z.ZodString>;
|
|
238
|
+
error: z.ZodOptional<z.ZodString>;
|
|
239
|
+
}, z.core.$strip>;
|
|
240
|
+
export type TunnelState = z.infer<typeof TunnelStateSchema>;
|
|
241
|
+
declare const TunnelStatusMapSchema: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
242
|
+
status: z.ZodEnum<{
|
|
243
|
+
down: "down";
|
|
244
|
+
starting: "starting";
|
|
245
|
+
up: "up";
|
|
246
|
+
error: "error";
|
|
247
|
+
}>;
|
|
248
|
+
interface: z.ZodOptional<z.ZodString>;
|
|
249
|
+
error: z.ZodOptional<z.ZodString>;
|
|
250
|
+
}, z.core.$strip>>;
|
|
251
|
+
export type TunnelStatusMap = z.infer<typeof TunnelStatusMapSchema>;
|
|
252
|
+
declare const HttpProxyTunnelSchema: z.ZodObject<{
|
|
253
|
+
type: z.ZodLiteral<"http-proxy">;
|
|
254
|
+
host: z.ZodString;
|
|
255
|
+
port: z.ZodNumber;
|
|
256
|
+
username: z.ZodOptional<z.ZodString>;
|
|
257
|
+
password: z.ZodOptional<z.ZodString>;
|
|
258
|
+
}, z.core.$strip>;
|
|
259
|
+
export type HttpProxyTunnel = z.infer<typeof HttpProxyTunnelSchema>;
|
|
260
|
+
declare const WireGuardTunnelSchema: z.ZodObject<{
|
|
261
|
+
type: z.ZodLiteral<"wireguard">;
|
|
262
|
+
configPath: z.ZodString;
|
|
263
|
+
}, z.core.$strip>;
|
|
264
|
+
export type WireGuardTunnel = z.infer<typeof WireGuardTunnelSchema>;
|
|
265
|
+
declare const OpenVPNTunnelSchema: z.ZodObject<{
|
|
266
|
+
type: z.ZodLiteral<"openvpn">;
|
|
267
|
+
configPath: z.ZodString;
|
|
268
|
+
}, z.core.$strip>;
|
|
269
|
+
export type OpenVPNTunnel = z.infer<typeof OpenVPNTunnelSchema>;
|
|
270
|
+
declare const TunnelConfigSchema: z.ZodUnion<readonly [
|
|
271
|
+
z.ZodObject<{
|
|
272
|
+
type: z.ZodLiteral<"direct">;
|
|
273
|
+
}, z.core.$strip>,
|
|
274
|
+
z.ZodObject<{
|
|
275
|
+
type: z.ZodLiteral<"http-proxy">;
|
|
276
|
+
host: z.ZodString;
|
|
277
|
+
port: z.ZodNumber;
|
|
278
|
+
username: z.ZodOptional<z.ZodString>;
|
|
279
|
+
password: z.ZodOptional<z.ZodString>;
|
|
280
|
+
}, z.core.$strip>,
|
|
281
|
+
z.ZodObject<{
|
|
282
|
+
type: z.ZodLiteral<"wireguard">;
|
|
283
|
+
configPath: z.ZodString;
|
|
284
|
+
}, z.core.$strip>,
|
|
285
|
+
z.ZodObject<{
|
|
286
|
+
type: z.ZodLiteral<"openvpn">;
|
|
287
|
+
configPath: z.ZodString;
|
|
288
|
+
}, z.core.$strip>,
|
|
289
|
+
z.ZodObject<{
|
|
290
|
+
type: z.ZodLiteral<"relay">;
|
|
291
|
+
host: z.ZodString;
|
|
292
|
+
port: z.ZodNumber;
|
|
293
|
+
username: z.ZodString;
|
|
294
|
+
password: z.ZodString;
|
|
295
|
+
dialer: z.ZodOptional<z.ZodEnum<{
|
|
296
|
+
tls: "tls";
|
|
297
|
+
tcp: "tcp";
|
|
298
|
+
}>>;
|
|
299
|
+
secure: z.ZodOptional<z.ZodBoolean>;
|
|
300
|
+
}, z.core.$strip>
|
|
301
|
+
]>;
|
|
302
|
+
export type TunnelConfig = z.infer<typeof TunnelConfigSchema>;
|
|
303
|
+
declare const RouteTrafficConfigSchema: z.ZodObject<{
|
|
304
|
+
apps: z.ZodArray<z.ZodString>;
|
|
305
|
+
domains: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
306
|
+
tunnel: z.ZodUnion<readonly [
|
|
307
|
+
z.ZodObject<{
|
|
308
|
+
type: z.ZodLiteral<"direct">;
|
|
309
|
+
}, z.core.$strip>,
|
|
310
|
+
z.ZodObject<{
|
|
311
|
+
type: z.ZodLiteral<"http-proxy">;
|
|
312
|
+
host: z.ZodString;
|
|
313
|
+
port: z.ZodNumber;
|
|
314
|
+
username: z.ZodOptional<z.ZodString>;
|
|
315
|
+
password: z.ZodOptional<z.ZodString>;
|
|
316
|
+
}, z.core.$strip>,
|
|
317
|
+
z.ZodObject<{
|
|
318
|
+
type: z.ZodLiteral<"wireguard">;
|
|
319
|
+
configPath: z.ZodString;
|
|
320
|
+
}, z.core.$strip>,
|
|
321
|
+
z.ZodObject<{
|
|
322
|
+
type: z.ZodLiteral<"openvpn">;
|
|
323
|
+
configPath: z.ZodString;
|
|
324
|
+
}, z.core.$strip>,
|
|
325
|
+
z.ZodObject<{
|
|
326
|
+
type: z.ZodLiteral<"relay">;
|
|
327
|
+
host: z.ZodString;
|
|
328
|
+
port: z.ZodNumber;
|
|
329
|
+
username: z.ZodString;
|
|
330
|
+
password: z.ZodString;
|
|
331
|
+
dialer: z.ZodOptional<z.ZodEnum<{
|
|
332
|
+
tls: "tls";
|
|
333
|
+
tcp: "tcp";
|
|
334
|
+
}>>;
|
|
335
|
+
secure: z.ZodOptional<z.ZodBoolean>;
|
|
336
|
+
}, z.core.$strip>
|
|
337
|
+
]>;
|
|
338
|
+
socksHost: z.ZodOptional<z.ZodString>;
|
|
339
|
+
socksPort: z.ZodOptional<z.ZodNumber>;
|
|
340
|
+
inspect: z.ZodOptional<z.ZodBoolean>;
|
|
341
|
+
}, z.core.$strip>;
|
|
342
|
+
export type RouteTrafficConfig = z.infer<typeof RouteTrafficConfigSchema>;
|
|
343
|
+
declare const NetworkStatusSchema: z.ZodObject<{
|
|
344
|
+
route: z.ZodEnum<{
|
|
345
|
+
direct: "direct";
|
|
346
|
+
"http-proxy": "http-proxy";
|
|
347
|
+
wireguard: "wireguard";
|
|
348
|
+
openvpn: "openvpn";
|
|
349
|
+
relay: "relay";
|
|
350
|
+
}>;
|
|
351
|
+
tunnels: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
352
|
+
status: z.ZodEnum<{
|
|
353
|
+
down: "down";
|
|
354
|
+
starting: "starting";
|
|
355
|
+
up: "up";
|
|
356
|
+
error: "error";
|
|
357
|
+
}>;
|
|
358
|
+
interface: z.ZodOptional<z.ZodString>;
|
|
359
|
+
error: z.ZodOptional<z.ZodString>;
|
|
360
|
+
}, z.core.$strip>>;
|
|
361
|
+
routingTables: z.ZodOptional<z.ZodObject<{
|
|
362
|
+
activeTable: z.ZodString;
|
|
363
|
+
tables: z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString>>;
|
|
364
|
+
}, z.core.$strip>>;
|
|
365
|
+
traffic: z.ZodOptional<z.ZodObject<{
|
|
366
|
+
routes: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
367
|
+
packets: z.ZodNumber;
|
|
368
|
+
bytes: z.ZodNumber;
|
|
369
|
+
}, z.core.$strip>>;
|
|
370
|
+
interfaces: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
371
|
+
rxPackets: z.ZodNumber;
|
|
372
|
+
txPackets: z.ZodNumber;
|
|
373
|
+
rxBytes: z.ZodNumber;
|
|
374
|
+
txBytes: z.ZodNumber;
|
|
375
|
+
}, z.core.$strip>>;
|
|
376
|
+
}, z.core.$strip>>;
|
|
377
|
+
vpnApp: z.ZodObject<{
|
|
378
|
+
bundleId: z.ZodString;
|
|
379
|
+
installed: z.ZodBoolean;
|
|
380
|
+
pid: z.ZodOptional<z.ZodNumber>;
|
|
381
|
+
}, z.core.$strip>;
|
|
382
|
+
routedApps: z.ZodArray<z.ZodString>;
|
|
383
|
+
routedDomains: z.ZodArray<z.ZodString>;
|
|
384
|
+
}, z.core.$strip>;
|
|
385
|
+
export type NetworkStatus = z.infer<typeof NetworkStatusSchema>;
|
|
386
|
+
export declare const NetworkConditionConfigSchema: z.ZodObject<{
|
|
387
|
+
bandwidthKbps: z.ZodOptional<z.ZodNumber>;
|
|
388
|
+
latencyMs: z.ZodOptional<z.ZodNumber>;
|
|
389
|
+
jitterMs: z.ZodOptional<z.ZodNumber>;
|
|
390
|
+
packetLossPercent: z.ZodOptional<z.ZodNumber>;
|
|
391
|
+
}, z.core.$strip>;
|
|
392
|
+
export type NetworkConditionConfig = z.infer<typeof NetworkConditionConfigSchema>;
|
|
393
|
+
/** 2G EDGE: ~240 Kbps, 300ms latency, high jitter */
|
|
394
|
+
export declare const NETWORK_2G_EDGE: {
|
|
395
|
+
readonly bandwidthKbps: 240;
|
|
396
|
+
readonly latencyMs: 300;
|
|
397
|
+
readonly jitterMs: 100;
|
|
398
|
+
readonly packetLossPercent: 1.5;
|
|
399
|
+
};
|
|
400
|
+
/** 3G: ~1.8 Mbps, 100ms latency */
|
|
401
|
+
export declare const NETWORK_3G: {
|
|
402
|
+
readonly bandwidthKbps: 1800;
|
|
403
|
+
readonly latencyMs: 100;
|
|
404
|
+
readonly jitterMs: 30;
|
|
405
|
+
readonly packetLossPercent: 0.5;
|
|
406
|
+
};
|
|
407
|
+
/** 4G LTE: ~12 Mbps, 30ms latency */
|
|
408
|
+
export declare const NETWORK_4G_LTE: {
|
|
409
|
+
readonly bandwidthKbps: 12000;
|
|
410
|
+
readonly latencyMs: 30;
|
|
411
|
+
readonly jitterMs: 10;
|
|
412
|
+
readonly packetLossPercent: 0.1;
|
|
413
|
+
};
|
|
414
|
+
/** 5G: ~100 Mbps, 10ms latency */
|
|
415
|
+
export declare const NETWORK_5G: {
|
|
416
|
+
readonly bandwidthKbps: 100000;
|
|
417
|
+
readonly latencyMs: 10;
|
|
418
|
+
readonly jitterMs: 3;
|
|
419
|
+
readonly packetLossPercent: 0.01;
|
|
420
|
+
};
|
|
421
|
+
/** Satellite: ~5 Mbps, 600ms latency */
|
|
422
|
+
export declare const NETWORK_SATELLITE: {
|
|
423
|
+
readonly bandwidthKbps: 5000;
|
|
424
|
+
readonly latencyMs: 600;
|
|
425
|
+
readonly jitterMs: 50;
|
|
426
|
+
readonly packetLossPercent: 1;
|
|
427
|
+
};
|
|
428
|
+
/** Congested WiFi: ~2 Mbps, 50ms latency, high jitter and packet loss */
|
|
429
|
+
export declare const NETWORK_WIFI_CONGESTED: {
|
|
430
|
+
readonly bandwidthKbps: 2000;
|
|
431
|
+
readonly latencyMs: 50;
|
|
432
|
+
readonly jitterMs: 40;
|
|
433
|
+
readonly packetLossPercent: 3;
|
|
434
|
+
};
|
|
435
|
+
/** Very bad network: ~100 Kbps, 500ms latency, extreme jitter and packet loss */
|
|
436
|
+
export declare const NETWORK_VERY_BAD: {
|
|
437
|
+
readonly bandwidthKbps: 100;
|
|
438
|
+
readonly latencyMs: 500;
|
|
439
|
+
readonly jitterMs: 200;
|
|
440
|
+
readonly packetLossPercent: 10;
|
|
441
|
+
};
|
|
442
|
+
/** Offline: 100% packet loss — drops all packets to simulate no connectivity */
|
|
443
|
+
export declare const NETWORK_OFFLINE: {
|
|
444
|
+
readonly packetLossPercent: 100;
|
|
445
|
+
};
|
|
446
|
+
export declare const NetworkConditionStatusSchema: z.ZodObject<{
|
|
447
|
+
enabled: z.ZodBoolean;
|
|
448
|
+
config: z.ZodOptional<z.ZodObject<{
|
|
449
|
+
bandwidthKbps: z.ZodOptional<z.ZodNumber>;
|
|
450
|
+
latencyMs: z.ZodOptional<z.ZodNumber>;
|
|
451
|
+
jitterMs: z.ZodOptional<z.ZodNumber>;
|
|
452
|
+
packetLossPercent: z.ZodOptional<z.ZodNumber>;
|
|
453
|
+
}, z.core.$strip>>;
|
|
454
|
+
interface: z.ZodOptional<z.ZodString>;
|
|
455
|
+
}, z.core.$strip>;
|
|
456
|
+
export type NetworkConditionStatus = z.infer<typeof NetworkConditionStatusSchema>;
|
|
457
|
+
/**
|
|
458
|
+
* Get the current network routing status via the Appium server's sessionless endpoint.
|
|
459
|
+
*
|
|
460
|
+
* Appium URL is resolved from APPIUM_HOST / APPIUM_PORT env vars (default 127.0.0.1:4723).
|
|
461
|
+
*
|
|
462
|
+
* @returns Combined network status
|
|
463
|
+
*/
|
|
464
|
+
export declare function getNetworkStatus(): Promise<NetworkStatus>;
|
|
465
|
+
/** A recorded network entry from GOST MITM inspection */
|
|
466
|
+
export interface RecordedEntry {
|
|
467
|
+
service: string;
|
|
468
|
+
network: string;
|
|
469
|
+
remote?: string;
|
|
470
|
+
local?: string;
|
|
471
|
+
host?: string;
|
|
472
|
+
proto?: string;
|
|
473
|
+
http?: {
|
|
474
|
+
host: string;
|
|
475
|
+
method: string;
|
|
476
|
+
proto: string;
|
|
477
|
+
scheme: string;
|
|
478
|
+
uri: string;
|
|
479
|
+
statusCode: number;
|
|
480
|
+
request?: {
|
|
481
|
+
contentLength: number;
|
|
482
|
+
header: Record<string, string[]>;
|
|
483
|
+
body: string | null;
|
|
484
|
+
};
|
|
485
|
+
response?: {
|
|
486
|
+
contentLength: number;
|
|
487
|
+
header: Record<string, string[]>;
|
|
488
|
+
body: string | null;
|
|
489
|
+
};
|
|
490
|
+
};
|
|
491
|
+
websocket?: {
|
|
492
|
+
from: string;
|
|
493
|
+
fin: boolean;
|
|
494
|
+
rsv1: boolean;
|
|
495
|
+
rsv2: boolean;
|
|
496
|
+
rsv3: boolean;
|
|
497
|
+
opcode: number;
|
|
498
|
+
masked: boolean;
|
|
499
|
+
maskKey: number;
|
|
500
|
+
length: number;
|
|
501
|
+
payload: string;
|
|
502
|
+
};
|
|
503
|
+
tls?: {
|
|
504
|
+
serverName: string;
|
|
505
|
+
cipherSuite: string;
|
|
506
|
+
version: string;
|
|
507
|
+
proto?: string;
|
|
508
|
+
};
|
|
509
|
+
dns?: {
|
|
510
|
+
id: number;
|
|
511
|
+
name: string;
|
|
512
|
+
class: string;
|
|
513
|
+
type: string;
|
|
514
|
+
question: string;
|
|
515
|
+
answer: string;
|
|
516
|
+
cached: boolean;
|
|
517
|
+
};
|
|
518
|
+
sid: string;
|
|
519
|
+
time: string;
|
|
520
|
+
duration: number;
|
|
521
|
+
}
|
|
522
|
+
type NetworkLogHandler = (entry: RecordedEntry) => void;
|
|
523
|
+
export interface NetworkLogSubscription {
|
|
524
|
+
on(handler: NetworkLogHandler): void;
|
|
525
|
+
close(): void;
|
|
526
|
+
}
|
|
527
|
+
/**
|
|
528
|
+
* Subscribe to real-time network entries streamed via SSE from the
|
|
529
|
+
* Appium plugin. Requires `routeTraffic()` to have been called first
|
|
530
|
+
* with `inspect: true`.
|
|
531
|
+
*
|
|
532
|
+
* Each call opens its own SSE connection to the plugin; closing the
|
|
533
|
+
* subscription tears it down. No shared state.
|
|
534
|
+
*
|
|
535
|
+
* @example
|
|
536
|
+
* ```typescript
|
|
537
|
+
* const logs = ios.subscribeNetworkLogs();
|
|
538
|
+
* logs.on((entry) => {
|
|
539
|
+
* if (entry.http) console.log(`${entry.http.method} ${entry.http.uri} → ${entry.http.statusCode}`);
|
|
540
|
+
* if (entry.dns) console.log(`DNS ${entry.dns.name} → ${entry.dns.answer}`);
|
|
541
|
+
* });
|
|
542
|
+
*
|
|
543
|
+
* // ... run tests ...
|
|
544
|
+
*
|
|
545
|
+
* logs.close();
|
|
546
|
+
* ```
|
|
547
|
+
*/
|
|
548
|
+
export declare function subscribeNetworkLogs(): NetworkLogSubscription;
|
|
549
|
+
export declare function routeTraffic(config: RouteTrafficConfig): Promise<() => Promise<void>>;
|
|
550
|
+
/**
|
|
551
|
+
* Simulate a network condition (bandwidth limit, latency, jitter, packet loss)
|
|
552
|
+
* on traffic flowing through the gateway.
|
|
553
|
+
*
|
|
554
|
+
* Returns a cleanup function that clears the condition.
|
|
555
|
+
*
|
|
556
|
+
* @example
|
|
557
|
+
* ```typescript
|
|
558
|
+
* // Use a built-in preset
|
|
559
|
+
* const cleanup = await ios.simulateNetworkCondition(ios.NETWORK_3G);
|
|
560
|
+
* await cleanup();
|
|
561
|
+
*
|
|
562
|
+
* // Custom config
|
|
563
|
+
* const cleanup = await ios.simulateNetworkCondition({ bandwidthKbps: 500, latencyMs: 200 });
|
|
564
|
+
* await cleanup();
|
|
565
|
+
* ```
|
|
566
|
+
*/
|
|
567
|
+
export declare function simulateNetworkCondition(config: NetworkConditionConfig): Promise<() => Promise<void>>;
|
|
568
|
+
/**
|
|
569
|
+
* Get the current network condition status.
|
|
570
|
+
*/
|
|
571
|
+
export declare function getNetworkCondition(): Promise<NetworkConditionStatus>;
|
|
572
|
+
/**
|
|
573
|
+
* Configuration for a barcode or QR code to inject.
|
|
574
|
+
*/
|
|
575
|
+
export interface BarcodeConfig {
|
|
576
|
+
/** AVMetadataObjectType constant. Default: "org.iso.QRCode" */
|
|
577
|
+
type?: string;
|
|
578
|
+
/** The barcode/QR code value to inject */
|
|
579
|
+
value: string;
|
|
580
|
+
/** Normalized bounds (0.0-1.0) for the detected barcode position */
|
|
581
|
+
bounds?: {
|
|
582
|
+
x: number;
|
|
583
|
+
y: number;
|
|
584
|
+
width: number;
|
|
585
|
+
height: number;
|
|
586
|
+
};
|
|
587
|
+
/** Corner points (0.0-1.0) for the detected barcode shape */
|
|
588
|
+
corners?: {
|
|
589
|
+
x: number;
|
|
590
|
+
y: number;
|
|
591
|
+
}[];
|
|
592
|
+
/**
|
|
593
|
+
* Raw binary payload exposed via `AVMetadataMachineReadableCodeObject.rawValue`
|
|
594
|
+
* (iOS 13+). Accepts a Buffer or a base64-encoded string. When omitted, the
|
|
595
|
+
* injector defaults to the UTF-8 encoding of `value`.
|
|
596
|
+
*/
|
|
597
|
+
rawValue?: Buffer | string;
|
|
598
|
+
}
|
|
599
|
+
/**
|
|
600
|
+
* Inject a barcode or QR code detection into the app's AVCaptureMetadataOutput.
|
|
601
|
+
*
|
|
602
|
+
* The injected barcode(s) will be delivered to the app's metadata output delegate
|
|
603
|
+
* as if they were scanned by the camera. The config file is auto-consumed by the
|
|
604
|
+
* injection system after delivery.
|
|
605
|
+
*
|
|
606
|
+
* @param driver - The WebDriverIO browser instance
|
|
607
|
+
* @param bundleId - Bundle ID of the target app
|
|
608
|
+
* @param barcodes - Single barcode config or array of configs
|
|
609
|
+
* @returns Cleanup function that removes the injection config
|
|
610
|
+
*
|
|
611
|
+
* @example
|
|
612
|
+
* ```typescript
|
|
613
|
+
* // Inject a QR code
|
|
614
|
+
* const cleanup = await ios.injectBarcode(driver, "com.example.app", {
|
|
615
|
+
* value: "https://example.com",
|
|
616
|
+
* });
|
|
617
|
+
*
|
|
618
|
+
* // Inject multiple barcodes
|
|
619
|
+
* const cleanup = await ios.injectBarcode(driver, "com.example.app", [
|
|
620
|
+
* { type: "org.iso.QRCode", value: "https://example.com" },
|
|
621
|
+
* { type: "org.gs1.EAN-13", value: "1234567890123" },
|
|
622
|
+
* ]);
|
|
623
|
+
*
|
|
624
|
+
* await cleanup();
|
|
625
|
+
* ```
|
|
626
|
+
*/
|
|
627
|
+
export declare function injectBarcode(driver: Browser, bundleId: string, barcodes: BarcodeConfig | BarcodeConfig[]): Promise<() => Promise<void>>;
|
|
628
|
+
/**
|
|
629
|
+
* Source configuration for camera/video feed injection.
|
|
630
|
+
*/
|
|
631
|
+
export interface CameraSource {
|
|
632
|
+
/** File path, URL, or data URI for the media to inject */
|
|
633
|
+
data: string;
|
|
634
|
+
/** Media type. Default: inferred from file extension */
|
|
635
|
+
type?: "image" | "video";
|
|
636
|
+
/** Delay in seconds before injection starts */
|
|
637
|
+
delaySeconds?: number;
|
|
638
|
+
}
|
|
639
|
+
/**
|
|
640
|
+
* Source configuration for microphone/audio injection.
|
|
641
|
+
*/
|
|
642
|
+
export interface AudioSource {
|
|
643
|
+
/** File path, URL, or data URI for the audio to inject */
|
|
644
|
+
data: string;
|
|
645
|
+
/** Delay in seconds before injection starts */
|
|
646
|
+
delaySeconds?: number;
|
|
647
|
+
}
|
|
648
|
+
/**
|
|
649
|
+
* Inject a camera/video feed into the app's AVCaptureSession.
|
|
650
|
+
*
|
|
651
|
+
* Replaces the camera input with the provided image or video. Affects photo
|
|
652
|
+
* capture, video data output, video recording, and preview layers.
|
|
653
|
+
*
|
|
654
|
+
* When `data` is a local file path, the file is pushed to the device first.
|
|
655
|
+
* URLs and data URIs are downloaded/decoded by the injection dylib on device.
|
|
656
|
+
*
|
|
657
|
+
* Cannot be used simultaneously with `injectAudio` (they share the same config file).
|
|
658
|
+
*
|
|
659
|
+
* @param driver - The WebDriverIO browser instance
|
|
660
|
+
* @param bundleId - Bundle ID of the target app
|
|
661
|
+
* @param source - Media source configuration
|
|
662
|
+
* @returns Cleanup function that removes the injection config and media file
|
|
663
|
+
*
|
|
664
|
+
* @example
|
|
665
|
+
* ```typescript
|
|
666
|
+
* // Inject a local image as camera feed
|
|
667
|
+
* const cleanup = await ios.injectCamera(driver, "com.example.app", {
|
|
668
|
+
* data: "/path/to/image.jpg",
|
|
669
|
+
* type: "image",
|
|
670
|
+
* });
|
|
671
|
+
*
|
|
672
|
+
* // Inject a video from URL
|
|
673
|
+
* const cleanup = await ios.injectCamera(driver, "com.example.app", {
|
|
674
|
+
* data: "https://example.com/video.mp4",
|
|
675
|
+
* type: "video",
|
|
676
|
+
* });
|
|
677
|
+
*
|
|
678
|
+
* await cleanup();
|
|
679
|
+
* ```
|
|
680
|
+
*/
|
|
681
|
+
export declare function injectCamera(driver: Browser, bundleId: string, source: CameraSource): Promise<() => Promise<void>>;
|
|
682
|
+
/**
|
|
683
|
+
* Inject audio into the app's microphone input.
|
|
684
|
+
*
|
|
685
|
+
* Replaces microphone input with the provided audio file. Affects
|
|
686
|
+
* AVAudioRecorder and AVCaptureAudioDataOutput.
|
|
687
|
+
*
|
|
688
|
+
* Cannot be used simultaneously with `injectCamera` (they share the same config file).
|
|
689
|
+
*
|
|
690
|
+
* @param driver - The WebDriverIO browser instance
|
|
691
|
+
* @param bundleId - Bundle ID of the target app
|
|
692
|
+
* @param source - Audio source configuration
|
|
693
|
+
* @returns Cleanup function that removes the injection config and audio file
|
|
694
|
+
*
|
|
695
|
+
* @example
|
|
696
|
+
* ```typescript
|
|
697
|
+
* const cleanup = await ios.injectAudio(driver, "com.example.app", {
|
|
698
|
+
* data: "/path/to/audio.mp3",
|
|
699
|
+
* });
|
|
700
|
+
*
|
|
701
|
+
* await cleanup();
|
|
702
|
+
* ```
|
|
703
|
+
*/
|
|
704
|
+
export declare function injectAudio(driver: Browser, bundleId: string, source: AudioSource): Promise<() => Promise<void>>;
|
|
705
|
+
/**
|
|
706
|
+
* Configuration for iBeacon injection.
|
|
707
|
+
*/
|
|
708
|
+
export interface BeaconConfig {
|
|
709
|
+
/** Beacon region UUID */
|
|
710
|
+
uuid: string;
|
|
711
|
+
/**
|
|
712
|
+
* Beacons to simulate in this region. When omitted or empty, only the
|
|
713
|
+
* `.region` file is pushed — the app receives a region-entry callback but
|
|
714
|
+
* no ranging callbacks.
|
|
715
|
+
*/
|
|
716
|
+
beacons?: {
|
|
717
|
+
major: number | string;
|
|
718
|
+
minor: number | string;
|
|
719
|
+
}[];
|
|
720
|
+
}
|
|
721
|
+
/**
|
|
722
|
+
* Inject iBeacon detections into the app's CLLocationManager.
|
|
723
|
+
*
|
|
724
|
+
* Always pushes the `{uuid}.region` file, which triggers
|
|
725
|
+
* `locationManager(_:didEnterRegion:)`. When `beacons` is provided, also
|
|
726
|
+
* pushes `{uuid}.beacon` so the app receives
|
|
727
|
+
* `locationManager(_:didRangeBeacons:inRegion:)` callbacks.
|
|
728
|
+
*
|
|
729
|
+
* @param driver - The WebDriverIO browser instance
|
|
730
|
+
* @param bundleId - Bundle ID of the target app
|
|
731
|
+
* @param config - Beacon configuration with UUID and (optional) beacon list
|
|
732
|
+
* @returns Cleanup function that removes the injection config files
|
|
733
|
+
*
|
|
734
|
+
* @example
|
|
735
|
+
* ```typescript
|
|
736
|
+
* // Region entry + ranging
|
|
737
|
+
* const cleanup = await ios.injectBeacon(driver, "com.example.app", {
|
|
738
|
+
* uuid: "8613BEAD-5465-4515-8F9C-AEEA717484C9",
|
|
739
|
+
* beacons: [{ major: 1, minor: 7 }],
|
|
740
|
+
* });
|
|
741
|
+
*
|
|
742
|
+
* // Region entry only (no ranging)
|
|
743
|
+
* const cleanup = await ios.injectBeacon(driver, "com.example.app", {
|
|
744
|
+
* uuid: "e62c96fd-014a-454f-9b41-32245d802bb3",
|
|
745
|
+
* });
|
|
746
|
+
*
|
|
747
|
+
* await cleanup();
|
|
748
|
+
* ```
|
|
749
|
+
*/
|
|
750
|
+
export declare function injectBeacon(driver: Browser, bundleId: string, config: BeaconConfig): Promise<() => Promise<void>>;
|
|
751
|
+
/**
|
|
752
|
+
* Toggle WebView debugging (Safari Web Inspector) for all WKWebViews in the app.
|
|
753
|
+
*
|
|
754
|
+
* When enabled, WKWebViews become inspectable via Safari DevTools.
|
|
755
|
+
* The default behavior (when no config file exists) is enabled.
|
|
756
|
+
*
|
|
757
|
+
* @param driver - The WebDriverIO browser instance
|
|
758
|
+
* @param bundleId - Bundle ID of the target app
|
|
759
|
+
* @param enabled - Whether to enable or disable WebView debugging
|
|
760
|
+
* @returns Cleanup function that removes the config (reverts to default: enabled)
|
|
761
|
+
*
|
|
762
|
+
* @example
|
|
763
|
+
* ```typescript
|
|
764
|
+
* // Disable WebView debugging
|
|
765
|
+
* const cleanup = await ios.setWebViewDebugging(driver, "com.example.app", false);
|
|
766
|
+
*
|
|
767
|
+
* // Re-enable (cleanup removes config, which defaults to enabled)
|
|
768
|
+
* await cleanup();
|
|
769
|
+
* ```
|
|
770
|
+
*/
|
|
771
|
+
export declare function setWebViewDebugging(driver: Browser, bundleId: string, enabled: boolean): Promise<() => Promise<void>>;
|
|
772
|
+
|
|
773
|
+
export {};
|