Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 3 additions & 23 deletions src/client-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export type { BatchRunResult } from './core/batch.ts';
import type { TargetShutdownResult } from './target-shutdown-contract.ts';
export type { TargetShutdownResult } from './target-shutdown-contract.ts';
import type { PerfAction, PerfArea, PerfKind, PerfSubject } from './contracts/perf.ts';
import type { AlertAction, AlertInfo } from './alert-contract.ts';
import type { AlertAction } from './alert-contract.ts';
import type { DebugSymbolsOptions, DebugSymbolsResult } from './contracts/debug-symbols.ts';
import type { RemoteConnectionProfileFields } from './remote-config-schema.ts';
import type { CommandResult } from './core/command-descriptor/command-result.ts';
Expand Down Expand Up @@ -459,26 +459,6 @@ export type ClipboardCommandOptions =
text: string;
});

export type WaitCommandResult = DaemonResponseData & {
waitedMs?: number;
text?: string;
selector?: string;
};

export type AlertCommandResult = DaemonResponseData & {
kind?: 'alertStatus' | 'alertHandled' | 'alertWait';
action?: AlertCommandOptions['action'];
alert?: AlertInfo | null;
handled?: boolean;
button?: string;
waitedMs?: number;
timedOut?: boolean;
platform?: AlertInfo['platform'];
accepted?: boolean;
dismissed?: boolean;
items?: string[];
};

export type ReactNativeCommandOptions = DeviceCommandBaseOptions & {
action: 'dismiss-overlay';
};
Expand All @@ -494,8 +474,8 @@ export type ViewportCommandOptions = DeviceCommandBaseOptions & {
};

export type AgentDeviceCommandClient = {
wait: (options: WaitCommandOptions) => Promise<WaitCommandResult>;
alert: (options?: AlertCommandOptions) => Promise<AlertCommandResult>;
wait: (options: WaitCommandOptions) => Promise<CommandRequestResult>;
alert: (options?: AlertCommandOptions) => Promise<CommandRequestResult>;
appState: (options?: AppStateCommandOptions) => Promise<CommandResult<'appstate'>>;
back: (options?: BackCommandOptions) => Promise<CommandResult<'back'>>;
home: (options?: HomeCommandOptions) => Promise<CommandResult<'home'>>;
Expand Down
2 changes: 0 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ export type {
AlertCommandOptions,
AlertInfo,
AlertPlatform,
AlertCommandResult,
AlertSource,
AppCloseOptions,
AppCloseResult,
Expand Down Expand Up @@ -119,7 +118,6 @@ export type {
TraceOptions,
TypeTextOptions,
WaitCommandOptions,
WaitCommandResult,
} from './client.ts';

export type {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,10 @@ test('Provider-backed integration Android alert wait polls until a dialog appear
...world.selection,
});
assert.equal(alertWait.kind, 'alertWait');
assert.equal(alertWait.alert?.source, 'permission');
// alert now returns the untyped CommandRequestResult bag (its iOS path is a
// dynamic runner Record, so the public type is no longer a closed shape).
const alertInfo = alertWait.alert as { source?: string } | null | undefined;
assert.equal(alertInfo?.source, 'permission');
assert.ok(snapshotCount >= 2);
},
);
Expand Down
Loading