UNPKG

appium-xcuitest-driver

Version:

Appium driver for iOS using XCUITest for backend

94 lines 4.56 kB
declare namespace _default { /** * Start a new screen recording via XCTest. * * Even though the feature is available for real devices * there is no possibility to delete stored video files yet, * which may lead to internal storage overload. * That is why it was put under a security feature flag. * * If the recording is already running this API is a noop. * * @since Xcode 15/iOS 17 * @param {number} [fps] FPS value * @param {number} [codec] Video codec, where 0 is h264, 1 is HEVC * @returns {Promise<XcTestScreenRecordingInfo>} The information * about a newly created or a running the screen recording. * @throws {Error} If screen recording has failed to start. * @this {XCUITestDriver} */ function mobileStartXctestScreenRecording(this: import("../driver").XCUITestDriver, fps?: number, codec?: number): Promise<XcTestScreenRecordingInfo>; /** * Retrieves information about the current running screen recording. * If no screen recording is running then `null` is returned. * * @returns {Promise<XcTestScreenRecordingInfo?>} */ function mobileGetXctestScreenRecordingInfo(): Promise<XcTestScreenRecordingInfo | null>; /** * Stop screen recording previously started by mobileStartXctestScreenRecording API. * * An error is thrown if no screen recording is running. * * The resulting movie is returned as base-64 string or is uploaded to * a remote location if corresponding options have been provided. * * The resulting movie is automatically deleted FOR SIMULATORS ONLY. * In order to clean it up from a real device it is necessary to properly * shut down XCTest by calling `POST /wda/shutdown` API or by doing factory reset. * * @since Xcode 15/iOS 17 * @param {string} [remotePath] The path to the remote location, where the resulting video should be * uploaded. * The following protocols are supported: `http`, `https`, `ftp`. Null or empty * string value (the default setting) means the content of resulting file * should be encoded as Base64 and passed as the endpoint response value. An * exception will be thrown if the generated media file is too big to fit into * the available process memory. * @param {string} [user] The name of the user for the remote authentication. * Only works if `remotePath` is provided. * @param {string} [pass] The password for the remote authentication. * Only works if `remotePath` is provided. * @param {import('@appium/types').HTTPHeaders} [headers] Additional headers mapping for multipart http(s) uploads * @param {string} [fileFieldName] The name of the form field where the file content BLOB should be stored for * http(s) uploads * @param {Record<string, any> | [string, any][]} [formFields] Additional form fields for multipart http(s) uploads * @param {'PUT' | 'POST' | 'PATCH'} [method='PUT'] The http multipart upload method name. * Only works if `remotePath` is provided. * @returns {Promise<XcTestScreenRecording>} * @throws {Error} If there was an error while retrieving the video * file or the file content cannot be uploaded to the remote location. * @this {XCUITestDriver} */ function mobileStopXctestScreenRecording(this: import("../driver").XCUITestDriver, remotePath?: string, user?: string, pass?: string, headers?: import("@appium/types").HTTPHeaders, fileFieldName?: string, formFields?: Record<string, any> | [string, any][], method?: "PUT" | "POST" | "PATCH"): Promise<XcTestScreenRecording>; } export default _default; export type XcTestScreenRecordingInfo = { /** * Unique identifier of the video being recorded */ uuid: string; /** * FPS value */ fps: number; /** * Video codec, where 0 is h264 */ codec: number; /** * The timestamp when the screen recording has started in float Unix seconds */ startedAt: number; }; export type XcTestScreenRecordingType = { /** * Base64-encoded content of the recorded media * file if `remotePath` parameter is empty or null or an empty string otherwise. * The media is expected to a be a valid QuickTime movie (.mov). */ payload: string; }; export type XcTestScreenRecording = XcTestScreenRecordingInfo & XcTestScreenRecordingType; export type XCUITestDriver = import("../driver").XCUITestDriver; //# sourceMappingURL=xctest-record-screen.d.ts.map