diff --git a/scripts/e2e.config.ts b/scripts/e2e.config.ts index 520fc8338d..b50faeafb9 100644 --- a/scripts/e2e.config.ts +++ b/scripts/e2e.config.ts @@ -2,7 +2,8 @@ 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 { defineEngine } from "e2e/engine"; import * as HostProcess from "@t3tools/shared/HostProcess"; import { createAgentDeviceClient } from "agent-device"; import type { E2EConfig } from "e2e"; @@ -129,12 +130,16 @@ const simlock = (device: string): DeviceProvider => { }; }; +const webEngine = web({ viewport: { width: 1280, height: 800 } }); +const { capabilities: _caps, ...webSpec } = webEngine; +const multiTabEngine = defineEngine({ ...webSpec, fixtures: { ...webEngine.fixtures, live: (context) => context.fixture("live", surfaceOf(webEngine)!, {}) } }); + export default { tests: "scenarios/**/*.e2e.ts", targets: [ { name: "web", - engine: web({ viewport: { width: 1280, height: 800 } }), + engine: multiTabEngine, app: { url: `http://${LOOPBACK}:0`, // Vite answers before the server does; this path is proxied to the server. @@ -175,7 +180,7 @@ export default { }, }, }, - ], + ].filter((target) => target.name === "web"), // One server holds every test's state, and a dev stack is heavy. workers: 1, timeout: 300_000,