( device: DeviceInfo, timeoutMs: number, )
| 60 | } |
| 61 | |
| 62 | async 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 | |
| 81 | async function handleAndroidAlertAction( |
| 82 | device: DeviceInfo, |
no test coverage detected