( params: SelectorRuntimeParams, session: SessionState, selector: DirectIosSelectorTarget, )
| 345 | } |
| 346 | |
| 347 | async function queryDirectIosSelector( |
| 348 | params: SelectorRuntimeParams, |
| 349 | session: SessionState, |
| 350 | selector: DirectIosSelectorTarget, |
| 351 | ): Promise<DirectIosSelectorQueryResult> { |
| 352 | const data = await runAppleRunnerCommand( |
| 353 | session.device, |
| 354 | { |
| 355 | command: 'querySelector', |
| 356 | selectorKey: selector.key, |
| 357 | selectorValue: selector.value, |
| 358 | appBundleId: session.appBundleId, |
| 359 | }, |
| 360 | buildAppleRunnerRequestOptions({ |
| 361 | req: params.req, |
| 362 | logPath: params.logPath, |
| 363 | traceLogPath: session.trace?.outPath, |
| 364 | }), |
| 365 | ); |
| 366 | const found = data.found === true; |
| 367 | const node = readDirectIosSelectorNode(data); |
| 368 | return { |
| 369 | found, |
| 370 | ...(typeof data.text === 'string' ? { text: data.text } : {}), |
| 371 | ...(node ? { node } : {}), |
| 372 | }; |
| 373 | } |
| 374 | |
| 375 | async function queryDirectIosSelectorOrFallback( |
| 376 | params: SelectorRuntimeParams, |
no test coverage detected