UNPKG

appium-xcuitest-driver

Version:

Appium driver for iOS using XCUITest for backend

65 lines 3.18 kB
import type { AppiumLogger } from '@appium/types'; import type * as RemoteXPCModule from 'appium-ios-remotexpc'; export type RemoteXPCEsmModule = typeof RemoteXPCModule; export type RemoteXPCServices = RemoteXPCEsmModule['Services']; export type RemoteXPCTestRunner = RemoteXPCEsmModule['XCTestRunner']; /** * Whether the given error means RemoteXPC tunnel infrastructure is unavailable. */ export declare function isTunnelAvailabilityError(err: unknown): boolean; /** * Get the RemoteXPC Services module dynamically * * This helper centralizes the import of appium-ios-remotexpc to: * - Provide consistent error handling across all services * - Give helpful installation instructions when the module is missing * * @returns The Services export from appium-ios-remotexpc * @throws {Error} If the module cannot be imported */ export declare function getRemoteXPCServices(): Promise<RemoteXPCServices>; /** * Try to load appium-ios-remotexpc without throwing (e.g. for optional features). * Successful loads share the same cache as {@link getRemoteXPCServices}. * * If the package is **not installed** (resolution error for **appium-ios-remotexpc**), subsequent * calls return `null` without re-importing. Other import failures are recorded via * {@link getLastRemoteXPCOptionalImportError} and **do not** permanently disable retries. */ export declare function tryGetRemoteXPCServices(): Promise<RemoteXPCServices | null>; /** * Whether {@link tryGetRemoteXPCServices} has determined that **appium-ios-remotexpc** is not * installed (same process will not retry optional import). */ export declare function isRemoteXPCOptionalDependencyMissing(): boolean; /** * Last error from an optional RemoteXPC `import()`, including transient failures. Cleared when a * load succeeds. When {@link isRemoteXPCOptionalDependencyMissing} is `true`, this matches the * stored missing-package error. */ export declare function getLastRemoteXPCOptionalImportError(): Error | null; /** * Full **appium-ios-remotexpc** module after a successful optional load (same `import()` as * {@link tryGetRemoteXPCServices}). Returns `null` if the package is missing or failed to load. */ export declare function tryGetRemoteXPCModule(): Promise<RemoteXPCEsmModule | null>; /** * Optional load of **appium-ios-remotexpc** (shared cache) plus the USBMUX vs tunnel branch hint: * whether `udid` appears in the usbmux device list. Used by lockdown and port forwarding so they * do not duplicate `import()` + {@link isDeviceListedInUsbmux}. * * @returns `null` if the module is not available; otherwise the module and whether to use the * USBMUX-oriented APIs (`createLockdownServiceByUDID`, `connectViaUsbmux`, …). */ export declare function tryGetRemoteXPCUsbMuxStrategy(udid: string, log: AppiumLogger): Promise<{ remotexpc: RemoteXPCEsmModule; useUsbMuxPath: boolean; } | null>; /** * Get the XCTestRunner class dynamically from appium-ios-remotexpc * * @returns The XCTestRunner class * @throws {Error} If the module cannot be imported */ export declare function getXCTestRunnerClass(): Promise<RemoteXPCTestRunner>; //# sourceMappingURL=remotexpc-utils.d.ts.map