Files
computer-playbook/roles/web-app-bluesky/files/playwright/test-baseline.js
kevinveenbirkenbachandClaude Opus 4.8 4c91df5de7 test(e2e): forbid raw page.goto, migrate all specs to Tor-resilient gotoOnion
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>
2026-07-08 20:59:38 +02:00

20 lines
904 B
JavaScript

const { test, expect } = require("@playwright/test");
const { gotoOnion } = require("./personas");
exports.register = function (shared) {
test("baseline: bluesky web UI responds on the canonical domain", async ({ page }) => {
// Liveness probe — passes regardless of whether the OIDC gate is
// active. The PDS XRPC layer at api.bluesky.<domain> is exercised
// by the OIDC scenario below (which uses the broker handoff to
// reach social-app via Keycloak).
const { baseUrl, canonicalDomain } = shared.env;
const response = await gotoOnion(page, `${baseUrl}/`);
expect(response, "Expected bluesky response").toBeTruthy();
expect(response.status(), "Expected bluesky status < 500").toBeLessThan(500);
expect(
response.url().includes(canonicalDomain),
`Expected canonical domain "${canonicalDomain}" to back the bluesky URL`,
).toBe(true);
});
};