appium-xcuitest-driver
Version:
Appium driver for iOS using XCUITest for backend
58 lines • 2.55 kB
TypeScript
import type { XCUITestDriver } from '../driver';
import type { StartRecordingScreenOptions, StopRecordingScreenOptions } from './types';
export declare class ScreenRecorder {
private readonly videoPath;
private readonly log;
private readonly opts;
private readonly udid;
private mainProcess;
private timeoutHandler;
constructor(udid: string, log: any, videoPath: string, opts?: ScreenRecorderOptions);
start(timeoutMs: number): Promise<void>;
interrupt(force?: boolean): Promise<boolean>;
finish(): Promise<string>;
cleanup(): Promise<void>;
}
/**
* Direct Appium to start recording the device screen
*
* Record the display of devices running iOS Simulator since Xcode 9 or real devices since iOS 11
* (ffmpeg utility is required: 'brew install ffmpeg').
* It records screen activity to a MPEG-4 file. Audio is not recorded with the video file.
* If screen recording has been already started then the command will stop it forcefully and start a new one.
* The previously recorded video file will be deleted.
*
* @param options - The available options.
* @returns Base64-encoded content of the recorded media file if
* any screen recording is currently running or an empty string.
* @throws {Error} If screen recording has failed to start.
*/
export declare function startRecordingScreen(this: XCUITestDriver, options?: StartRecordingScreenOptions): Promise<string>;
/**
* Direct Appium to stop screen recording and return the video
*
* If no screen recording process is running then the endpoint will try to get
* the recently recorded file. If no previously recorded file is found and no
* active screen recording processes are running then the method returns an
* empty string.
*
* @param options - The available options.
* @returns Base64-encoded content of the recorded media
* file if `remotePath` parameter is empty or null or an empty string.
* @throws {Error} If there was an error while getting the name of a media
* file or the file content cannot be uploaded to the remote
* location.
*/
export declare function stopRecordingScreen(this: XCUITestDriver, options?: StopRecordingScreenOptions): Promise<string | null>;
interface ScreenRecorderOptions {
hardwareAcceleration?: string;
remotePort?: number;
remoteUrl?: string;
videoFps?: number;
videoType?: string;
videoScale?: string;
videoFilters?: string;
pixelFormat?: string;
}
export {};
//# sourceMappingURL=recordscreen.d.ts.map