From d82b8efdd74b3ffda3b6b436ac455e310762dd9e Mon Sep 17 00:00:00 2001 From: Frank Date: Mon, 2 Nov 2026 20:21:21 -0800 Subject: [PATCH] test(e2e): gate the Audiobookshelf SSO round trip end to end The service answers on a LAN address with no vhost, so it was in no guarded-vhost list and no spec touched it: every deploy gate passed while its login was dead. The gate signs in as qa-e2e-admin and asserts the two consumer-visible outcomes that the two defect classes break - every .js the SPA loads arrives as JavaScript (a bundle built for the wrong base path comes back text/html and boots nothing), and /api/me answers 200 with type 'admin' (true only while grant types, the OpenID scope mappings and the group claim all hold). Joined to the admin project, so it rides every deploy e2e gate. --- tests/e2e/playwright.config.ts | 5 +- tests/e2e/specs/23-audiobookshelf-sso.spec.ts | 92 +++++++++++++++++++ 2 files changed, 96 insertions(+), 1 deletion(-) create mode 100644 tests/e2e/specs/23-audiobookshelf-sso.spec.ts diff --git a/tests/e2e/playwright.config.ts b/tests/e2e/playwright.config.ts index 986b2e8..e0e1f3e 100644 --- a/tests/e2e/playwright.config.ts +++ b/tests/e2e/playwright.config.ts @@ -42,7 +42,10 @@ export default defineConfig({ }, { name: "admin", - testMatch: /11-.*\.spec\.ts/, + // 23- joins 2026-11-02 (Audiobookshelf SSO): it needs BOTH halves of the admin + // fixture — a live authentik session to ride the OIDC round trip, and the + // qa-e2e-admin group membership that grants site admin in the app. + testMatch: /(11|23)-.*\.spec\.ts/, use: { storageState: ".auth/qa-e2e-admin.json" }, dependencies: ["setup"], }, diff --git a/tests/e2e/specs/23-audiobookshelf-sso.spec.ts b/tests/e2e/specs/23-audiobookshelf-sso.spec.ts new file mode 100644 index 0000000..9dc341c --- /dev/null +++ b/tests/e2e/specs/23-audiobookshelf-sso.spec.ts @@ -0,0 +1,92 @@ +import { expect, test } from "@playwright/test"; + +// Audiobookshelf: the SSO round trip must land a session with a real permission level. +// +// The service answers on a LAN address with no DNS name and no Caddy vhost, so it is in no +// guarded-vhost list and no other spec ever fetched a byte of it — every deploy gate passed +// while its login was dead. Two defect classes, both caught live on 2026-11-02: +// +// 1. The bundle must be BUILT for /audiobookshelf (ROUTER_BASE_PATH in the quadlet). Built +// for "/" the container still answers /healthcheck and still serves index.html, so the +// deploy health gate is green while the browser sees a blank page: every