MCPcopy Index your code
hub / github.com/NativeScript/SimDeck / expectElementContains

Function expectElementContains

scripts/integration/js-api.mjs:351–368  ·  view source on GitHub ↗
(selector, text, options = {})

Source from the content-addressed store, hash-verified

349}
350
351async function expectElementContains(selector, text, options = {}) {
352 const deadline = Date.now() + (options.timeoutMs ?? 15_000);
353 let last = "";
354 while (Date.now() < deadline) {
355 const matches = await session.query(simulatorUDID, selector, {
356 source: "native-ax",
357 maxDepth: 3,
358 });
359 last = JSON.stringify(matches);
360 if (last.includes(text)) {
361 return;
362 }
363 await sleep(250);
364 }
365 throw new Error(
366 `Timed out waiting for fixture text ${JSON.stringify(text)}: ${last}`,
367 );
368}
369
370async function resolveKnownSystemPrompts(label) {
371 await resolveOpenUrlPrompt(label);

Callers 1

expectFixtureTextFunction · 0.85

Calls 2

queryMethod · 0.80
sleepFunction · 0.70

Tested by

no test coverage detected