diff --git a/roles/web-app-bigbluebutton/files/playwright.spec.js b/roles/web-app-bigbluebutton/files/playwright.spec.js index fa80e91e7c..c4bed6edcc 100644 --- a/roles/web-app-bigbluebutton/files/playwright.spec.js +++ b/roles/web-app-bigbluebutton/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) { @@ -237,3 +238,4 @@ test("biber: dashboard to bigbluebutton OIDC login and logout", async ({ page }) await assertLoggedOut(page, bbbBaseUrl, "biber"); await expectNoCspViolations(page, diagnostics, "bigbluebutton biber OIDC"); }); + diff --git a/roles/web-app-bigbluebutton/meta/services.yml b/roles/web-app-bigbluebutton/meta/services.yml index 5227663036..839f97b811 100644 --- a/roles/web-app-bigbluebutton/meta/services.yml +++ b/roles/web-app-bigbluebutton/meta/services.yml @@ -41,20 +41,25 @@ bigbluebutton: - web-app-keycloak lifecycle: beta # nocheck: dynamic-flag +# nocheck: playwright-service-flag — DB engine, covered by role-local integration tests postgres: shared: false enabled: true # nocheck: dynamic-flag +# nocheck: playwright-service-flag — internal sub-component (multi-entity role) greenlight: enabled: true shared: false +# nocheck: playwright-service-flag — infrastructural sub-component (TURN/STUN) coturn: shared: "{{ 'web-svc-coturn' in group_names }}" enabled: "{{ 'web-svc-coturn' in group_names }}" +# nocheck: playwright-service-flag — infrastructural sub-component (collaborative editing) collabora: shared: "{{ 'web-svc-collabora' in group_names }}" enabled: "{{ 'web-svc-collabora' in group_names }}" # nocheck: dynamic-flag +# nocheck: playwright-service-flag — canonical:cdn alias of static-asset provider css: enabled: true shared: true diff --git a/roles/web-app-bigbluebutton/templates/playwright.env.j2 b/roles/web-app-bigbluebutton/templates/playwright.env.j2 index a15f31da8a..8de25425f9 100644 --- a/roles/web-app-bigbluebutton/templates/playwright.env.j2 +++ b/roles/web-app-bigbluebutton/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 | first) | 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 — 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 — 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/) +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-fediwall/files/playwright.spec.js b/roles/web-app-fediwall/files/playwright.spec.js index 04bcc62569..4378638eed 100644 --- a/roles/web-app-fediwall/files/playwright.spec.js +++ b/roles/web-app-fediwall/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) { @@ -350,3 +351,34 @@ test("each wall surfaces biber's posts according to its servers list", async ({ } } }); + +// 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-fediwall admin-only interaction: open a management surface. + const link = interactivePage + .getByRole("link", { name: /^(admin|configuration|settings)$/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( + /configuration|admin|fediwall|settings/i, + { timeout: 30_000 }, + ); + } + }, + }); +}); diff --git a/roles/web-app-fediwall/meta/services.yml b/roles/web-app-fediwall/meta/services.yml index c2ec5d7b72..6c12ddb15b 100644 --- a/roles/web-app-fediwall/meta/services.yml +++ b/roles/web-app-fediwall/meta/services.yml @@ -13,6 +13,7 @@ matomo: enabled: true shared: true # nocheck: dynamic-flag +# nocheck: playwright-service-flag — canonical:cdn alias of static-asset provider css: enabled: true shared: true diff --git a/roles/web-app-fediwall/templates/playwright.env.j2 b/roles/web-app-fediwall/templates/playwright.env.j2 index 7c40a6ba91..daf2249787 100644 --- a/roles/web-app-fediwall/templates/playwright.env.j2 +++ b/roles/web-app-fediwall/templates/playwright.env.j2 @@ -21,3 +21,13 @@ FRIENDICA_BASE_URL={{ lookup('tls', 'web-app-friendica', 'url.base') | dotenv_qu BIBER_USERNAME={{ lookup('users', 'biber').username | dotenv_quote }} BIBER_PASSWORD={{ lookup('users', 'biber').password | 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 }} +# 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 }} +OIDC_SERVICE_ENABLED={{ lookup('config', application_id, 'services.oidc.enabled') | string | lower }} +OAUTH2_SERVICE_ENABLED={{ lookup('config', application_id, 'services.oauth2.enabled') | string | lower }} +PROMETHEUS_SERVICE_ENABLED={{ lookup('config', application_id, 'services.prometheus.enabled') | string | lower }}