appium-safari-driver
Version:
Appium driver for Safari browser
178 lines • 8.24 kB
TypeScript
/**
* @typedef {Object} StartRecordingOptions
*
* @property {string} codec [hevc] - Specifies the codec type: "h264" or "hevc"
* @property {string} display [internal] - Supports "internal" or "external". Default is "internal"
* @property {string} mask - For non-rectangular displays, handle the mask by policy:
* - ignored: The mask is ignored and the unmasked framebuffer is saved.
* - alpha: Not supported, but retained for compatibility; the mask is rendered black.
* - black: The mask is rendered black.
* @property {string|number} timeLimit [600] - The maximum recording time, in seconds. The default
* value is 600 seconds (10 minutes).
* @property {boolean} forceRestart [true] - Whether to ignore the call if a screen recording is currently running
* (`false`) or to start a new recording immediately and terminate the existing one if running (`true`).
*/
/**
* Record the Simulator's display in background while the automated test is running.
* This method uses `xcrun simctl io recordVideo` helper under the hood.
* Check the output of `xcrun simctl io` command for more details.
*
* @this {SafariDriver}
* @param {StartRecordingOptions} options - The available options.
* @this {import('../driver').SafariDriver}
* @throws {Error} If screen recording has failed to start or is not supported for the destination device.
*/
export function startRecordingScreen(this: import("../driver").SafariDriver, options: StartRecordingOptions): Promise<void>;
export class startRecordingScreen {
/**
* @typedef {Object} StartRecordingOptions
*
* @property {string} codec [hevc] - Specifies the codec type: "h264" or "hevc"
* @property {string} display [internal] - Supports "internal" or "external". Default is "internal"
* @property {string} mask - For non-rectangular displays, handle the mask by policy:
* - ignored: The mask is ignored and the unmasked framebuffer is saved.
* - alpha: Not supported, but retained for compatibility; the mask is rendered black.
* - black: The mask is rendered black.
* @property {string|number} timeLimit [600] - The maximum recording time, in seconds. The default
* value is 600 seconds (10 minutes).
* @property {boolean} forceRestart [true] - Whether to ignore the call if a screen recording is currently running
* (`false`) or to start a new recording immediately and terminate the existing one if running (`true`).
*/
/**
* Record the Simulator's display in background while the automated test is running.
* This method uses `xcrun simctl io recordVideo` helper under the hood.
* Check the output of `xcrun simctl io` command for more details.
*
* @this {SafariDriver}
* @param {StartRecordingOptions} options - The available options.
* @this {import('../driver').SafariDriver}
* @throws {Error} If screen recording has failed to start or is not supported for the destination device.
*/
constructor(this: import("../driver").SafariDriver, options: StartRecordingOptions);
_screenRecorder: ScreenRecorder;
}
/**
* @typedef {Object} StopRecordingOptions
*
* @property {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.
* @property {string} user - The name of the user for the remote authentication.
* @property {string} pass - The password for the remote authentication.
* @property {string} method - The http multipart upload method name. The 'PUT' one is used by default.
* @property {Object} headers - Additional headers mapping for multipart http(s) uploads
* @property {string} fileFieldName [file] - The name of the form field, where the file content BLOB should be stored for
* http(s) uploads
* @property {Object|[string, string][]} formFields - Additional form fields for multipart http(s) uploads
*/
/**
* Stop recording the screen.
* If no screen recording has been started before then the method returns an empty string.
*
* @this {SafariDriver}
* @param {StopRecordingOptions} options - The available options.
* @returns {Promise<string>} Base64-encoded content of the recorded media file if 'remotePath'
* parameter is falsy or an empty string.
* @this {import('../driver').SafariDriver}
* @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
* or screen recording is not supported on the device under test.
*/
export function stopRecordingScreen(this: import("../driver").SafariDriver, options: StopRecordingOptions): Promise<string>;
export type StartRecordingOptions = {
/**
* [hevc] - Specifies the codec type: "h264" or "hevc"
*/
codec: string;
/**
* [internal] - Supports "internal" or "external". Default is "internal"
*/
display: string;
/**
* - For non-rectangular displays, handle the mask by policy:
* - ignored: The mask is ignored and the unmasked framebuffer is saved.
* - alpha: Not supported, but retained for compatibility; the mask is rendered black.
* - black: The mask is rendered black.
*/
mask: string;
/**
* [600] - The maximum recording time, in seconds. The default
* value is 600 seconds (10 minutes).
*/
timeLimit: string | number;
/**
* [true] - Whether to ignore the call if a screen recording is currently running
* (`false`) or to start a new recording immediately and terminate the existing one if running (`true`).
*/
forceRestart: boolean;
};
export type StopRecordingOptions = {
/**
* - 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.
*/
remotePath: string;
/**
* - The name of the user for the remote authentication.
*/
user: string;
/**
* - The password for the remote authentication.
*/
pass: string;
/**
* - The http multipart upload method name. The 'PUT' one is used by default.
*/
method: string;
/**
* - Additional headers mapping for multipart http(s) uploads
*/
headers: any;
/**
* [file] - The name of the form field, where the file content BLOB should be stored for
* http(s) uploads
*/
fileFieldName: string;
/**
* - Additional form fields for multipart http(s) uploads
*/
formFields: any | [string, string][];
};
export type SafariDriver = import("../driver").SafariDriver;
declare class ScreenRecorder {
/**
* @param {string} udid
* @param {string} videoPath
* @param {import('@appium/types').AppiumLogger} log
* @param {{codec?: string, display?: string, mask?: string, timeLimit?: string|number}} [opts={}]
*/
constructor(udid: string, videoPath: string, log: import("@appium/types").AppiumLogger, opts?: {
codec?: string;
display?: string;
mask?: string;
timeLimit?: string | number;
});
log: import("@appium/types").AppiumLogger;
_process: import("teen_process").SubProcess | null;
_udid: string;
_videoPath: string;
_codec: string | undefined;
_display: string | undefined;
_mask: string | undefined;
_timeLimitMs: number;
_timer: NodeJS.Timeout | null;
getVideoPath(): Promise<string>;
get isRunning(): boolean;
_enforceTermination(): Promise<string>;
start(): Promise<void>;
stop(force?: boolean): Promise<string>;
}
export {};
//# sourceMappingURL=record-screen.d.ts.map