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

Function dispatchDirectIosSelectorIs

src/daemon/selector-runtime.ts:271–301  ·  view source on GitHub ↗
(
  params: SelectorRuntimeParams,
  predicate: IsPredicate,
  selectorExpression: string,
  expectedText: string,
)

Source from the content-addressed store, hash-verified

269}
270
271async 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
303async function dispatchDirectIosSelectorWait(
304 params: SelectorRuntimeParams & {

Callers 1

dispatchIsViaRuntimeFunction · 0.85

Calls 5

recordIfSessionFunction · 0.90
stripSelectorChainFunction · 0.90
buildDirectIosIsResultFunction · 0.85

Tested by

no test coverage detected