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

Function sample

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

Source from the content-addressed store, hash-verified

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

Callers 1

startSamplingFunction · 0.85

Calls 1

pushMethod · 0.80

Tested by

no test coverage detected