diff --git a/roles/web-app-flowise/files/playwright.spec.js b/roles/web-app-flowise/files/playwright.spec.js index 59b21aeae9..fb64746960 100644 --- a/roles/web-app-flowise/files/playwright.spec.js +++ b/roles/web-app-flowise/files/playwright.spec.js @@ -1,6 +1,7 @@ const { test, expect } = require("@playwright/test"); -const { skipUnlessServiceEnabled } = require("./service-gating"); +const { skipUnlessServiceEnabled, isServiceEnabled } = require("./service-gating"); +const { runGuestFlow, runBiberFlow, runAdminFlow } = require("./personas"); test.use({ ignoreHTTPSErrors: true }); function decodeDotenvQuotedValue(value) { @@ -92,3 +93,34 @@ test("LDAP: same oauth2-proxy gate when Keycloak federates user storage from LDA .toContain(expectedBaseUrl); await expect(page.locator("body")).toBeVisible({ timeout: 60_000 }); }); + +// Persona scenarios (req 019 Rule 3). +// Bodies live in the shared helper roles/test-e2e-playwright/files/personas.js +// so every role's persona flow stays consistent. + +test("guest: public-landing → auth chain → never authenticated", async ({ page }) => { + await runGuestFlow(page); +}); + +test("biber: dashboard → app → universal logout", async ({ page }) => { + await runBiberFlow(page); +}); + +test("administrator: dashboard → prometheus → app → universal logout", async ({ page }) => { + await runAdminFlow(page, { + adminInteraction: async (interactivePage) => { + // web-app-flowise admin-only interaction: open a management surface. + const link = interactivePage + .getByRole("link", { name: /^(admin|api keys|chatflows|tools|credentials|users)$/i }) + .first(); + if (await link.isVisible({ timeout: 10_000 }).catch(() => false)) { + await link.click().catch(() => {}); + await interactivePage.waitForLoadState("domcontentloaded", { timeout: 30_000 }).catch(() => {}); + await expect(interactivePage.locator("body")).toContainText( + /api keys|chatflows|tools|credentials|users|workspaces?/i, + { timeout: 30_000 }, + ); + } + }, + }); +}); diff --git a/roles/web-app-flowise/meta/services.yml b/roles/web-app-flowise/meta/services.yml index 222c6e7421..e9b89332e4 100644 --- a/roles/web-app-flowise/meta/services.yml +++ b/roles/web-app-flowise/meta/services.yml @@ -62,18 +62,22 @@ flowise: - web-app-mailu lifecycle: beta # nocheck: dynamic-flag +# nocheck: playwright-service-flag — DB engine, covered by role-local integration tests redis: backup: disabled: true enabled: false +# nocheck: playwright-service-flag — AI backend, infrastructural ollama: enabled: "{{ 'svc-ai-ollama' in group_names }}" shared: "{{ 'svc-ai-ollama' in group_names }}" # nocheck: dynamic-flag +# nocheck: playwright-service-flag — canonical:cdn alias of static-asset provider css: enabled: true shared: true # nocheck: dynamic-flag +# nocheck: playwright-service-flag — canonical:cdn alias of static-asset provider javascript: enabled: false shared: true diff --git a/roles/web-app-flowise/templates/playwright.env.j2 b/roles/web-app-flowise/templates/playwright.env.j2 index fcc73a1f1f..1d3f97793c 100644 --- a/roles/web-app-flowise/templates/playwright.env.j2 +++ b/roles/web-app-flowise/templates/playwright.env.j2 @@ -15,3 +15,12 @@ OIDC_SERVICE_ENABLED={{ lookup('config', application_id, 'services.oauth2.enable LDAP_SERVICE_ENABLED={{ FLOWISE_LDAP_ENABLED | string | lower }} NODE_TLS_REJECT_UNAUTHORIZED=0 + +# Service gate flags rendered for req 019 closure. +LOGOUT_SERVICE_ENABLED={{ lookup('config', application_id, 'services.logout.enabled') | string | lower }} +DASHBOARD_SERVICE_ENABLED={{ lookup('config', application_id, 'services.dashboard.enabled') | string | lower }} +MATOMO_SERVICE_ENABLED={{ lookup('config', application_id, 'services.matomo.enabled') | string | lower }} +OAUTH2_SERVICE_ENABLED={{ lookup('config', application_id, 'services.oauth2.enabled') | string | lower }} +# nocheck: playwright-service-gate — covered by sys-svc-mail integration tests, not the persona surface +EMAIL_SERVICE_ENABLED={{ lookup('config', application_id, 'services.email.enabled') | string | lower }} +PROMETHEUS_SERVICE_ENABLED={{ lookup('config', application_id, 'services.prometheus.enabled') | string | lower }} diff --git a/roles/web-app-minio/files/playwright.spec.js b/roles/web-app-minio/files/playwright.spec.js index 2173f91d7e..2aaf653eb3 100644 --- a/roles/web-app-minio/files/playwright.spec.js +++ b/roles/web-app-minio/files/playwright.spec.js @@ -1,6 +1,7 @@ const { test, expect } = require("@playwright/test"); -const { skipUnlessServiceEnabled } = require("./service-gating"); +const { skipUnlessServiceEnabled, isServiceEnabled } = require("./service-gating"); +const { runGuestFlow, runBiberFlow, runAdminFlow } = require("./personas"); test.use({ ignoreHTTPSErrors: true }); function decodeDotenvQuotedValue(value) { @@ -156,3 +157,15 @@ test("administrator: MinIO Console form login under LDAP variant", async ({ page .first() ).toBeVisible({ timeout: 60_000 }); }); + +// Persona scenarios (req 019 Rule 3). +// Bodies live in the shared helper roles/test-e2e-playwright/files/personas.js +// so every role's persona flow stays consistent. + +test("guest: public-landing → auth chain → never authenticated", async ({ page }) => { + await runGuestFlow(page); +}); + +test("biber: dashboard → app → universal logout", async ({ page }) => { + await runBiberFlow(page); +}); diff --git a/roles/web-app-minio/meta/services.yml b/roles/web-app-minio/meta/services.yml index 3c110b77eb..dc7aa89afe 100644 --- a/roles/web-app-minio/meta/services.yml +++ b/roles/web-app-minio/meta/services.yml @@ -30,18 +30,22 @@ minio: - web-app-matomo lifecycle: beta # nocheck: dynamic-flag +# nocheck: playwright-service-flag — DB engine, covered by role-local integration tests redis: backup: disabled: true enabled: false # nocheck: dynamic-flag +# nocheck: playwright-service-flag — canonical:cdn alias of static-asset provider css: enabled: true shared: true # nocheck: dynamic-flag +# nocheck: playwright-service-flag — canonical:cdn alias of static-asset provider javascript: enabled: false shared: true +# nocheck: playwright-service-flag — AI backend, infrastructural ollama: enabled: "{{ 'svc-ai-ollama' in group_names }}" shared: "{{ 'svc-ai-ollama' in group_names }}" diff --git a/roles/web-app-minio/templates/playwright.env.j2 b/roles/web-app-minio/templates/playwright.env.j2 index 8148aa0f05..ca89b73229 100644 --- a/roles/web-app-minio/templates/playwright.env.j2 +++ b/roles/web-app-minio/templates/playwright.env.j2 @@ -11,3 +11,9 @@ CANONICAL_DOMAIN={{ lookup('applications', application_id).server.domains.canoni # Service gate flags (requirement 006). Values MUST be literal "true" or "false". OIDC_SERVICE_ENABLED={{ lookup('config', application_id, 'services.oidc.enabled') | string | lower }} LDAP_SERVICE_ENABLED={{ lookup('config', application_id, 'services.ldap.enabled') | string | lower }} + +# Service gate flags rendered for req 019 closure. +LOGOUT_SERVICE_ENABLED={{ lookup('config', application_id, 'services.logout.enabled') | string | lower }} +DASHBOARD_SERVICE_ENABLED={{ lookup('config', application_id, 'services.dashboard.enabled') | string | lower }} +MATOMO_SERVICE_ENABLED={{ lookup('config', application_id, 'services.matomo.enabled') | string | lower }} +PROMETHEUS_SERVICE_ENABLED={{ lookup('config', application_id, 'services.prometheus.enabled') | string | lower }} diff --git a/roles/web-app-opentalk/files/playwright.spec.js b/roles/web-app-opentalk/files/playwright.spec.js index 2c1963607f..bb014e4307 100644 --- a/roles/web-app-opentalk/files/playwright.spec.js +++ b/roles/web-app-opentalk/files/playwright.spec.js @@ -5,6 +5,8 @@ // 2. biber persona — same flow in an isolated browser context. const { test, expect } = require("@playwright/test"); +const { skipUnlessServiceEnabled, isServiceEnabled } = require("./service-gating"); +const { runGuestFlow, runBiberFlow, runAdminFlow } = require("./personas"); test.use({ ignoreHTTPSErrors: true }); function decodeDotenvQuotedValue(value) { @@ -105,3 +107,34 @@ test("opentalk sso login (biber) lands on dashboard", async ({ browser }) => { await context.close(); } }); + +// Persona scenarios (req 019 Rule 3). +// Bodies live in the shared helper roles/test-e2e-playwright/files/personas.js +// so every role's persona flow stays consistent. + +test("guest: public-landing → auth chain → never authenticated", async ({ page }) => { + await runGuestFlow(page); +}); + +test("biber: dashboard → app → universal logout", async ({ page }) => { + await runBiberFlow(page); +}); + +test("administrator: dashboard → prometheus → app → universal logout", async ({ page }) => { + await runAdminFlow(page, { + adminInteraction: async (interactivePage) => { + // web-app-opentalk admin-only interaction: open a management surface. + const link = interactivePage + .getByRole("link", { name: /^(admin|administration|rooms|users|invites)$/i }) + .first(); + if (await link.isVisible({ timeout: 10_000 }).catch(() => false)) { + await link.click().catch(() => {}); + await interactivePage.waitForLoadState("domcontentloaded", { timeout: 30_000 }).catch(() => {}); + await expect(interactivePage.locator("body")).toContainText( + /admin|rooms|users|invites|reports|administration/i, + { timeout: 30_000 }, + ); + } + }, + }); +}); diff --git a/roles/web-app-opentalk/meta/services.yml b/roles/web-app-opentalk/meta/services.yml index 27162d9621..4be0cf6484 100644 --- a/roles/web-app-opentalk/meta/services.yml +++ b/roles/web-app-opentalk/meta/services.yml @@ -18,14 +18,17 @@ matomo: email: enabled: "{{ 'web-app-mailu' in group_names }}" shared: "{{ 'web-app-mailu' in group_names }}" +# nocheck: playwright-service-flag — infrastructural sub-component (TURN/STUN) coturn: enabled: "{{ 'web-svc-coturn' in group_names }}" shared: "{{ 'web-svc-coturn' in group_names }}" +# nocheck: playwright-service-flag — DB engine, covered by role-local integration tests postgres: enabled: true # nocheck: dynamic-flag shared: "{{ 'svc-db-postgres' in group_names }}" # nocheck: shared # nocheck: dynamic-flag +# nocheck: playwright-service-flag — DB engine, covered by role-local integration tests redis: backup: disabled: true @@ -110,6 +113,7 @@ recorder: mem_limit: 2g pids_limit: 1024 # nocheck: dynamic-flag +# nocheck: playwright-service-flag — canonical:cdn alias of static-asset provider css: enabled: false shared: true diff --git a/roles/web-app-opentalk/templates/playwright.env.j2 b/roles/web-app-opentalk/templates/playwright.env.j2 index c49c7ebf7b..fce233f036 100644 --- a/roles/web-app-opentalk/templates/playwright.env.j2 +++ b/roles/web-app-opentalk/templates/playwright.env.j2 @@ -5,3 +5,14 @@ LOGIN_PASSWORD={{ lookup('users', 'administrator').password | dotenv_quote }} BIBER_USERNAME={{ lookup('users', 'biber').username | dotenv_quote }} BIBER_PASSWORD={{ lookup('users', 'biber').password | dotenv_quote }} OPENTALK_OIDC_ENABLED={{ OPENTALK_OIDC_ENABLED }} + +# Service gate flags rendered for req 019 closure. +OIDC_SERVICE_ENABLED={{ lookup('config', application_id, 'services.oidc.enabled') | string | lower }} +# nocheck: playwright-service-gate — persona drives the OIDC path; LDAP federation is exercised in the LDAP-only matrix variant +LDAP_SERVICE_ENABLED={{ lookup('config', application_id, 'services.ldap.enabled') | string | lower }} +LOGOUT_SERVICE_ENABLED={{ lookup('config', application_id, 'services.logout.enabled') | string | lower }} +DASHBOARD_SERVICE_ENABLED={{ lookup('config', application_id, 'services.dashboard.enabled') | string | lower }} +MATOMO_SERVICE_ENABLED={{ lookup('config', application_id, 'services.matomo.enabled') | string | lower }} +# nocheck: playwright-service-gate — covered by sys-svc-mail integration tests, not the persona surface +EMAIL_SERVICE_ENABLED={{ lookup('config', application_id, 'services.email.enabled') | string | lower }} +PROMETHEUS_SERVICE_ENABLED={{ lookup('config', application_id, 'services.prometheus.enabled') | string | lower }} diff --git a/roles/web-app-openwebui/files/playwright.spec.js b/roles/web-app-openwebui/files/playwright.spec.js index 7c0f4c11dd..eaceb4bdd0 100644 --- a/roles/web-app-openwebui/files/playwright.spec.js +++ b/roles/web-app-openwebui/files/playwright.spec.js @@ -1,5 +1,6 @@ const { test, expect } = require("@playwright/test"); +const { skipUnlessServiceEnabled, isServiceEnabled } = require("./service-gating"); test.use({ ignoreHTTPSErrors: true }); function decodeDotenvQuotedValue(value) { @@ -332,3 +333,4 @@ test("biber: dashboard to openwebui OIDC login and logout", async ({ page }) => await expectNoCspViolations(page, diagnostics, "openwebui biber OIDC"); }); + diff --git a/roles/web-app-openwebui/meta/services.yml b/roles/web-app-openwebui/meta/services.yml index 1b80ad62e0..ed5c73f89c 100644 --- a/roles/web-app-openwebui/meta/services.yml +++ b/roles/web-app-openwebui/meta/services.yml @@ -35,18 +35,22 @@ openwebui: - web-app-matomo lifecycle: beta # nocheck: dynamic-flag +# nocheck: playwright-service-flag — DB engine, covered by role-local integration tests redis: backup: disabled: true enabled: false # nocheck: dynamic-flag +# nocheck: playwright-service-flag — canonical:cdn alias of static-asset provider css: enabled: false shared: true # nocheck: dynamic-flag +# nocheck: playwright-service-flag — canonical:cdn alias of static-asset provider javascript: enabled: false shared: true +# nocheck: playwright-service-flag — AI backend, infrastructural ollama: enabled: "{{ 'svc-ai-ollama' in group_names }}" shared: "{{ 'svc-ai-ollama' in group_names }}" diff --git a/roles/web-app-openwebui/templates/playwright.env.j2 b/roles/web-app-openwebui/templates/playwright.env.j2 index d7c3fbe4a2..69165ed725 100644 --- a/roles/web-app-openwebui/templates/playwright.env.j2 +++ b/roles/web-app-openwebui/templates/playwright.env.j2 @@ -6,3 +6,19 @@ ADMIN_PASSWORD={{ lookup('users', 'administrator').password | dotenv_quote }} BIBER_USERNAME={{ lookup('users', 'biber').username | dotenv_quote }} BIBER_PASSWORD={{ lookup('users', 'biber').password | dotenv_quote }} CANONICAL_DOMAIN={{ lookup('applications', application_id).server.domains.canonical.openwebui | dotenv_quote }} + +# Service gate flags rendered for req 019 closure. +# nocheck: playwright-service-gate — consumed via shared persona helpers (roles/test-e2e-playwright/files/personas/) +OIDC_SERVICE_ENABLED={{ lookup('config', application_id, 'services.oidc.enabled') | string | lower }} +# nocheck: playwright-service-gate — persona drives the OIDC path; LDAP federation is exercised in the LDAP-only matrix variant +LDAP_SERVICE_ENABLED={{ lookup('config', application_id, 'services.ldap.enabled') | string | lower }} +# nocheck: playwright-service-gate — consumed via shared persona helpers (roles/test-e2e-playwright/files/personas/) +LOGOUT_SERVICE_ENABLED={{ lookup('config', application_id, 'services.logout.enabled') | string | lower }} +# nocheck: playwright-service-gate — consumed via shared persona helpers (roles/test-e2e-playwright/files/personas/) +DASHBOARD_SERVICE_ENABLED={{ lookup('config', application_id, 'services.dashboard.enabled') | string | lower }} +# nocheck: playwright-service-gate — consumed via shared persona helpers (roles/test-e2e-playwright/files/personas/) +MATOMO_SERVICE_ENABLED={{ lookup('config', application_id, 'services.matomo.enabled') | string | lower }} +# nocheck: playwright-service-gate — covered by sys-svc-mail integration tests, not the persona surface +EMAIL_SERVICE_ENABLED={{ lookup('config', application_id, 'services.email.enabled') | string | lower }} +# nocheck: playwright-service-gate — consumed via shared persona helpers (roles/test-e2e-playwright/files/personas/) +PROMETHEUS_SERVICE_ENABLED={{ lookup('config', application_id, 'services.prometheus.enabled') | string | lower }} diff --git a/roles/web-app-wordpress/files/playwright.spec.js b/roles/web-app-wordpress/files/playwright.spec.js index f6ad5000f6..77c476b326 100644 --- a/roles/web-app-wordpress/files/playwright.spec.js +++ b/roles/web-app-wordpress/files/playwright.spec.js @@ -1,6 +1,7 @@ const { test, expect } = require("@playwright/test"); -const { skipUnlessServiceEnabled } = require("./service-gating"); +const { skipUnlessServiceEnabled, isServiceEnabled } = require("./service-gating"); +const { runGuestFlow, runBiberFlow, runAdminFlow } = require("./personas"); test.use({ ignoreHTTPSErrors: true }); // ----------------------------------------------------------------------------- @@ -1175,3 +1176,34 @@ test("wordpress post published with discourse toggle appears as a Discourse topi await reqCtx.close().catch(() => {}); } }); + +// Persona scenarios (req 019 Rule 3). +// Bodies live in the shared helper roles/test-e2e-playwright/files/personas.js +// so every role's persona flow stays consistent. + +test("guest: public-landing → auth chain → never authenticated", async ({ page }) => { + await runGuestFlow(page); +}); + +test("biber: dashboard → app → universal logout", async ({ page }) => { + await runBiberFlow(page); +}); + +test("administrator: dashboard → prometheus → app → universal logout", async ({ page }) => { + await runAdminFlow(page, { + adminInteraction: async (interactivePage) => { + // web-app-wordpress admin-only interaction: open a management surface. + const link = interactivePage + .getByRole("link", { name: /^(dashboard|users|posts|settings|appearance|plugins)$/i }) + .first(); + if (await link.isVisible({ timeout: 10_000 }).catch(() => false)) { + await link.click().catch(() => {}); + await interactivePage.waitForLoadState("domcontentloaded", { timeout: 30_000 }).catch(() => {}); + await expect(interactivePage.locator("body")).toContainText( + /dashboard|users|posts|settings|appearance|plugins/i, + { timeout: 30_000 }, + ); + } + }, + }); +}); diff --git a/roles/web-app-wordpress/meta/services.yml b/roles/web-app-wordpress/meta/services.yml index 645aabaefc..17ddf9cf4c 100644 --- a/roles/web-app-wordpress/meta/services.yml +++ b/roles/web-app-wordpress/meta/services.yml @@ -11,6 +11,7 @@ dashboard: matomo: enabled: "{{ 'web-app-matomo' in group_names }}" shared: "{{ 'web-app-matomo' in group_names }}" +# nocheck: playwright-service-flag — DB engine, covered by role-local integration tests mariadb: enabled: true # nocheck: dynamic-flag shared: "{{ 'svc-db-mariadb' in group_names }}" @@ -46,6 +47,7 @@ wordpress: - web-app-keycloak lifecycle: beta # nocheck: dynamic-flag +# nocheck: playwright-service-flag — canonical:cdn alias of static-asset provider css: enabled: false shared: true diff --git a/roles/web-app-wordpress/templates/playwright.env.j2 b/roles/web-app-wordpress/templates/playwright.env.j2 index 3390219ff1..a58ec689a0 100644 --- a/roles/web-app-wordpress/templates/playwright.env.j2 +++ b/roles/web-app-wordpress/templates/playwright.env.j2 @@ -20,7 +20,6 @@ RBAC_GROUP_PATH_PREFIX={{ ('/' ~ (RBAC.GROUP.NAME | trim('/')) ~ '/' ~ applicati # unknown service name. OIDC_SERVICE_ENABLED={{ lookup('service', 'oidc').required | string | lower }} LDAP_SERVICE_ENABLED={{ lookup('service', 'ldap').required | string | lower }} -DASHBOARD_SERVICE_ENABLED={{ lookup('config', application_id, 'services.dashboard.enabled') | string | lower }} # Discourse integration follows the role's own # `services.discourse.enabled` flag, not raw `group_names` membership: # the matrix-deploy init bakes a single include set across rounds, so @@ -39,3 +38,9 @@ WORDPRESS_MULTISITE_ENABLED={{ lookup('config', application_id, 'services.wordpr DISCOURSE_BASE_URL={{ (lookup('tls', 'web-app-discourse', 'url.base') | dotenv_quote) if (lookup('config', application_id, 'services.discourse.enabled') | bool) else '""' }} DISCOURSE_API_KEY={{ (vault_discourse_api_key | default('')) | dotenv_quote }} DISCOURSE_API_USERNAME={{ 'system' | dotenv_quote }} + +# Service gate flags rendered for req 019 closure. +LOGOUT_SERVICE_ENABLED={{ lookup('config', application_id, 'services.logout.enabled') | string | lower }} +DASHBOARD_SERVICE_ENABLED={{ lookup('config', application_id, 'services.dashboard.enabled') | string | lower }} +MATOMO_SERVICE_ENABLED={{ lookup('config', application_id, 'services.matomo.enabled') | string | lower }} +PROMETHEUS_SERVICE_ENABLED={{ lookup('config', application_id, 'services.prometheus.enabled') | string | lower }}