appium-xcuitest-driver
Version:
Appium driver for iOS using XCUITest for backend
156 lines • 8.63 kB
TypeScript
declare namespace _default {
/**
* Installs the given application to the device under test.
*
* Please ensure the app is built for a correct architecture and is signed with a proper developer signature (for real devices) prior to calling this.
* @param {string} app - See docs for `appium:app` capability
* @param {number} [timeoutMs] - The maximum time to wait until app install is finished (in ms) on real devices.
* If not provided, then the value of `appium:appPushTimeout` capability is used. If the capability is not provided then the default is 240000ms (4 minutes).
* @param {boolean} [checkVersion] - If the application installation follows currently installed application's version status if provided.
* No checking occurs if no this option.
* @privateRemarks Link to capability docs
* @returns {Promise<void>}
* @this {XCUITestDriver}
*/
function mobileInstallApp(this: import("../driver").XCUITestDriver, app: string, timeoutMs?: number, checkVersion?: boolean): Promise<void>;
/**
* Checks whether the given application is installed on the device under test.
* Offload app is handled as not installed.
*
* @param {string} bundleId - The bundle identifier of the application to be checked
* @returns {Promise<boolean>} `true` if the application is installed; `false` otherwise
* @this {XCUITestDriver}
*/
function mobileIsAppInstalled(this: import("../driver").XCUITestDriver, bundleId: string): Promise<boolean>;
/**
* Removes/uninstalls the given application from the device under test.
* Offload app data could also be removed.
*
* @param {string} bundleId - The bundle identifier of the application to be removed
* @returns {Promise<boolean>} `true` if the application has been removed successfully; `false` otherwise
* @this {XCUITestDriver}
*/
function mobileRemoveApp(this: import("../driver").XCUITestDriver, bundleId: string): Promise<boolean>;
/**
* Executes the given app on the device under test.
*
* If the app is already running it will be activated. If the app is not installed or cannot be launched then an exception is thrown.
* @param {string} bundleId - The bundle identifier of the application to be launched
* @param {string|string[]} [args] - One or more command line arguments for the app. If the app is already running then this argument is ignored.
* @param {object} [environment] - Environment variables mapping for the app. If the app is already running then this argument is ignored.
* @returns {Promise<void>}
* @this {XCUITestDriver}
*/
function mobileLaunchApp(this: import("../driver").XCUITestDriver, bundleId: string, args?: string | string[], environment?: object): Promise<void>;
/**
* Terminates the given app on the device under test.
*
* This command performs termination via [XCTest's `terminate`](https://developer.apple.com/documentation/xctest/xcuiapplication/1500637-terminate) API. If the app is not installed an exception is thrown. If the app is not running then nothing is done.
* @param {string} bundleId - The bundle identifier of the application to be terminated
* @returns {Promise<boolean>} `true` if the app has been terminated successfully; `false` otherwise
* @this {XCUITestDriver}
*/
function mobileTerminateApp(this: import("../driver").XCUITestDriver, bundleId: string): Promise<boolean>;
/**
* Activate the given app on the device under test.
*
* This pushes the app to the foreground if it is running in the background. An exception is thrown if the app is not install or isn't running. Nothing is done if the app is already in the foreground.
*
* @param {string} bundleId - The bundle identifier of the application to be activated
* @returns {Promise<void>}
* @this {XCUITestDriver}
*/
function mobileActivateApp(this: import("../driver").XCUITestDriver, bundleId: string): Promise<void>;
/**
* Kill the given app on the real device under test by instruments service.
*
* If the app is not running or kill failed, then nothing is done.
*
* @remarks `appium-xcuitest-driver` v4.4 does not require `py-ios-device` to be installed.
* @privateRemarks See implementation at https://github.com/YueChen-C/py-ios-device/blob/51f4683c5c3c385a015858ada07a5f1c62d3cf57/ios_device/cli/base.py#L220
* @see https://github.com/YueChen-C/py-ios-device
* @param {string} bundleId - The bundle identifier of the application to be killed
* @returns {Promise<boolean>} `true` if the app has been killed successfully; `false` otherwise
* @group Real Device Only
* @this {XCUITestDriver}
*/
function mobileKillApp(this: import("../driver").XCUITestDriver, bundleId: string): Promise<boolean>;
/**
* Queries the state of an installed application from the device under test.
*
* If the app with the given `bundleId` is not installed, an exception will be thrown.
*
* @param {string} bundleId - The bundle identifier of the application to be queried
* @returns {Promise<AppState>} The actual application state code
* @see https://developer.apple.com/documentation/xctest/xcuiapplicationstate?language=objc
* @this {XCUITestDriver}
*/
function mobileQueryAppState(this: import("../driver").XCUITestDriver, bundleId: string): Promise<AppState>;
/**
* @param {string} appPath
* @param {object} opts
* @this {XCUITestDriver}
*/
function installApp(appPath: string, { timeoutMs, strategy }?: object): Promise<void>;
/**
* @param {string} bundleId
* @param {object} opts
* @this {XCUITestDriver}
*/
function activateApp(bundleId: string, opts?: object, ...args: any[]): Promise<void>;
/**
* @param {string} bundleId
* @this {XCUITestDriver}
*/
function isAppInstalled(this: import("../driver").XCUITestDriver, bundleId: string): Promise<boolean>;
/**
* @param {string} bundleId
* @this {XCUITestDriver}
* @returns {Promise<boolean>}
*/
function terminateApp(this: import("../driver").XCUITestDriver, bundleId: string): Promise<boolean>;
/**
* @param {string} bundleId
* @this {XCUITestDriver}
*/
function queryAppState(this: import("../driver").XCUITestDriver, bundleId: string): Promise<import("./enum").AppState>;
/**
* List applications installed on the real device under test
*
* Read [Pushing/Pulling files](https://appium.io/docs/en/writing-running-appium/ios/ios-xctest-file-movement/) for more details.
* @param {'User'|'System'} applicationType - The type of applications to list.
* @returns {Promise<Record<string,any>[]>} A list of apps where each item is a mapping of bundle identifiers to maps of platform-specific app properties.
* @remarks Having `UIFileSharingEnabled` set to `true` in the return app properties map means this app supports file upload/download in its `documents` container.
* @group Real Device Only
*/
function mobileListApps(applicationType?: "User" | "System"): Promise<Record<string, any>[]>;
/**
* Deletes application data files, so it could start from the clean state next time
* it is launched.
* This API only works on a Simulator.
*
* @param {string} bundleId Application bundle identifier
* @this {XCUITestDriver}
* @returns {Promise<boolean>} true if any files from the app's data container have been deleted
*/
function mobileClearApp(this: import("../driver").XCUITestDriver, bundleId: string): Promise<boolean>;
/**
* Close app (simulate device home button). It is possible to restore
* the app after the timeout or keep it minimized based on the parameter value.
*
* @param {number|{timeout: number?}} [seconds]
* - any positive number of seconds: come back after X seconds
* - any negative number of seconds or zero: never come back
* - undefined/null: never come back
* - {timeout: 5000}: come back after 5 seconds
* - {timeout: null}, {timeout: -2}: never come back
* @this {XCUITestDriver}
*/
function background(this: import("../driver").XCUITestDriver, seconds?: number | {
timeout: number | null;
}): Promise<unknown>;
}
export default _default;
export type XCUITestDriver = import("../driver").XCUITestDriver;
export type AppState = import("./enum").AppState;
//# sourceMappingURL=app-management.d.ts.map