e2e: Playwright suite for homepage + guard chain; RBAC gate on /admin; fix stale service links

This commit is contained in:
Frank committed 2026-09-01 16:42:33 -07:00
1 parent e513007aa4
commit dfd9c8d1c0
18 files changed
+497 -6

No files matched your search

+23
View File
@@ -0,0 +1,23 @@
import { expect, test } from "@playwright/test";
// Single-login enforcement: with ONLY the homepage session cookies, a direct
// visit to every outpost-guarded vhost must resolve through Anubis +
// authentik silently and land on the app — no login form, no challenge, no
// IdP error page. Exercises the provider the outpost actually carries
// (fixed 2026-09-01: loki/grafana/seerr were missing from the outpost M2M).
const GUARDED = ["search", "romm", "files", "seerr", "grafana", "prometheus", "loki"];
for (const host of GUARDED) {
test(`SSO passes silently for ${host}.franksdank.cloud`, async ({ page }) => {
await page.goto(`https://${host}.franksdank.cloud/`);
await expect
.poll(() => new URL(page.url()).hostname, { timeout: 60_000 })
.toBe(`${host}.franksdank.cloud`);
expect(await page.locator('input[name="uidField"]').count()).toBe(0);
const body = await page.locator("body").innerText();
expect(body).not.toContain("Making sure you're not a bot");
const resp = await page.request.get(page.url());
expect(resp.status()).toBeLessThan(500);
});
}