Files
computer-playbook/roles/web-app-flowise/files/playwright/test-mcp.js
kevinveenbirkenbachandClaude Opus 5 27dcd975e5 test(e2e): scale the spec timeouts for onion transport
Twenty-five specs called the Playwright APIs with default or hardcoded
timeouts. Routed over Tor those budgets are too small, so a spec fails on
transport latency rather than on the behaviour it asserts.

Route the waits through resolveTimeout and reach pages via gotoOnion, the
helpers the tor branch introduced for exactly this. The remaining changes in
the diff are import wrapping around those calls.

The repository lint enforces this: a raw numeric timeout in a role spec is
rejected with a pointer to resolveTimeout, which is how a hardcoded 500ms
wait added during this session was caught.

Merge work rather than authored here; not deployed.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-28 12:52:19 +02:00

24 lines
898 B
JavaScript

const { test, expect } = require("@playwright/test");
const { resolveTimeout } = require("./timeouts");
const { skipUnlessServiceEnabled } = require("./service-gating");
const { normalizeBaseUrl } = require("./personas");
const baseUrl = normalizeBaseUrl(process.env.FLOWISE_BASE_URL || "");
test.use({ ignoreHTTPSErrors: true });
test("mcp: the instance exposes no MCP registry and refuses an unauthenticated caller", async ({ request }) => {
skipUnlessServiceEnabled("mcp");
expect(baseUrl, "FLOWISE_BASE_URL must be set").toBeTruthy();
const anonymous = await request.get(`${baseUrl.replace(/\/+$/, "")}/api/v1/chatflows`, {
failOnStatusCode: false,
maxRedirects: 0,
timeout: resolveTimeout(30_000),
});
expect(
anonymous.status(),
"an unauthenticated Flowise API call must be refused or redirected to SSO, never answered",
).toBeGreaterThanOrEqual(300);
});