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

Function step

e2e/src/surfaces/browser.ts:269–286  ·  view source on GitHub ↗
(label: string, action: (page: Page) => Promise<void>)

Source from the content-addressed store, hash-verified

267 ({ page, context, shots }) =>
268 Effect.promise(async () => {
269 const step = async (label: string, action: (page: Page) => Promise<void>) => {
270 // Acting on the page IS focusing the browser window — and when
271 // filming, enterFocus lingers a beat on whatever the developer was
272 // looking at before tabbing here.
273 await enterFocus(dir, "browser");
274 await context.tracing.group(label);
275 try {
276 await action(page);
277 } finally {
278 await context.tracing.groupEnd();
279 }
280 await page.screenshot({
281 path: join(dir, `${String(shots.count++).padStart(2, "0")}-${slug(label)}.png`),
282 });
283 // Hold this step's result on screen so the film is readable (the
284 // consent screen, the success page, …). No-op unless filming.
285 await beat();
286 };
287 try {
288 await drive({ page, step });
289 } catch (error) {

Calls 5

enterFocusFunction · 0.90
beatFunction · 0.90
groupMethod · 0.80
groupEndMethod · 0.80
slugFunction · 0.70

Tested by 5

decideInBrowserFunction · 0.40
runScenarioFunction · 0.40
reconnectThroughUiFunction · 0.40