(label, selector, options = {})
| 1207 | } |
| 1208 | |
| 1209 | async function waitForUiElement(label, selector, options = {}) { |
| 1210 | return retryHttpJson( |
| 1211 | "POST", |
| 1212 | `/api/simulators/${simulatorUDID}/action`, |
| 1213 | { |
| 1214 | action: "waitFor", |
| 1215 | source: "native-ax", |
| 1216 | maxDepth: options.maxDepth ?? 3, |
| 1217 | timeoutMs: options.waitTimeoutMs ?? 5_000, |
| 1218 | pollMs: options.pollMs ?? 250, |
| 1219 | selector, |
| 1220 | }, |
| 1221 | `${label} wait-for ${JSON.stringify(selector)}`, |
| 1222 | { |
| 1223 | attempts: 1, |
| 1224 | maxElapsedMs: options.waitMaxElapsedMs ?? httpActionBudgetMs, |
| 1225 | }, |
| 1226 | ); |
| 1227 | } |
| 1228 | |
| 1229 | async function waitForUiText(label, text, options = {}) { |
| 1230 | const timeoutMs = options.waitTimeoutMs ?? 5_000; |
no test coverage detected