MCPcopy Index your code
hub / github.com/callstack/agent-device / waitForAndroidAlert

Function waitForAndroidAlert

src/platforms/android/alert.ts:62–79  ·  view source on GitHub ↗
(
  device: DeviceInfo,
  timeoutMs: number,
)

Source from the content-addressed store, hash-verified

60}
61
62async function waitForAndroidAlert(
63 device: DeviceInfo,
64 timeoutMs: number,
65): Promise<AndroidAlertResult> {
66 const start = Date.now();
67 const candidate = await pollAndroidAlertCandidate(device, timeoutMs);
68 if (!candidate) {
69 throw new AppError('COMMAND_FAILED', 'alert wait timed out');
70 }
71 return {
72 kind: 'alertWait',
73 platform: 'android',
74 action: 'wait',
75 alert: candidate.alert,
76 waitedMs: Date.now() - start,
77 ...successText('Alert visible'),
78 };
79}
80
81async function handleAndroidAlertAction(
82 device: DeviceInfo,

Callers 1

handleAndroidAlertFunction · 0.85

Calls 2

successTextFunction · 0.90

Tested by

no test coverage detected