diff --git a/roles/test-e2e-playwright/files/personas/admin.js b/roles/test-e2e-playwright/files/personas/admin.js index 38b0071241..a92d064723 100644 --- a/roles/test-e2e-playwright/files/personas/admin.js +++ b/roles/test-e2e-playwright/files/personas/admin.js @@ -60,6 +60,7 @@ async function runAdminFlow(page, opts = {}) { safeIsEnabled("oauth2"); safeIsEnabled("logout"); safeIsEnabled("matomo"); + safeIsEnabled("dashboard"); const canonicalDomain = readEnv("CANONICAL_DOMAIN"); const appBaseUrl = normalizeUrl(process.env.APP_BASE_URL); @@ -81,6 +82,30 @@ async function runAdminFlow(page, opts = {}) { const oidcEnabled = safeIsEnabled("oidc"); + // The administrator journey relies on the OIDC login chain to + // authenticate; when OIDC is off, no Keycloak round-trip happens + // and the persona cannot reach an authenticated surface. + if (!oidcEnabled) { + test.skip( + true, + "administrator persona requires OIDC, but OIDC_SERVICE_ENABLED=false for this role.", + ); + return; + } + + // Dashboard vhost is purged between variants; skip before any I/O + // when APP_BASE_URL routes through a disabled dashboard frame. + if (new URL(appBaseUrl).hostname.toLowerCase().startsWith("dashboard.")) { + const dashboardEnabled = (process.env.DASHBOARD_SERVICE_ENABLED || "").toLowerCase(); + if (dashboardEnabled === "false") { + test.skip( + true, + "administrator persona collapsed: APP_BASE_URL routes via the dashboard frame but DASHBOARD_SERVICE_ENABLED=false for this variant.", + ); + return; + } + } + // Direct-app entry: bookmark-style navigation. The OAuth2-Proxy gate // fires on the first request, redirecting unauthenticated requests // to Keycloak; the auth chain is the same regardless of how the user diff --git a/roles/test-e2e-playwright/files/personas/biber.js b/roles/test-e2e-playwright/files/personas/biber.js index 417165e538..a9bf3aa624 100644 --- a/roles/test-e2e-playwright/files/personas/biber.js +++ b/roles/test-e2e-playwright/files/personas/biber.js @@ -60,6 +60,7 @@ async function runBiberFlow(page, opts = {}) { safeIsEnabled("oauth2"); safeIsEnabled("logout"); safeIsEnabled("matomo"); + safeIsEnabled("dashboard"); const canonicalDomain = readEnv("CANONICAL_DOMAIN"); const appBaseUrl = normalizeUrl(process.env.APP_BASE_URL); @@ -80,6 +81,19 @@ async function runBiberFlow(page, opts = {}) { await page.context().clearCookies(); + // Dashboard vhost is purged between variants; skip before any I/O + // when APP_BASE_URL routes through a disabled dashboard frame. + if (new URL(appBaseUrl).hostname.toLowerCase().startsWith("dashboard.")) { + const dashboardEnabled = (process.env.DASHBOARD_SERVICE_ENABLED || "").toLowerCase(); + if (dashboardEnabled === "false") { + test.skip( + true, + "biber persona collapsed: APP_BASE_URL routes via the dashboard frame but DASHBOARD_SERVICE_ENABLED=false for this variant.", + ); + return; + } + } + // Direct-app entry: bookmark-style navigation. The OAuth2-Proxy gate // fires on the first request, redirecting unauthenticated requests // to Keycloak; the auth chain is the same regardless of how the user @@ -88,6 +102,17 @@ async function runBiberFlow(page, opts = {}) { const oidcEnabled = safeIsEnabled("oidc"); + // The biber journey relies on the OIDC login chain to authenticate; + // when OIDC is off, no Keycloak round-trip happens and the persona + // cannot reach an authenticated surface. + if (!oidcEnabled) { + test.skip( + true, + "biber persona requires OIDC, but OIDC_SERVICE_ENABLED=false for this role.", + ); + return; + } + // Two auth shapes share a single login step: // * oauth2-proxy gate: the goto is intercepted and the page lands // directly on the Keycloak auth endpoint; perform Keycloak login. diff --git a/roles/test-e2e-playwright/files/personas/guest.js b/roles/test-e2e-playwright/files/personas/guest.js index 698b965c23..2294a9a310 100644 --- a/roles/test-e2e-playwright/files/personas/guest.js +++ b/roles/test-e2e-playwright/files/personas/guest.js @@ -42,6 +42,19 @@ async function runGuestFlow(page = {}) { return; } + // Dashboard vhost is purged between variants; skip before any I/O + // when APP_BASE_URL routes through a disabled dashboard frame. + if (new URL(appBaseUrl).hostname.toLowerCase().startsWith("dashboard.")) { + const dashboardEnabled = (process.env.DASHBOARD_SERVICE_ENABLED || "").toLowerCase(); + if (dashboardEnabled === "false") { + test.skip( + true, + "guest persona collapsed: APP_BASE_URL routes via the dashboard frame but DASHBOARD_SERVICE_ENABLED=false for this variant.", + ); + return; + } + } + test.setTimeout(60_000); const startUrl = appBaseUrl; diff --git a/roles/web-app-mailu/templates/playwright.env.j2 b/roles/web-app-mailu/templates/playwright.env.j2 index a880bdfc23..80ed1b6d54 100644 --- a/roles/web-app-mailu/templates/playwright.env.j2 +++ b/roles/web-app-mailu/templates/playwright.env.j2 @@ -26,3 +26,4 @@ MATOMO_BASE_URL={{ lookup('tls', 'web-app-matomo', 'url.base') | dotenv_quote }} OIDC_SERVICE_ENABLED={{ lookup('config', application_id, 'services.oidc.enabled') | string | lower }} LOGOUT_SERVICE_ENABLED={{ lookup('config', application_id, 'services.logout.enabled') | string | lower }} MATOMO_SERVICE_ENABLED={{ lookup('config', application_id, 'services.matomo.enabled') | string | lower }} +DASHBOARD_SERVICE_ENABLED={{ lookup('config', application_id, 'services.dashboard.enabled') | string | lower }}