diff --git a/scripts/e2e.config.ts b/scripts/e2e.config.ts index b3fd86e879..5efd4f5d6b 100644 --- a/scripts/e2e.config.ts +++ b/scripts/e2e.config.ts @@ -2,7 +2,7 @@ import * as NodeCrypto from "@effect/platform-node/NodeCrypto"; import * as NodeServices from "@effect/platform-node/NodeServices"; import { mobile, type DeviceProvider } from "@e2e-dev/mobile"; -import { web } from "@e2e-dev/web"; +import { web, surfaceOf } from "@e2e-dev/web"; import * as HostProcess from "@t3tools/shared/HostProcess"; import { createAgentDeviceClient } from "agent-device"; import type { E2EConfig } from "e2e"; @@ -147,12 +147,29 @@ const simlock = (device: string): DeviceProvider => { }; }; +// Evidence-only adapter: expose native middle-button input without changing app behavior. +function proofWeb() { + const engine = web({ viewport: { width: 1280, height: 800 } }); + return { + ...engine, + capabilities: new Set([...engine.capabilities, "proofInput"]), + fixtures: { + ...engine.fixtures, + proofInput: (context) => context.fixture("proofInput", { + async middleClick(name: string) { await surfaceOf(engine)!.page().getByRole("button", { name, exact: true }).click({ button: "middle" }); }, + async closePopups() { const live = surfaceOf(engine)!; for (const page of live.context().pages()) if (page !== live.page()) await page.close(); }, + async pause(ms: number) { await surfaceOf(engine)!.page().waitForTimeout(ms); }, + }, { middleClick: { kind: "resource", label: (selector) => selector }, pause: { kind: "resource" }, closePopups: { kind: "resource" } }), + }, + }; +} + export default { tests: "scenarios/**/*.e2e.ts", targets: [ { name: "web", - engine: web({ viewport: { width: 1280, height: 800 } }), + engine: proofWeb(), app: { url: `http://${LOOPBACK}:0`, // Lets a scenario put an image on the clipboard for a real keyboard paste.