diff --git a/src/browser/server.evaluate-disabled-does-not-block-storage.test.ts b/src/browser/server.evaluate-disabled-does-not-block-storage.test.ts index c7d3f6c952..03b10299db 100644 --- a/src/browser/server.evaluate-disabled-does-not-block-storage.test.ts +++ b/src/browser/server.evaluate-disabled-does-not-block-storage.test.ts @@ -4,6 +4,8 @@ import { afterEach, beforeEach, describe, expect, it, vi } from "vitest"; let testPort = 0; let prevGatewayPort: string | undefined; +let prevGatewayToken: string | undefined; +let prevGatewayPassword: string | undefined; const pwMocks = vi.hoisted(() => ({ cookiesGetViaPlaywright: vi.fn(async () => ({ @@ -82,6 +84,10 @@ describe("browser control evaluate gating", () => { testPort = await getFreePort(); prevGatewayPort = process.env.OPENCLAW_GATEWAY_PORT; process.env.OPENCLAW_GATEWAY_PORT = String(testPort - 2); + prevGatewayToken = process.env.OPENCLAW_GATEWAY_TOKEN; + prevGatewayPassword = process.env.OPENCLAW_GATEWAY_PASSWORD; + delete process.env.OPENCLAW_GATEWAY_TOKEN; + delete process.env.OPENCLAW_GATEWAY_PASSWORD; pwMocks.cookiesGetViaPlaywright.mockClear(); pwMocks.storageGetViaPlaywright.mockClear(); @@ -97,6 +103,16 @@ describe("browser control evaluate gating", () => { } else { process.env.OPENCLAW_GATEWAY_PORT = prevGatewayPort; } + if (prevGatewayToken === undefined) { + delete process.env.OPENCLAW_GATEWAY_TOKEN; + } else { + process.env.OPENCLAW_GATEWAY_TOKEN = prevGatewayToken; + } + if (prevGatewayPassword === undefined) { + delete process.env.OPENCLAW_GATEWAY_PASSWORD; + } else { + process.env.OPENCLAW_GATEWAY_PASSWORD = prevGatewayPassword; + } await stopBrowserControlServer(); });