MCPcopy Index your code
hub / github.com/tinyplex/tinybase / expectedElement

Function expectedElement

test/e2e/common.ts:63–80  ·  view source on GitHub ↗
(
  page: Page,
  selector: string,
  text?: string | RegExp,
  timeout = 5000,
)

Source from the content-addressed store, hash-verified

61 });
62
63export const expectedElement = async (
64 page: Page,
65 selector: string,
66 text?: string | RegExp,
67 timeout = 5000,
68): Promise<Locator> => {
69 const locator = page.locator(selector);
70
71 if (text) {
72 const filtered = locator.filter({hasText: text}).first();
73 await expect(filtered).toBeVisible({timeout});
74 return filtered;
75 }
76
77 const element = locator.first();
78 await expect(element).toBeVisible({timeout});
79 return element;
80};
81
82export const expectProperty = async (
83 element: Locator,

Calls

no outgoing calls

Tested by 1

expectDocShotFunction · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…