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

Function decideInBrowser

e2e/scenarios/browser-approval.test.ts:64–80  ·  view source on GitHub ↗
(
  browser: BrowserSurface,
  identity: Identity,
  approval: McpBrowserApproval,
  decision: "Approve" | "Decline",
)

Source from the content-addressed store, hash-verified

62
63/** Open the console approval page as `identity` and click Approve or Decline. */
64const decideInBrowser = (
65 browser: BrowserSurface,
66 identity: Identity,
67 approval: McpBrowserApproval,
68 decision: "Approve" | "Decline",
69): Effect.Effect<void> =>
70 browser.session(identity, async ({ page, step }) => {
71 await step(
72 `Open the approval page and ${decision.toLowerCase()} the paused action`,
73 async () => {
74 await visit(page, approval.approvalUrl);
75 await page.getByRole("button", { name: decision }).click();
76 // The page confirms the decision was recorded ("Approve sent" / "Decline sent").
77 await page.getByText(`${decision} sent`).waitFor();
78 },
79 );
80 });
81
82scenario(
83 "MCP · a gated action approved in the browser runs to completion",

Callers 1

Calls 2

visitFunction · 0.90
stepFunction · 0.50

Tested by

no test coverage detected