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