MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / sample

Function sample

e2e/scenarios/artifact-loading-surface.test.ts:129–146  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

127 await page.addInitScript(() => {
128 globalThis.__loadingSamples = [];
129 const sample = () => {
130 const stage = document.querySelector<HTMLElement>(
131 '[data-testid="artifact-shell-container"], [data-slot="artifact-stage-skeleton"]',
132 );
133 const box = stage?.getBoundingClientRect();
134 globalThis.__loadingSamples?.push({
135 text: document.body?.innerText ?? "",
136 stage: box
137 ? {
138 x: Math.round(box.x),
139 y: Math.round(box.y),
140 w: Math.round(box.width),
141 h: Math.round(box.height),
142 }
143 : null,
144 });
145 globalThis.__loadingSampler = requestAnimationFrame(sample);
146 };
147 sample();
148 });
149};

Callers 1

startSamplingFunction · 0.85

Calls 1

pushMethod · 0.80

Tested by

no test coverage detected