mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2026-11-06 10:59:59 +00:00
New lint test_no_raw_goto.py forbids raw `page.goto(...)` in role playwright specs + persona flows (the gotoOnion wrapper in personas/utils is exempt) so navigation retries transient Tor-transport errors over onion. Migrates every raw call across ~75 roles (343 sites) to `gotoOnion(page, ...)` and teaches gotoOnion to detect relative onion URLs (`isOnionCanonical`). gotoOnion is a behaviour-identical drop-in on clearnet (single attempt, same return). Verified: no-raw-goto lint green, eslint 0 errors, make test green. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
22 lines
948 B
JavaScript
22 lines
948 B
JavaScript
const { test, expect } = require("@playwright/test");
|
|
const { decodeDotenvQuotedValue, normalizeBaseUrl, gotoOnion } = require("./personas");
|
|
|
|
const baseUrl = normalizeBaseUrl(process.env.FLOWISE_BASE_URL || "");
|
|
const canonicalDomain = decodeDotenvQuotedValue(process.env.CANONICAL_DOMAIN || "");
|
|
|
|
test.use({ ignoreHTTPSErrors: true });
|
|
|
|
test("baseline: Flowise responds on the canonical domain", async ({ page }) => {
|
|
expect(baseUrl, "FLOWISE_BASE_URL must be set").toBeTruthy();
|
|
expect(canonicalDomain, "CANONICAL_DOMAIN must be set").toBeTruthy();
|
|
await page.context().clearCookies();
|
|
|
|
const response = await gotoOnion(page, `${baseUrl}/`);
|
|
expect(response, "Expected Flowise response").toBeTruthy();
|
|
expect(response.status(), "Expected Flowise status < 500").toBeLessThan(500);
|
|
expect(
|
|
response.url().includes(canonicalDomain),
|
|
`Expected canonical domain "${canonicalDomain}" to back the Flowise URL`
|
|
).toBe(true);
|
|
});
|