appium-xcuitest-driver
Version:
Appium driver for iOS using XCUITest for backend
88 lines • 3.85 kB
TypeScript
import type { AppiumLogger } from '@appium/types';
import type { DevicePortForwarder, LockdownService } from 'appium-ios-remotexpc';
import { type RemoteXPCServices, type RemoteXPCTestAttachment, type RemoteXPCTestRunner } from './utils';
/**
* Per-driver-session RemoteXPC availability state.
*
* Initialized lazily on the first remotexpc operation. When the initial tunnel registry probe
* fails with {@link isTunnelAvailabilityError}, remotexpc is disabled for the remainder of the
* session so callers fall back without re-probing on every service call.
* Later per-operation tunnel failures do not flip that cached state.
*/
export declare class RemoteXPCFacade {
readonly udid: string;
private readonly platformVersion;
private readonly log;
private readonly isRealDevice;
private initPromise;
private initialized;
private enabled;
private module;
private services;
private useUsbMuxPath;
private sessionFallbackLogged;
private lastImportError;
constructor(udid: string, platformVersion: string | undefined, log: AppiumLogger, isRealDevice: boolean);
get eligible(): boolean;
static tryGetServicesStatic(platformVersion: string | null | undefined): Promise<RemoteXPCServices | null>;
/**
* Whether remotexpc should be used for service operations in this session.
*/
determineAvailability(): Promise<boolean>;
/**
* Loaded remotexpc Services export when {@link determineAvailability} is true.
*/
getServices(): Promise<RemoteXPCServices>;
tryGetServices(): Promise<RemoteXPCServices | null>;
/**
* XCTestRunner class from the loaded module.
*/
getXCTestRunner(): Promise<RemoteXPCTestRunner>;
/**
* XCTestAttachment class from the loaded module.
*/
getXCTestAttachment(): Promise<RemoteXPCTestAttachment>;
/**
* Resolves which RemoteXPC lockdown connector to use for this device.
*
* @throws When RemoteXPC lockdown cannot be used
*/
resolveLockdownStrategy(): Promise<'remotexpc-usbmux' | 'remotexpc-tunnel'>;
/**
* Creates a RemoteXPC device port forwarder when eligible and available.
*
* @throws When RemoteXPC port forwarding cannot be used
*/
createDevicePortForwarder(localPort: number, devicePort: number): Promise<DevicePortForwarder>;
/**
* Runs a lockdown operation over the usbmux path for this device.
*/
withUsbMuxLockdown<T>(operation: (lockdown: LockdownService) => Promise<T | undefined>): Promise<T | undefined>;
/**
* Runs a lockdown operation over the RSD tunnel for this device.
*/
withTunnelLockdown<T>(operation: (lockdown: LockdownService) => Promise<T | undefined>): Promise<T | undefined>;
/**
* Runs a RemoteXPC service operation when the session allows it.
*
* Tunnel availability failures during an operation are logged and return `null` without
* disabling remotexpc for the session (unlike the one-time init probe).
* Other failures are logged per call and also return `null` so callers can fall back once.
*/
attemptService<T>(feature: string, operation: (services: RemoteXPCServices) => Promise<T>): Promise<T | null>;
/**
* Runs a RemoteXPC service operation when the session allows it.
*
* @throws When remotexpc is disabled for the session or the operation fails.
*/
requireService<T>(feature: string, operation: (services: RemoteXPCServices) => Promise<T>): Promise<T>;
/**
* Disable remotexpc for the remainder of this session after the initial tunnel registry probe fails.
*/
noteTunnelUnavailable(feature: string, err: unknown): void;
private ensureInitialized;
private initialize;
private requireModule;
private handleServiceError;
}
//# sourceMappingURL=facade.d.ts.map