UNPKG

appium-ios-simulator

Version:
294 lines 12.6 kB
/** * @typedef {import('./types').CoreSimulator} CoreSimulator * @typedef {import('./types').HasSettings} HasSettings * @typedef {import('./types').InteractsWithApps} InteractsWithApps * @typedef {import('./types').InteractsWithKeychain} InteractsWithKeychain * @typedef {import('./types').SupportsGeolocation} SupportsGeolocation * @typedef {import('./types').HasMiscFeatures} HasMiscFeatures * @typedef {import('./types').InteractsWithSafariBrowser} InteractsWithSafariBrowser * @typedef {import('./types').SupportsBiometric} SupportsBiometric */ /** * @implements {CoreSimulator} * @implements {HasSettings} * @implements {InteractsWithApps} * @implements {InteractsWithKeychain} * @implements {SupportsGeolocation} * @implements {HasMiscFeatures} * @implements {InteractsWithSafariBrowser} * @implements {SupportsBiometric} */ export class SimulatorXcode10 extends EventEmitter<[never]> implements CoreSimulator, HasSettings, InteractsWithApps, InteractsWithKeychain, SupportsGeolocation, HasMiscFeatures, InteractsWithSafariBrowser, SupportsBiometric { /** * Constructs the object with the `udid` and version of Xcode. Use the exported `getSimulator(udid)` method instead. * * @param {string} udid - The Simulator ID. * @param {import('appium-xcode').XcodeVersion} xcodeVersion - The target Xcode version in format {major, minor, build}. * @param {import('@appium/types').AppiumLogger?} log */ constructor(udid: string, xcodeVersion: import("appium-xcode").XcodeVersion, log?: import("@appium/types").AppiumLogger | null); /** @type {string|undefined|null} */ _keychainsBackupPath: string | undefined | null; /** @type {string|undefined|null} */ _platformVersion: string | undefined | null; /** @type {string|undefined|null} */ _webInspectorSocket: string | undefined | null; _udid: string; _simctl: Simctl; _xcodeVersion: import("appium-xcode/build/lib/xcode").XcodeVersion; _idb: any; _log: import("@appium/types").AppiumLogger; /** * @returns {string} */ get udid(): string; /** * @returns {Simctl} */ get simctl(): Simctl; /** * @returns {import('appium-xcode').XcodeVersion} */ get xcodeVersion(): import("appium-xcode").XcodeVersion; /** * @returns {string} */ get keychainPath(): string; /** * @return {import('@appium/types').AppiumLogger} */ get log(): import("@appium/types").AppiumLogger; /** * @return {string} Bundle identifier of Simulator UI client. */ get uiClientBundleId(): string; /** * @return {number} The max number of milliseconds to wait until Simulator booting is completed. */ get startupTimeout(): number; /** * Set the full path to the devices set. It is recommended to set this value * once right after Simulator instance is created and to not change it during * the instance lifecycle * * @param {?string} value The full path to the devices set root on the * local file system */ set devicesSetPath(value: string | null); /** * @return {?string} The full path to the devices set where the current simulator is located. * `null` value means that the default path is used, which is usually `~/Library/Developer/CoreSimulator/Devices` */ get devicesSetPath(): string | null; /** * IDB instance setter * * @param {any} value */ set idb(value: any); /** * @return {Promise<any>} idb instance */ get idb(): Promise<any>; /** * Retrieve the full path to the directory where Simulator stuff is located. * * @return {string} The path string. */ getRootDir(): string; /** * Retrieve the full path to the directory where Simulator applications data is located. * * @return {string} The path string. */ getDir(): string; /** * Retrieve the full path to the directory where Simulator logs are stored. * * @return {string} The path string. */ getLogDir(): string; /** * Get the state and specifics of this sim. * * @return {Promise<import('./types').DeviceStat|import('@appium/types').StringRecord<never>>} Simulator stats mapping, for example: * { name: 'iPhone 4s', * udid: 'C09B34E5-7DCB-442E-B79C-AB6BC0357417', * state: 'Shutdown', * sdk: '8.3' * } */ stat(): Promise<import("./types").DeviceStat | import("@appium/types").StringRecord<never>>; /** * Check if the Simulator has been booted at least once * and has not been erased before * * @return {Promise<boolean>} True if the current Simulator has never been started before */ isFresh(): Promise<boolean>; /** * Retrieves the state of the current Simulator. One should distinguish the * states of Simulator UI and the Simulator itself. * * @return {Promise<boolean>} True if the current Simulator is running. */ isRunning(): Promise<boolean>; /** * Checks if the simulator is in shutdown state. * This method is necessary, because Simulator might also be * in the transitional Shutting Down state right after the `shutdown` * command has been issued. * * @return {Promise<boolean>} True if the current Simulator is shut down. */ isShutdown(): Promise<boolean>; /** * Retrieves the current process id of the UI client * * @return {Promise<string|null>} The process ID or null if the UI client is not running */ getUIClientPid(): Promise<string | null>; /** * Check the state of Simulator UI client. * * @return {Promise<boolean>} True of if UI client is running or false otherwise. */ isUIClientRunning(): Promise<boolean>; /** * Get the platform version of the current Simulator. * * @return {Promise<string>} SDK version, for example '8.3'. */ getPlatformVersion(): Promise<string>; /** * Boots Simulator if not already booted. * Does nothing if it is already running. * This API does NOT wait until Simulator is fully booted. * * @throws {Error} If there was a failure while booting the Simulator. */ boot(): Promise<void>; /** * Verify whether the Simulator booting is completed and/or wait for it * until the timeout expires. * * @param {number} startupTimeout - the number of milliseconds to wait until booting is completed. */ waitForBoot(startupTimeout: number): Promise<void>; /** * Reset the current Simulator to the clean state. * It is expected the simulator is in shutdown state when this API is called. */ clean(): Promise<void>; /** * Delete the particular Simulator from devices list */ delete(): Promise<void>; /** * Shut down the current Simulator. * * @param {import('./types').ShutdownOptions} [opts={}] * @throws {Error} If Simulator fails to transition into Shutdown state after * the given timeout */ shutdown(opts?: import("./types").ShutdownOptions): Promise<void>; /** * Boots simulator and opens simulators UI Client if not already opened. * * @param {boolean} isUiClientRunning - process id of simulator UI client. * @param {import('./types').RunOptions} [opts={}] - arguments to start simulator UI client with. */ launchWindow(isUiClientRunning: boolean, opts?: import("./types").RunOptions): Promise<void>; /** * Start the Simulator UI client with the given arguments * * @param {import('./types').StartUiClientOptions} [opts={}] - Simulator startup options */ startUIClient(opts?: import("./types").StartUiClientOptions): Promise<void>; /** * Executes given Simulator with options. The Simulator will not be restarted if * it is already running and the current UI state matches to `isHeadless` option. * * @param {import('./types').RunOptions} [opts={}] - One or more of available Simulator options */ run(opts?: import("./types").RunOptions): Promise<void>; /** * Kill the UI client if it is running. * * @param {import('./types').KillUiClientOptions} [opts={}] * @return {Promise<boolean>} True if the UI client was successfully killed or false * if it is not running. * @throws {Error} If sending the signal to the client process fails */ killUIClient(opts?: import("./types").KillUiClientOptions): Promise<boolean>; /** * Lists processes that are currently running on the given Simulator. * The simulator must be in running state in order for this * method to work properly. * * @return {Promise<import('./types').ProcessInfo[]>} The list of retrieved process * information * @throws {Error} if no process information could be retrieved. */ ps(): Promise<import("./types").ProcessInfo[]>; /** * @returns {Promise<string>} */ getLaunchDaemonsRoot(): Promise<string>; installApp: typeof appExtensions.installApp; getUserInstalledBundleIdsByBundleName: typeof appExtensions.getUserInstalledBundleIdsByBundleName; isAppInstalled: typeof appExtensions.isAppInstalled; removeApp: typeof appExtensions.removeApp; launchApp: typeof appExtensions.launchApp; terminateApp: typeof appExtensions.terminateApp; isAppRunning: typeof appExtensions.isAppRunning; scrubApp: typeof appExtensions.scrubApp; openUrl: typeof safariExtensions.openUrl; scrubSafari: typeof safariExtensions.scrubSafari; updateSafariSettings: typeof safariExtensions.updateSafariSettings; getWebInspectorSocket: () => Promise<string | null>; isBiometricEnrolled: typeof biometricExtensions.isBiometricEnrolled; enrollBiometric: typeof biometricExtensions.enrollBiometric; sendBiometricMatch: typeof biometricExtensions.sendBiometricMatch; setGeolocation: typeof geolocationExtensions.setGeolocation; backupKeychains: () => Promise<boolean>; restoreKeychains: () => Promise<boolean>; clearKeychains: typeof keychainExtensions.clearKeychains; shake: typeof miscExtensions.shake; addCertificate: typeof miscExtensions.addCertificate; pushNotification: typeof miscExtensions.pushNotification; setPermission: typeof permissionsExtensions.setPermission; setPermissions: typeof permissionsExtensions.setPermissions; getPermission: typeof permissionsExtensions.getPermission; updateSettings: typeof settingsExtensions.updateSettings; setAppearance: typeof settingsExtensions.setAppearance; getAppearance: typeof settingsExtensions.getAppearance; setIncreaseContrast: typeof settingsExtensions.setIncreaseContrast; getIncreaseContrast: typeof settingsExtensions.getIncreaseContrast; setContentSize: typeof settingsExtensions.setContentSize; getContentSize: typeof settingsExtensions.getContentSize; configureLocalization: typeof settingsExtensions.configureLocalization; setAutoFillPasswords: typeof settingsExtensions.setAutoFillPasswords; setReduceMotion: typeof settingsExtensions.setReduceMotion; setReduceTransparency: typeof settingsExtensions.setReduceTransparency; disableKeyboardIntroduction: typeof settingsExtensions.disableKeyboardIntroduction; } export type CoreSimulator = import("./types").CoreSimulator; export type HasSettings = import("./types").HasSettings; export type InteractsWithApps = import("./types").InteractsWithApps; export type InteractsWithKeychain = import("./types").InteractsWithKeychain; export type SupportsGeolocation = import("./types").SupportsGeolocation; export type HasMiscFeatures = import("./types").HasMiscFeatures; export type InteractsWithSafariBrowser = import("./types").InteractsWithSafariBrowser; export type SupportsBiometric = import("./types").SupportsBiometric; import EventEmitter from 'events'; import { Simctl } from 'node-simctl'; import * as appExtensions from './extensions/applications'; import * as safariExtensions from './extensions/safari'; import * as biometricExtensions from './extensions/biometric'; import * as geolocationExtensions from './extensions/geolocation'; import * as keychainExtensions from './extensions/keychain'; import * as miscExtensions from './extensions/misc'; import * as permissionsExtensions from './extensions/permissions'; import * as settingsExtensions from './extensions/settings'; //# sourceMappingURL=simulator-xcode-10.d.ts.map