UNPKG

appium-xcuitest-driver

Version:

Appium driver for iOS using XCUITest for backend

62 lines 3.42 kB
import type { XCUITestDriver } from '../driver'; import type { HTTPHeaders } from '@appium/types'; import type { XcTestScreenRecordingInfo, XcTestScreenRecording } from './types'; /** * 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 fps - FPS value * @param codec - Video codec, where 0 is h264, 1 is HEVC * @returns The information about a newly created or a running the screen recording. * @throws {Error} If screen recording has failed to start. */ export declare function mobileStartXctestScreenRecording(this: 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. */ export declare function mobileGetXctestScreenRecordingInfo(this: XCUITestDriver): 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 `GET /wda/shutdown` API to the WebDriverAgent server running * on the device directly or by doing factory reset. * * @since Xcode 15/iOS 17 * @param 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 user - The name of the user for the remote authentication. * Only works if `remotePath` is provided. * @param pass - The password for the remote authentication. * Only works if `remotePath` is provided. * @param headers - Additional headers mapping for multipart http(s) uploads * @param fileFieldName - The name of the form field where the file content BLOB should be stored for * http(s) uploads * @param formFields - Additional form fields for multipart http(s) uploads * @param method - The http multipart upload method name. * Only works if `remotePath` is provided. * @returns The resulting movie with base64-encoded content or empty string if uploaded remotely. * @throws {Error} If there was an error while retrieving the video * file or the file content cannot be uploaded to the remote location. */ export declare function mobileStopXctestScreenRecording(this: XCUITestDriver, remotePath?: string, user?: string, pass?: string, headers?: HTTPHeaders, fileFieldName?: string, formFields?: Record<string, any> | [string, any][], method?: 'PUT' | 'POST' | 'PATCH'): Promise<XcTestScreenRecording>; //# sourceMappingURL=xctest-record-screen.d.ts.map