askui
Version:
Reliable, automated end-to-end-testing that depends on what is shown on your screen instead of the technology you are running on
36 lines (35 loc) • 1.59 kB
TypeScript
import { ControlCommand } from '../../core/ui-control-commands';
import { DeviceClient } from '../device-client';
import { UiControllerClientConnectionState } from '../ui-controller-client-connection-state';
export interface LegacyAndroidClientArgs {
/** WebSocket address of the legacy UI Controller. Defaults to `ws://127.0.0.1:6769`. */
readonly controllerUrl?: string;
}
/**
* Drives an Android device through the AskUI legacy UI Controller over its
* WebSocket "runner protocol" (default `ws://127.0.0.1:6769`), implementing
* {@link DeviceClient} so it is interchangeable with the desktop AgentOS gRPC
* client and the direct-adb Android client.
*
* The controller must already be running in Android mode
* (`AskUI-StartController ... -r android`). The controller serves one command at
* a time, so requests are serialized.
*/
export declare class LegacyAndroidClient implements DeviceClient {
private static readonly DEFAULT_URL;
private static readonly REQUEST_TIMEOUT_IN_MS;
private static readonly CONNECT_TIMEOUT_IN_MS;
connectionState: UiControllerClientConnectionState;
private readonly url;
private ws;
private pending;
constructor(args?: LegacyAndroidClientArgs);
connect(): Promise<UiControllerClientConnectionState>;
private onMessage;
disconnect(): void;
private sendAndReceive;
requestControl(controlCommand: ControlCommand): Promise<void>;
requestScreenshot(): Promise<string>;
getStartingArguments(): Promise<Record<string, string | number | boolean>>;
setActiveDisplay(): Promise<void>;
}