Files
computer-playbook/roles/web-app-hermes/files/playwright/test-guest.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

18 lines
829 B
JavaScript

const { test, expect } = require("@playwright/test");
const { resolveTimeout } = require("./timeouts");
exports.register = function (shared) {
test("guest: Hermes API server is healthy and refuses unauthenticated model listing", async ({ request }) => {
const health = await request.get(`${shared.env.baseUrl}/health`, { timeout: resolveTimeout(30_000) });
expect(health.status(), "Expected the Hermes /health endpoint to answer 200").toBe(200);
const body = await health.json();
expect(body.status, "Expected /health to report an ok status").toBe("ok");
const models = await request.get(`${shared.env.baseUrl}/v1/models`, { timeout: resolveTimeout(30_000) });
expect(
models.status(),
"Expected /v1/models without a bearer key to be rejected",
).toBeGreaterThanOrEqual(400);
});
};