appium-xcuitest-driver
Version:
Appium driver for iOS using XCUITest for backend
34 lines • 1.76 kB
TypeScript
import type { XCUITestDriver } from '../driver';
export declare class TrafficCapture {
private mainProcess;
private readonly udid;
private readonly log;
private readonly resultPath;
constructor(udid: string, log: any, resultPath: string);
start(timeoutSeconds: number): Promise<void>;
isCapturing(): boolean;
interrupt(force?: boolean): Promise<boolean>;
finish(): Promise<string>;
cleanup(): Promise<void>;
}
/**
* Records the given network traffic capture into a .pcap file.
*
* @param timeLimitSec - The maximum recording time, in seconds. The maximum value is `43200` (12 hours).
* @param forceRestart - Whether to restart traffic capture process forcefully when startPcap is called (`true`) or ignore the call until the current traffic capture is completed (`false`, the default value).
* @throws {Error} If network traffic capture has failed to start.
*/
export declare function mobileStartPcap(this: XCUITestDriver, timeLimitSec?: number, forceRestart?: boolean): Promise<void>;
/**
* Stops network traffic capture.
*
* If no traffic capture process is running, then the endpoint will try to get the recently recorded file.
*
* If no previously recorded file is found and no active traffic capture processes are running, then the method returns an empty string.
*
* @remarks Network capture files can be viewed in [Wireshark](https://www.wireshark.org/) and other similar applications.
* @returns Base64-encoded content of the recorded pcap file or an empty string if no traffic capture has been started before.
* @throws {Error} If there was an error while getting the capture file.
*/
export declare function mobileStopPcap(this: XCUITestDriver): Promise<string>;
//# sourceMappingURL=pcap.d.ts.map