appium-xcuitest-driver
Version:
Appium driver for iOS using XCUITest for backend
129 lines (128 loc) • 5.71 kB
TypeScript
export default commands;
export type PressButtonOptions = {
/**
* - The name of the button to be pressed.
*/
name: string;
/**
* - Duration in float seconds.
*/
durationSeconds?: number | undefined;
};
export type XCUITestDriver = import("../driver").XCUITestDriver;
export type ScreenInfo = import("./types").ScreenInfo;
declare namespace commands {
/**
* @this {XCUITestDriver}
*/
function active(this: import("../driver").XCUITestDriver): Promise<any>;
/**
* Trigger a touch/fingerprint match or match failure
*
* @param {boolean} match - whether the match should be a success or failure
* @this {XCUITestDriver}
*/
function touchId(this: import("../driver").XCUITestDriver, match?: boolean): Promise<void>;
/**
* Toggle whether the device is enrolled in the touch ID program
*
* @param {boolean} isEnabled - whether to enable or disable the touch ID program
*
* @this {XCUITestDriver}
*/
function toggleEnrollTouchId(this: import("../driver").XCUITestDriver, isEnabled?: boolean): Promise<void>;
/**
* Get the window size
* @this {XCUITestDriver}
* @returns {Promise<import('@appium/types').Size>}
*/
function getWindowSize(this: import("../driver").XCUITestDriver): Promise<import("@appium/types").Size>;
/**
* Retrieves the actual device time.
*
* @param {string} format - The format specifier string. Read the [MomentJS documentation](https://momentjs.com/docs/) to get the full list of supported datetime format specifiers. The default format is `YYYY-MM-DDTHH:mm:ssZ`, which complies to ISO-8601.
* @returns {Promise<string>} Formatted datetime string or the raw command output (if formatting fails)
* @this {XCUITestDriver}
*/
function getDeviceTime(this: import("../driver").XCUITestDriver, format?: string): Promise<string>;
/**
* Retrieves the current device time
*
* @param {string} format - See {@linkcode getDeviceTime.format}
* @returns {Promise<string>} Formatted datetime string or the raw command output if formatting fails
* @this {XCUITestDriver}
*/
function mobileGetDeviceTime(this: import("../driver").XCUITestDriver, format?: string): Promise<string>;
/**
* For W3C
* @this {XCUITestDriver}
* @return {Promise<import('@appium/types').Rect>}
*/
function getWindowRect(this: import("../driver").XCUITestDriver): Promise<import("@appium/types").Rect>;
/**
* @this {XCUITestDriver}
*/
function removeApp(this: import("../driver").XCUITestDriver, bundleId: any): Promise<boolean>;
/**
* @this {XCUITestDriver}
*/
function launchApp(this: import("../driver").XCUITestDriver): Promise<never>;
/**
* @this {XCUITestDriver}
*/
function closeApp(this: import("../driver").XCUITestDriver): Promise<never>;
/**
* @this {XCUITestDriver}
*/
function setUrl(this: import("../driver").XCUITestDriver, url: any): Promise<void>;
/**
* Retrieves the viewport dimensions.
*
* The viewport is the device's screen size with status bar size subtracted if the latter is present/visible.
* @returns {Promise<import('./types').Viewport>}
* @this {XCUITestDriver}
*/
function getViewportRect(this: import("../driver").XCUITestDriver): Promise<import("./types").Viewport>;
/**
* Get information about the screen.
*
* @privateRemarks memoized in constructor
* @this {XCUITestDriver}
* @returns {Promise<ScreenInfo>}
*/
function getScreenInfo(this: import("../driver").XCUITestDriver): Promise<ScreenInfo>;
/**
* @this {XCUITestDriver}
*/
function getStatusBarHeight(this: import("../driver").XCUITestDriver): Promise<number>;
/**
* memoized in constructor
* @this {XCUITestDriver}
*/
function getDevicePixelRatio(this: import("../driver").XCUITestDriver): Promise<number>;
/**
* Emulates press action on the given physical device button.
*
* This executes different methods based on the platform:
*
* - iOS: [`pressButton:`](https://developer.apple.com/documentation/xctest/xcuidevice/1619052-pressbutton)
* - tvOS: [`pressButton:`](https://developer.apple.com/documentation/xctest/xcuiremote/1627475-pressbutton) or [`pressButton:forDuration:`](https://developer.apple.com/documentation/xctest/xcuiremote/1627476-pressbutton)
*
* Use {@linkcode mobilePerformIoHidEvent} to call a more universal API to perform a button press with duration on any supported device.
*
* @param {import('./types').ButtonName} name - The name of the button to be pressed.
* @param {number} [durationSeconds] - The duration of the button press in seconds (float).
* @this {XCUITestDriver}
*/
function mobilePressButton(this: import("../driver").XCUITestDriver, name: import("./types").ButtonName, durationSeconds?: number): Promise<unknown>;
/**
* Process a string as speech and send it to Siri.
*
* Presents the Siri UI, if it is not currently active, and accepts a string which is then processed as if it were recognized speech. See [the documentation of `activateWithVoiceRecognitionText`](https://developer.apple.com/documentation/xctest/xcuisiriservice/2852140-activatewithvoicerecognitiontext?language=objc) for more details.
* @param {string} text - Text to be sent to Siri
* @returns {Promise<void>}
* @this {XCUITestDriver}
*/
function mobileSiriCommand(this: import("../driver").XCUITestDriver, text: string): Promise<void>;
}
//# sourceMappingURL=general.d.ts.map