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

Function step

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

Source from the content-addressed store, hash-verified

145 ({ page, context, shots }) =>
146 Effect.promise(async () => {
147 const step = async (label: string, action: (page: Page) => Promise<void>) => {
148 // Acting on the page IS focusing the browser window — and when
149 // filming, enterFocus lingers a beat on whatever the developer was
150 // looking at before tabbing here.
151 await enterFocus(dir, "browser");
152 await context.tracing.group(label);
153 try {
154 await action(page);
155 } finally {
156 await context.tracing.groupEnd();
157 }
158 await page.screenshot({
159 path: join(dir, `${String(shots.count++).padStart(2, "0")}-${slug(label)}.png`),
160 });
161 // Hold this step's result on screen so the film is readable (the
162 // consent screen, the success page, …). No-op unless filming.
163 await beat();
164 };
165 try {
166 await drive({ page, step });
167 } catch (error) {

Calls 5

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

Tested by 8

decideInBrowserFunction · 0.40
addSourceThroughConsoleFunction · 0.40
syncSourceInConsoleFunction · 0.40
runScenarioFunction · 0.40