Files
computer-playbook/roles/web-app-openclaw/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

19 lines
884 B
JavaScript

const { test, expect } = require("@playwright/test");
const { assertCspResponseHeader, assertCspMetaParity, gotoOnion } = require("./personas");
exports.register = function (shared) {
test("guest: OpenClaw dashboard reachable, serves CSP, never exposes an authenticated surface", async ({ page }) => {
const response = await gotoOnion(page, `${shared.env.baseUrl}/`);
expect(response, "Expected a OpenClaw dashboard response").toBeTruthy();
expect(response.status(), "Expected OpenClaw status to be < 400").toBeLessThan(400);
expect(
response.url().includes(shared.env.canonicalDomain),
`Expected canonical domain "${shared.env.canonicalDomain}" to back the OpenClaw URL`,
).toBe(true);
const directives = assertCspResponseHeader(response, "openclaw dashboard");
await assertCspMetaParity(page, directives, "openclaw dashboard");
});
};