( params: SelectorRuntimeParams, predicate: IsPredicate, selectorExpression: string, expectedText: string, )
| 269 | } |
| 270 | |
| 271 | async function dispatchDirectIosSelectorIs( |
| 272 | params: SelectorRuntimeParams, |
| 273 | predicate: IsPredicate, |
| 274 | selectorExpression: string, |
| 275 | expectedText: string, |
| 276 | ): Promise<DaemonResponse | null> { |
| 277 | if (predicate === 'hidden') return null; |
| 278 | const directQuery = await resolveDirectIosSelectorQuery(params, selectorExpression); |
| 279 | if (isDirectIosSelectorErrorResult(directQuery)) return directQuery.response; |
| 280 | if (!directQuery?.result.found || !directQuery.result.node) return null; |
| 281 | |
| 282 | const payload = |
| 283 | predicate === 'exists' |
| 284 | ? { |
| 285 | predicate, |
| 286 | pass: true, |
| 287 | selector: directQuery.selector.raw, |
| 288 | matches: 1, |
| 289 | selectorChain: [directQuery.selector.raw], |
| 290 | } |
| 291 | : buildDirectIosIsResult( |
| 292 | predicate, |
| 293 | expectedText, |
| 294 | directQuery.selector.raw, |
| 295 | directQuery.session, |
| 296 | directQuery.result.node, |
| 297 | ); |
| 298 | if (!payload) return null; |
| 299 | recordIfSession(params.sessionStore, params.sessionName, params.req, payload); |
| 300 | return { ok: true, data: stripSelectorChain(payload) }; |
| 301 | } |
| 302 | |
| 303 | async function dispatchDirectIosSelectorWait( |
| 304 | params: SelectorRuntimeParams & { |
no test coverage detected