Update hivegrid-cloud reference to latest main

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
davidandClaude Fable 5 committed 2026-07-08 16:15:37 +02:00
1 parent e98d38e716
commit 7b21524c86
3781 files changed
+373484 -225607

No files matched your search

@@ -1,39 +0,0 @@
import { expect, test } from "./utils/test";
import { expectNoCriticalA11yViolations } from "./utils/axe";
import { getTenantCredentials, loginAsTenantUser } from "./utils/auth";
import { expectNoHorizontalOverflow, narrowMobileViewport } from "./utils/mobile";
import { escapeRegExp, skipIfUnavailable } from "./utils/navigation";
import { skipOrFailWhenE2eInputsMissing } from "./utils/readiness";
const credentials = getTenantCredentials();
const dashboardPath = process.env.E2E_TENANT_DASHBOARD_PATH;
const aiUsagePath = process.env.E2E_TENANT_AI_USAGE_PATH ?? deriveAiUsagePath(dashboardPath);
test.describe("tenant AI usage mobile a11y", () => {
test.use({ viewport: narrowMobileViewport, isMobile: true, hasTouch: true });
test.beforeEach(() => {
skipOrFailWhenE2eInputsMissing(["E2E_TENANT_EMAIL", "E2E_TENANT_PASSWORD", "E2E_TENANT_DASHBOARD_PATH"], "Tenant AI usage E2E inputs not configured");
});
test("renders quota and forecast without mobile overflow or critical a11y violations", async ({ page }) => {
await loginAsTenantUser(page, credentials!);
const response = await page.goto(aiUsagePath!, { waitUntil: "domcontentloaded" });
await skipIfUnavailable(page, response, `Tenant AI usage path ${aiUsagePath}`);
await expect(page).toHaveURL(new RegExp(`${escapeRegExp(aiUsagePath!)}(?:[?#].*)?$`, "u"));
await expect(page.locator("main").first()).toBeVisible();
await expect(page.getByRole("progressbar", { name: /AI quota usage|KI.*Nutzung/i })).toBeVisible();
await expect(page.getByRole("heading", { name: /End-of-month forecast|Prognose/i })).toBeVisible();
await expectNoHorizontalOverflow(page);
await expectNoCriticalA11yViolations(page);
});
});
function deriveAiUsagePath(path: string | undefined): string | undefined {
if (!path) return undefined;
const normalized = path.startsWith("/") ? path : `/${path}`;
return normalized.endsWith("/dashboard") ? normalized.replace(/\/dashboard$/u, "/settings/ai-usage") : undefined;
}
@@ -0,0 +1,36 @@
import { expect, test } from "./utils/test";
import { loginAsTenantUser } from "./utils/auth";
import { skipIfUnavailable } from "./utils/navigation";
import { skipOrFailWhenE2eInputsMissing } from "./utils/readiness";
/**
* Audit-Viewer-Smoke (AK-P3 / DoD D.19): Admin-Login -> /admin/audit oeffnen ->
* Interim-Screen (AD-28) sichtbar, Filter-Bar + Export-CTA vorhanden.
*
* Die Route ist permission-gegated (`admin.auditTrails.view`) und braucht den
* dedizierten OPERATOR-Admin-User (E2E_ADMIN_EMAIL/PASSWORD, siehe Seed) —
* der Admin-Login landet auf dem Admin-Host, dort ist die kanonische Route
* `/audit` (der host-aware Alias von `routes/admin/audit.tsx`; pfadbasiert
* existiert weiterhin `/admin/audit`, via E2E_ADMIN_AUDIT_PATH uebersteuerbar).
* Skippt ohne Credentials / wenn die Route im Environment nicht erreichbar ist.
* Nicht-mutierend: kein Export wird ausgeloest.
*/
const adminCredentials =
process.env.E2E_ADMIN_EMAIL && process.env.E2E_ADMIN_PASSWORD
? { email: process.env.E2E_ADMIN_EMAIL, password: process.env.E2E_ADMIN_PASSWORD }
: null;
const auditPath = process.env.E2E_ADMIN_AUDIT_PATH ?? "/audit";
test.describe("audit viewer smoke", () => {
test("renders the audit list with filter bar and export CTA", async ({ page }) => {
skipOrFailWhenE2eInputsMissing(["E2E_ADMIN_EMAIL", "E2E_ADMIN_PASSWORD"], "Audit smoke inputs not configured");
await loginAsTenantUser(page, adminCredentials!);
const response = await page.goto(auditPath, { waitUntil: "domcontentloaded" });
await skipIfUnavailable(page, response, "Audit path is not reachable in this environment");
await expect(page.locator('[data-ui-id="ui.audit.list"]')).toBeVisible();
await expect(page.locator('[data-ui-id="ui.audit.list.filter"]')).toBeVisible();
await expect(page.locator('[data-ui-id="ui.audit.list.export"]')).toBeVisible();
});
});
@@ -0,0 +1,28 @@
import { expect, test } from "./utils/test";
import { getTenantCredentials, loginAsTenantUser } from "./utils/auth";
import { skipIfUnavailable } from "./utils/navigation";
import { skipOrFailWhenE2eInputsMissing } from "./utils/readiness";
/**
* Booking smoke (AK-P16b / DoD D.19): Login -> /bookings oeffnen -> Liste sichtbar.
*
* Die Route ist modul-gegated (tenantHasModule "booking") + permission-gegated
* (bookings.read_own). Bei aktivem Modul + Berechtigung rendert sie die Buchungen-
* Liste mit `data-ui-id="ui.booking.list"`. Skippt ohne E2E-Credentials / wenn die
* Route im Environment nicht erreichbar ist (404 bei fehlendem Modul/Recht).
*/
const credentials = getTenantCredentials();
const dashboardPath = process.env.E2E_TENANT_DASHBOARD_PATH ?? "/app/dashboard";
const bookingsPath = process.env.E2E_TENANT_BOOKINGS_PATH ?? dashboardPath.replace(/\/dashboard\/?$/u, "/bookings");
test.describe("booking smoke", () => {
test("renders the bookings list", async ({ page }) => {
skipOrFailWhenE2eInputsMissing(["E2E_TENANT_EMAIL", "E2E_TENANT_PASSWORD"], "Booking smoke inputs not configured");
await loginAsTenantUser(page, credentials!);
const response = await page.goto(bookingsPath, { waitUntil: "domcontentloaded" });
await skipIfUnavailable(page, response, "Bookings path is not reachable in this environment");
await expect(page.locator('[data-ui-id="ui.booking.list"]')).toBeVisible();
});
});
@@ -0,0 +1,30 @@
import { expect, test } from "./utils/test";
import { getTenantCredentials, loginAsTenantUser } from "./utils/auth";
import { skipIfUnavailable } from "./utils/navigation";
import { skipOrFailWhenE2eInputsMissing } from "./utils/readiness";
/**
* Calendar smoke (AK-P16a / DoD D.19): Login -> /calendar oeffnen -> Ansicht
* sichtbar.
*
* Die Route ist modul-gegated (tenantHasModule "integrations" — Kalender ist eine
* Apps-Engine-Integration) + permission-gegated (calendar.connect_own). Bei aktivem
* Modul + Berechtigung rendert sie die Kalender-Ansicht mit
* `data-ui-id="ui.calendar.list"`. Skippt ohne E2E-Credentials / wenn die Route im
* Environment nicht erreichbar ist (404 bei fehlendem Modul/Recht).
*/
const credentials = getTenantCredentials();
const dashboardPath = process.env.E2E_TENANT_DASHBOARD_PATH ?? "/app/dashboard";
const calendarPath = process.env.E2E_TENANT_CALENDAR_PATH ?? dashboardPath.replace(/\/dashboard\/?$/u, "/calendar");
test.describe("calendar smoke", () => {
test("renders the calendar view", async ({ page }) => {
skipOrFailWhenE2eInputsMissing(["E2E_TENANT_EMAIL", "E2E_TENANT_PASSWORD"], "Calendar smoke inputs not configured");
await loginAsTenantUser(page, credentials!);
const response = await page.goto(calendarPath, { waitUntil: "domcontentloaded" });
await skipIfUnavailable(page, response, "Calendar path is not reachable in this environment");
await expect(page.locator('[data-ui-id="ui.calendar.list"]')).toBeVisible();
});
});
@@ -0,0 +1,42 @@
import { expect, test } from "./utils/test";
import { getTenantCredentials, loginAsTenantUser } from "./utils/auth";
import { skipIfUnavailable } from "./utils/navigation";
import { skipOrFailWhenE2eInputsMissing } from "./utils/readiness";
/**
* Email-Inbox smoke (VA-P23 / DoD D.19): Login -> /emails oeffnen -> Inbox
* sichtbar; Settings-Seite rendert die Connect-Flaechen.
*
* Beide Routen sind modul-gegated (tenantHasModule "email-inbox") + permission-
* gegated (email.read_own). Ohne verbundenes Postfach zeigt die Inbox den
* Klartext-Empty-State (kein Postfach verbunden) — auch das ist ein gueltiger
* Smoke-Durchlauf. Skippt ohne E2E-Credentials / wenn die Route im Environment
* nicht erreichbar ist (404 bei fehlendem Modul/Recht).
*/
const credentials = getTenantCredentials();
const dashboardPath = process.env.E2E_TENANT_DASHBOARD_PATH ?? "/app/dashboard";
const emailsPath = process.env.E2E_TENANT_EMAILS_PATH ?? dashboardPath.replace(/\/dashboard\/?$/u, "/emails");
const emailSettingsPath =
process.env.E2E_TENANT_EMAIL_SETTINGS_PATH ?? dashboardPath.replace(/\/dashboard\/?$/u, "/settings/integrations/email");
test.describe("email inbox smoke", () => {
test("renders the inbox list (or its Klartext no-mailbox state)", async ({ page }) => {
skipOrFailWhenE2eInputsMissing(["E2E_TENANT_EMAIL", "E2E_TENANT_PASSWORD"], "Email inbox smoke inputs not configured");
await loginAsTenantUser(page, credentials!);
const response = await page.goto(emailsPath, { waitUntil: "domcontentloaded" });
await skipIfUnavailable(page, response, "Emails path is not reachable in this environment");
await expect(page.locator('[data-ui-id="ui.email.inbox"]')).toBeVisible();
});
test("renders the mailbox connect settings", async ({ page }) => {
skipOrFailWhenE2eInputsMissing(["E2E_TENANT_EMAIL", "E2E_TENANT_PASSWORD"], "Email inbox smoke inputs not configured");
await loginAsTenantUser(page, credentials!);
const response = await page.goto(emailSettingsPath, { waitUntil: "domcontentloaded" });
await skipIfUnavailable(page, response, "Email settings path is not reachable in this environment");
await expect(page.locator('[data-ui-id="ui.email.settings"]')).toBeVisible();
});
});
@@ -0,0 +1,59 @@
import { expect, test } from "./utils/test";
import { getTenantCredentials, loginAsTenantUser } from "./utils/auth";
import { skipIfUnavailable } from "./utils/navigation";
import { skipOrFailWhenE2eInputsMissing } from "./utils/readiness";
/**
* Integrations-Smoke (R-P5 / DoD D.19): Login -> Integrations-Katalog oeffnen ->
* App-Karte (sample-data-sync) -> Connection-Verwaltung -> Connect-Wizard
* (A5-Dialog mit Stepper) oeffnet Schritt 1.
*
* Nicht-mutierend: der Wizard wird nur geoeffnet und wieder geschlossen, kein
* Submit. Skippt ohne E2E-Credentials / unerreichbare Routen (z.B. Modul aus).
*/
const credentials = getTenantCredentials();
const dashboardPath = process.env.E2E_TENANT_DASHBOARD_PATH;
const integrationsPath =
process.env.E2E_TENANT_INTEGRATIONS_PATH ?? (dashboardPath?.endsWith("/dashboard") ? dashboardPath.replace(/\/dashboard$/u, "/integrations") : undefined);
test.describe("integrations smoke (R-P5)", () => {
test.beforeEach(() => {
skipOrFailWhenE2eInputsMissing(["E2E_TENANT_EMAIL", "E2E_TENANT_PASSWORD", "E2E_TENANT_DASHBOARD_PATH"], "Integrations smoke inputs not configured");
});
test("opens the catalog, an app's connection management and the connect wizard", async ({ page }) => {
test.skip(!integrationsPath, "Integrations path not derivable from E2E_TENANT_DASHBOARD_PATH");
await loginAsTenantUser(page, credentials!);
const response = await page.goto(integrationsPath!, { waitUntil: "domcontentloaded" });
await skipIfUnavailable(page, response, `Integrations path ${integrationsPath}`);
await expect(page.locator('[data-ui-id="ui.integrations.catalog"]').first()).toBeVisible();
// Open the P5 reference app card (always in the code catalog).
const card = page.locator('[data-row-id="sample-data-sync"]').first();
if (!(await card.isVisible())) {
test.skip(true, "sample-data-sync card not visible (catalog empty for this tenant)");
}
await card.click();
await expect(page.locator('[data-ui-id="ui.integrations.app"]').first()).toBeVisible();
// Connect CTA opens the A5 wizard dialog (permission-gated; no submit).
const connect = page.locator('[data-ui-id="ui.integrations.app.connect"]').first();
if (await connect.isVisible()) {
await connect.click();
const wizard = page.locator('[data-ui-id="ui.integrations.app.wizard"]');
await expect(wizard).toBeVisible();
await expect(wizard.locator('[data-wizard-step="prerequisites"]')).toBeVisible();
await page.keyboard.press("Escape");
}
// Sync history of the first connection, if one exists (view_logs-gated).
const historyLink = page.locator('[data-ui-id="ui.integrations.app.connectionCard"] a').first();
if (await historyLink.isVisible()) {
await historyLink.click();
await expect(page.locator('[data-ui-id="ui.integrations.syncs"]').first()).toBeVisible();
}
});
});
@@ -0,0 +1,78 @@
import { expect, test } from "./utils/test";
import { getTenantCredentials, loginAsTenantUser, tenantRolesAndPermissionsPath, tenantSettingsMembersPath } from "./utils/auth";
import { skipIfUnavailable } from "./utils/navigation";
import { skipOrFailWhenE2eInputsMissing } from "./utils/readiness";
/**
* Members/Roles-Smoke (R-P2b / DoD D.19): Login -> Mitarbeiter oeffnen ->
* Hauptaktionen sichtbar (M03-Deaktivieren-Dialog aus dem Zeilenmenue bzw.
* M01-Einladen-Dialog); Rollen-Tab (S02) -> "Rolle anlegen" oeffnet den
* M04A-Basisdaten-Schritt und fuehrt in den M02-Editor.
*
* Nicht-mutierend: Dialoge werden nur geoeffnet und wieder geschlossen,
* kein Submit. Skippt ohne E2E-Credentials / unerreichbare Routen.
*/
const credentials = getTenantCredentials();
const dashboardPath = process.env.E2E_TENANT_DASHBOARD_PATH;
const membersPath = process.env.E2E_TENANT_MEMBERS_PATH ?? (dashboardPath ? tenantSettingsMembersPath(dashboardPath) : undefined);
const rolesAndPermissionsPath =
process.env.E2E_TENANT_ROLES_AND_PERMISSIONS_PATH ?? (dashboardPath ? tenantRolesAndPermissionsPath(dashboardPath) : undefined);
test.describe("members and roles smoke (R-P2b)", () => {
test.beforeEach(() => {
skipOrFailWhenE2eInputsMissing(["E2E_TENANT_EMAIL", "E2E_TENANT_PASSWORD", "E2E_TENANT_DASHBOARD_PATH"], "Members/roles smoke inputs not configured");
});
test("opens the members list and reaches the M03 deactivate dialog", async ({ page }) => {
await loginAsTenantUser(page, credentials!);
const response = await page.goto(membersPath!, { waitUntil: "domcontentloaded" });
await skipIfUnavailable(page, response, `Members path ${membersPath}`);
await expect(page.locator('[data-ui-id="ui.settings.members.page"]').first()).toBeVisible();
await expect(page.locator('[data-ui-id="ui.settings.members.table"]').first()).toBeVisible();
// Row menu -> Deaktivieren opens the M03 confirm dialog (no submit).
const rowActions = page.locator('[data-ui-id="ui.settings.members.rowActions"]').first();
if (await rowActions.isVisible()) {
await rowActions.click();
const deactivate = page.locator('[data-ui-id="ui.settings.members.menu.deactivate"]').first();
if (await deactivate.isVisible()) {
await deactivate.click();
await expect(page.locator('[data-ui-id="ui.settings.members.deactivate.dialog"]')).toBeVisible();
await page.locator('[data-ui-id="ui.settings.members.deactivate.cancel"]').click();
} else {
await page.keyboard.press("Escape");
}
}
// Invite CTA opens the M01 dialog route (permission-gated).
const invite = page.locator('[data-ui-id="ui.settings.members.invite"]').first();
if (await invite.isVisible()) {
await invite.click();
await expect(page.locator('[data-ui-id="ui.settings.members.new.form"]').first()).toBeVisible();
await page.locator('[data-ui-id="ui.settings.members.new.cancel"]').click();
}
});
test("opens the merged roles tab and reaches the M04A/M02 editor chain", async ({ page }) => {
await loginAsTenantUser(page, credentials!);
const response = await page.goto(`${rolesAndPermissionsPath!}/roles`, { waitUntil: "domcontentloaded" });
await skipIfUnavailable(page, response, `Roles path ${rolesAndPermissionsPath}/roles`);
await expect(page.locator('[data-ui-id="ui.settings.rolesAndPermissions.roles"]').first()).toBeVisible();
const create = page.locator('[data-ui-id="ui.settings.rolesAndPermissions.roles.new"]').first();
if (await create.isVisible()) {
await create.click();
// M04A basics step, then continue into the M02 permission editor (no save).
const basics = page.locator('[data-ui-id="ui.settings.rolesAndPermissions.roles.basics"]');
await expect(basics).toBeVisible();
await basics.locator("input").first().fill("E2E Smoke Rolle");
await page.locator('[data-ui-id="ui.settings.rolesAndPermissions.roles.basics.continue"]').click();
await expect(page.locator('[data-ui-id="ui.settings.rolesAndPermissions.roles.editor"]')).toBeVisible();
await page.keyboard.press("Escape");
}
});
});
@@ -0,0 +1,30 @@
import { expect, test } from "./utils/test";
import { getTenantCredentials, loginAsTenantUser } from "./utils/auth";
import { skipIfUnavailable } from "./utils/navigation";
import { skipOrFailWhenE2eInputsMissing } from "./utils/readiness";
/**
* Create-workspace smoke (R-P2a interim-UI, AD-28 / DoD D.19): Login -> /new-account
* oeffnen -> der ~/ui-Vorschau-Screen ("Workspace anlegen") ist sichtbar.
*
* Der Screen ersetzt die alte handgeschriebene TenantNew-UI durch den AuthShell-
* basierten Interim-Screen mit stabilem `data-ui-id="ui.account.create.page"`.
* Nicht-mutierend (kein Submit). Skippt ohne E2E-Credentials / wenn die Route im
* Environment nicht erreichbar ist.
*/
const credentials = getTenantCredentials();
const newAccountPath = process.env.E2E_NEW_ACCOUNT_PATH ?? "/new-account";
test.describe("new-account smoke", () => {
test("renders the create-workspace interim screen", async ({ page }) => {
skipOrFailWhenE2eInputsMissing(["E2E_TENANT_EMAIL", "E2E_TENANT_PASSWORD"], "New-account smoke inputs not configured");
await loginAsTenantUser(page, credentials!);
const response = await page.goto(newAccountPath, { waitUntil: "domcontentloaded" });
await skipIfUnavailable(page, response, "New-account path is not reachable in this environment");
await expect(page.locator('[data-ui-id="ui.account.create.page"]')).toBeVisible();
await expect(page.locator('[data-ui-id="ui.account.create.name"], input[name="name"]').first()).toBeVisible();
await expect(page.locator('[data-ui-id="ui.account.create.submit"], button[type="submit"]').first()).toBeVisible();
});
});
@@ -0,0 +1,49 @@
import { expect, test } from "./utils/test";
import { getTenantCredentials, loginAsTenantUser, tenantSettingsNotificationsPath } from "./utils/auth";
import { skipIfUnavailable } from "./utils/navigation";
import { skipOrFailWhenE2eInputsMissing } from "./utils/readiness";
/**
* Notifications-Smoke (AK-P3 / DoD D.19): Login -> Notification-Center oeffnen
* -> Interim-Screen (AD-28) sichtbar; Topbar-Glocke oeffnet den Drawer;
* Notification-Settings rendern die Modul-Gruppen + Master-Switch.
*
* Skippt ohne E2E-Credentials / wenn die Routen im Environment nicht erreichbar
* sind. Nicht-mutierend: keine Preferences werden geschrieben.
*/
const credentials = getTenantCredentials();
const dashboardPath = process.env.E2E_TENANT_DASHBOARD_PATH ?? "/app/dashboard";
const notificationsPath = process.env.E2E_TENANT_NOTIFICATIONS_CENTER_PATH ?? dashboardPath.replace(/\/dashboard\/?$/u, "/notifications");
test.describe("notifications smoke", () => {
test("renders the notification center and opens the topbar drawer", async ({ page }) => {
skipOrFailWhenE2eInputsMissing(["E2E_TENANT_EMAIL", "E2E_TENANT_PASSWORD"], "Notifications smoke inputs not configured");
await loginAsTenantUser(page, credentials!);
const response = await page.goto(notificationsPath, { waitUntil: "domcontentloaded" });
await skipIfUnavailable(page, response, "Notifications path is not reachable in this environment");
await expect(page.locator('[data-ui-id="ui.notifications.center"]')).toBeVisible();
// Topbar bell opens the interim drawer (AD-28) instead of navigating.
const bell = page.locator('[data-ui-id="ui.action.shell.notifications"]');
if (await bell.isVisible()) {
await bell.click();
await expect(page.locator('[data-ui-id="ui.notifications.drawer"]')).toBeVisible();
await page.locator('[data-ui-id="ui.notifications.drawer.close"]').click();
}
});
test("renders the notification settings groups and master switch", async ({ page }) => {
skipOrFailWhenE2eInputsMissing(["E2E_TENANT_EMAIL", "E2E_TENANT_PASSWORD"], "Notifications smoke inputs not configured");
await loginAsTenantUser(page, credentials!);
const settingsPath = tenantSettingsNotificationsPath(dashboardPath);
const response = await page.goto(settingsPath, { waitUntil: "domcontentloaded" });
await skipIfUnavailable(page, response, "Notification settings path is not reachable in this environment");
await expect(page.locator('[data-ui-id="ui.settings.notifications.page"]')).toBeVisible();
await expect(page.locator('[data-ui-id="ui.settings.notifications.master.email"]')).toBeVisible();
await expect(page.locator('[data-ui-id="ui.settings.notifications.module.general"]')).toBeVisible();
});
});
@@ -40,14 +40,14 @@ const pluginSettingsPath = process.env.E2E_PLUGIN_SETTINGS_PATH;
const workflowRunManualPath = process.env.E2E_WORKFLOW_RUN_MANUAL_PATH;
// FIXTURE SEPARATION: these lifecycle/audit tests MUTATE the plugin they target
// (grant audit, deactivate/re-enable). They must NOT touch the shared
// `com.toolctrl.e2e-readiness` plugin, whose "enabled + audit-missing" seed
// `com.hivegrid.e2e-readiness` plugin, whose "enabled + audit-missing" seed
// baseline the plugin-settings review/grant tests depend on and which is
// UI-unrestorable once mutated (revoke auto-disables; the disabled+missing-cap
// row hides its enable form). The seeded `com.toolctrl.e2e-lifecycle` plugin is
// row hides its enable form). The seeded `com.hivegrid.e2e-lifecycle` plugin is
// fully provisioned (all capabilities + hook consent granted), so granting audit
// is a no-op and deactivate→re-enable never hits the review-before-enable gate —
// the perfect dedicated fixture for these mutating tests.
const lifecyclePluginId = "com.toolctrl.e2e-lifecycle";
const lifecyclePluginId = "com.hivegrid.e2e-lifecycle";
const pluginHookAuditRequiredInputs = [
"E2E_TENANT_EMAIL",
@@ -7,8 +7,8 @@ import { skipOrFailWhenE2eFixtureMissing, skipOrFailWhenE2eInputsMissing, skipOr
const credentials = getTenantCredentials();
const pluginSettingsPath = process.env.E2E_PLUGIN_SETTINGS_PATH;
const readinessPluginId = "com.toolctrl.e2e-readiness";
const lifecyclePluginId = "com.toolctrl.e2e-lifecycle";
const readinessPluginId = "com.hivegrid.e2e-readiness";
const lifecyclePluginId = "com.hivegrid.e2e-lifecycle";
const readonlyCredentials =
process.env.E2E_PLUGIN_READONLY_EMAIL && process.env.E2E_PLUGIN_READONLY_PASSWORD
? { email: process.env.E2E_PLUGIN_READONLY_EMAIL, password: process.env.E2E_PLUGIN_READONLY_PASSWORD }
@@ -2,7 +2,7 @@ import { expect, test, type Locator, type Page } from "./utils/test";
import { expectNoCriticalA11yViolations } from "./utils/axe";
import { getTenantCredentials, loginAsTenantUser } from "./utils/auth";
import { expectNoHorizontalOverflow, narrowMobileViewport } from "./utils/mobile";
import { escapeRegExp, failOnStripeNetworkRequests, skipIfUnavailable } from "./utils/navigation";
import { escapeRegExp, failOnPaymentProviderNetworkRequests, skipIfUnavailable } from "./utils/navigation";
import { skipOrFailWhenE2eFixtureMissing, skipOrFailWhenE2eInputsMissing } from "./utils/readiness";
const credentials = getTenantCredentials();
@@ -16,7 +16,7 @@ test.describe("readiness golden path mobile a11y", () => {
test.use({ viewport: narrowMobileViewport, isMobile: true, hasTouch: true });
test.beforeEach(async ({ page }) => {
await failOnStripeNetworkRequests(page);
await failOnPaymentProviderNetworkRequests(page);
});
test("navigates authenticated mobile readiness surfaces without mutations", async ({ page }) => {
@@ -11,7 +11,7 @@ import {
tenantSettingsSubscriptionPath,
} from "./utils/auth";
import { compactMobileViewport, expectNoHorizontalOverflow, narrowMobileViewport } from "./utils/mobile";
import { escapeRegExp, failOnStripeNetworkRequests, interceptCurrentRoutePost, postDataIncludesField, singleFetchActionError, skipIfUnavailable } from "./utils/navigation";
import { escapeRegExp, failOnPaymentProviderNetworkRequests, interceptCurrentRoutePost, postDataIncludesField, singleFetchActionError, skipIfUnavailable } from "./utils/navigation";
import { optionalE2eBooleanInput, skipOrFailWhenE2eFixtureMissing, skipOrFailWhenE2eInputsMissing, skipOrFailWhenE2eOptInMissing } from "./utils/readiness";
const credentials = getTenantCredentials();
@@ -173,7 +173,7 @@ test.describe("registration to account dashboard mobile a11y", () => {
if (expectsEmailVerification === true) {
skipOrFailWhenE2eFixtureMissing("Dashboard provisioning readiness is covered only when registration does not stop for email verification");
}
await failOnStripeNetworkRequests(page);
await failOnPaymentProviderNetworkRequests(page);
await page.goto("/register", { waitUntil: "domcontentloaded" });
@@ -260,7 +260,7 @@ test.describe("registration to account dashboard mobile a11y", () => {
// inapplicable in that env, so skip honestly instead of fail-closing.
test.skip(true, "Email verification readiness only applies when E2E_REGISTRATION_EXPECTS_EMAIL_VERIFICATION=1");
}
await failOnStripeNetworkRequests(page);
await failOnPaymentProviderNetworkRequests(page);
await page.goto("/register", { waitUntil: "domcontentloaded" });
@@ -570,12 +570,12 @@ test.describe("registration to account dashboard mobile a11y", () => {
await expectNoCriticalA11yViolations(page);
});
test("keeps account dashboard subscription links tenant-scoped on mobile without Stripe", async ({ page }) => {
test("keeps account dashboard subscription links tenant-scoped on mobile without a payment provider", async ({ page }) => {
skipOrFailWhenE2eInputsMissing(
["E2E_TENANT_EMAIL", "E2E_TENANT_PASSWORD", "E2E_TENANT_DASHBOARD_PATH", "E2E_TENANT_SUBSCRIPTION_PATH"],
"Authenticated account dashboard subscription scope inputs not configured"
);
await failOnStripeNetworkRequests(page);
await failOnPaymentProviderNetworkRequests(page);
await loginAsTenantUser(page, credentials!);
const accountPath = tenantSettingsAccountPath(dashboardPath);
@@ -605,11 +605,11 @@ test.describe("registration to account dashboard mobile a11y", () => {
const checkoutLink = page.locator('[data-ui-id="ui.subscription.checkout.link"]').first();
if ((await checkoutLink.count()) > 0 && (await checkoutLink.isVisible())) {
const checkoutHref = await checkoutLink.getAttribute("href");
expect(checkoutHref).not.toMatch(/stripe\.com|^https?:\/\//u);
expect(checkoutHref).not.toMatch(/mollie\.com|^https?:\/\//u);
expect(new URL(checkoutHref ?? "", "http://e2e.local").pathname).toBe(`/subscribe/${tenantSlugFromSettingsPath(subscriptionPath)}`);
}
expect(page.url()).not.toMatch(/stripe\.com/u);
expect(page.url()).not.toMatch(/mollie\.com/u);
await expectNoHorizontalOverflow(page);
await expectNoCriticalA11yViolations(page);
});
@@ -619,7 +619,7 @@ test.describe("registration to account dashboard mobile a11y", () => {
["E2E_TENANT_EMAIL", "E2E_TENANT_PASSWORD", "E2E_TENANT_DASHBOARD_PATH", "E2E_TENANT_SUBSCRIPTION_PATH"],
"Authenticated account-to-subscription mobile navigation inputs not configured"
);
await failOnStripeNetworkRequests(page);
await failOnPaymentProviderNetworkRequests(page);
await loginAsTenantUser(page, credentials!);
const accountPath = tenantSettingsAccountPath(dashboardPath);
@@ -679,7 +679,7 @@ test.describe("registration to account dashboard mobile a11y", () => {
await expect(page.locator('[data-ui-id="ui.subscription.page"]').first()).toBeVisible();
await expect(page.locator('[data-ui-id="ui.subscription.products"]').first()).toBeVisible();
await expect(page.locator('[data-ui-id="ui.subscription.billing.portal"]').first()).toHaveAttribute("type", "button");
expect(page.url()).not.toMatch(/stripe\.com/u);
expect(page.url()).not.toMatch(/mollie\.com/u);
await expectNoHorizontalOverflow(page);
await expectNoCriticalA11yViolations(page);
});
@@ -846,13 +846,11 @@ test.describe("registration to account dashboard mobile a11y", () => {
expect(postDataIncludesField(submitted.value, "name", new RegExp(`^${escapeRegExp(accountName)}$`, "u"))).toBe(true);
await expect(form).toBeVisible();
await expect(nameInput).toHaveValue(accountName);
// TenantNew surfaces the action error through the shared ErrorModal dialog,
// which aria-hides the sibling inline alert — assert the dialog, then dismiss
// it so the form is genuinely retryable and the a11y scan runs unobstructed.
const errorDialog = page.getByRole("dialog").filter({ hasText: syntheticError });
await expect(errorDialog).toBeVisible();
await errorDialog.getByRole("button", { name: /close|schließen|schliessen/i }).first().click();
await expect(errorDialog).toBeHidden();
// The interim ~/ui screen (AD-28) surfaces the action error as an inline alert on the
// create form (not a modal dialog); assert the alert marker carries the error, then confirm
// the form stays retryable with its typed value intact.
const errorAlert = page.locator('[data-ui-id="ui.account.create.error"]').filter({ hasText: syntheticError });
await expect(errorAlert).toBeVisible();
await expect(nameInput).toHaveValue(accountName);
await expect(submitButton).toBeEnabled();
await expectNoHorizontalOverflow(page);
@@ -862,7 +860,7 @@ test.describe("registration to account dashboard mobile a11y", () => {
test("can create a tenant account and reach its dashboard when explicitly enabled", async ({ page }) => {
skipOrFailWhenE2eInputsMissing(["E2E_TENANT_EMAIL", "E2E_TENANT_PASSWORD"], "Account creation flow inputs not configured");
skipOrFailWhenE2eOptInMissing("E2E_ALLOW_ACCOUNT_CREATE", "skipping mutating account creation flow");
await failOnStripeNetworkRequests(page);
await failOnPaymentProviderNetworkRequests(page);
await loginAsTenantUser(page, credentials!);
@@ -910,7 +908,7 @@ test.describe("registration to account dashboard mobile a11y", () => {
test("can onboard a registered user with no tenant through account creation when explicitly enabled", async ({ page, context }) => {
skipOrFailWhenE2eOptInMissing("E2E_ALLOW_NO_TENANT_ACCOUNT_CREATE", "skipping mutating no-tenant account creation flow");
skipOrFailWhenE2eInputsMissing(["E2E_NO_TENANT_EMAIL", "E2E_NO_TENANT_PASSWORD"], "No-tenant account creation flow inputs not configured");
await failOnStripeNetworkRequests(page);
await failOnPaymentProviderNetworkRequests(page);
const noTenantCredentials = {
email: process.env.E2E_NO_TENANT_EMAIL!,
@@ -1028,10 +1026,10 @@ async function expectProvisionedSubscriptionPage(page: Page, createdDashboardPat
"href",
new RegExp(`\\/subscribe\\/${escapeRegExp(tenantSlugFromSettingsPath(subscriptionPath))}(?:[?#].*)?$`, "u")
);
await expect(checkoutLink).not.toHaveAttribute("href", /stripe\.com|^https?:\/\//u);
await expect(checkoutLink).not.toHaveAttribute("href", /mollie\.com|^https?:\/\//u);
}
expect(page.url()).not.toMatch(/stripe\.com/u);
expect(page.url()).not.toMatch(/mollie\.com/u);
await expectNoHorizontalOverflow(page);
await expectNoCriticalA11yViolations(page);
}
@@ -2,7 +2,7 @@ import { expect, test, type Locator, type Page } from "./utils/test";
import { getTenantCredentials, loginAsTenantUser, tenantSettingsAccountPath } from "./utils/auth";
import { expectNoCriticalA11yViolations } from "./utils/axe";
import { compactMobileViewport, expectNoHorizontalOverflow, narrowMobileViewport } from "./utils/mobile";
import { escapeRegExp, failOnStripeNetworkRequests, interceptCurrentRoutePost, postDataIncludesField, singleFetchActionError, skipIfUnavailable } from "./utils/navigation";
import { escapeRegExp, failOnPaymentProviderNetworkRequests, interceptCurrentRoutePost, postDataIncludesField, singleFetchActionError, skipIfUnavailable } from "./utils/navigation";
import { skipOrFailWhenE2eFixtureMissing, skipOrFailWhenE2eInputsMissing, skipWhenE2eOperatorOptInMissing } from "./utils/readiness";
const credentials = getTenantCredentials();
@@ -14,10 +14,10 @@ const requireSubscriptionSuccessE2e = process.env.E2E_REQUIRE_SUBSCRIPTION_SUCCE
test.describe("subscription settings smoke", () => {
test.beforeEach(async ({ page }) => {
await failOnStripeNetworkRequests(page);
await failOnPaymentProviderNetworkRequests(page);
});
test("renders billing surface without opening Stripe redirects", async ({ page }) => {
test("renders billing surface without opening payment provider redirects", async ({ page }) => {
skipOrFailWhenE2eInputsMissing(["E2E_TENANT_EMAIL", "E2E_TENANT_PASSWORD", "E2E_TENANT_SUBSCRIPTION_PATH"], "Subscription smoke inputs not configured");
await loginAsTenantUser(page, credentials!);
@@ -35,14 +35,14 @@ test.describe("subscription settings smoke", () => {
const checkoutLink = page.locator('[data-ui-id="ui.subscription.checkout.link"]').first();
if ((await checkoutLink.count()) > 0) {
await expect(checkoutLink).toHaveAttribute("href", /\/subscribe\/[^/?#]+(?:[?#].*)?$/u);
await expect(checkoutLink).not.toHaveAttribute("href", /stripe\.com|^https?:\/\//u);
await expect(checkoutLink).not.toHaveAttribute("href", /mollie\.com|^https?:\/\//u);
}
await expectNoHorizontalOverflow(page);
await expectNoCriticalA11yViolations(page);
});
test("opens the tenant checkout catalog from subscription settings without triggering Stripe", async ({ page }) => {
test("opens the tenant checkout catalog from subscription settings without triggering a payment provider", async ({ page }) => {
skipOrFailWhenE2eInputsMissing(
["E2E_TENANT_EMAIL", "E2E_TENANT_PASSWORD", "E2E_TENANT_SUBSCRIPTION_PATH"],
"Subscription checkout smoke inputs not configured"
@@ -203,14 +203,14 @@ test.describe("subscription settings smoke", () => {
expect(postDataIncludesField(submittedPostData.value, "csrf", /.+/u)).toBe(true);
await expect(page.getByRole("dialog").filter({ hasText: "E2E synthetic checkout failure" }).first()).toBeVisible({ timeout: 10_000 });
await expect(page).toHaveURL(/\/subscribe\/[^/?#]+(?:[?#].*)?$/u);
expect(page.url()).not.toMatch(/stripe\.com/u);
expect(page.url()).not.toMatch(/mollie\.com/u);
});
test("renders checkout success return surface when strict operator opt-in is enabled", async ({ page }) => {
if (!requireSubscriptionSuccessE2e) {
skipWhenE2eOperatorOptInMissing(
"E2E_REQUIRE_SUBSCRIPTION_SUCCESS",
"subscription success return smoke requires an externally acquired Stripe checkout session path"
"subscription success return smoke requires an externally acquired payment checkout session path"
);
return;
}
@@ -260,19 +260,19 @@ test.describe("subscription settings smoke", () => {
await Promise.all([page.waitForURL(new RegExp(`${escapeRegExp(dashboardPath)}(?:[?#].*)?$`, "u")), dashboardLink.click()]);
await expectTenantDashboard(page);
expect(page.url()).not.toMatch(/stripe\.com/u);
expect(page.url()).not.toMatch(/mollie\.com/u);
await page.goto(subscriptionHref ?? subscriptionPath, { waitUntil: "domcontentloaded" });
await expect(page).toHaveURL(/\/settings\/subscription(?:[?#].*)?$/u);
await expectActiveSubscriptionStateAffordances(page);
expect(page.url()).not.toMatch(/stripe\.com/u);
expect(page.url()).not.toMatch(/mollie\.com/u);
});
test("reconciles checkout success state so it persists across reload and re-login", async ({ page }) => {
if (!requireSubscriptionSuccessE2e) {
skipWhenE2eOperatorOptInMissing(
"E2E_REQUIRE_SUBSCRIPTION_SUCCESS",
"subscription reconciliation followthrough requires an externally acquired Stripe checkout session path"
"subscription reconciliation followthrough requires an externally acquired payment checkout session path"
);
return;
}
@@ -319,18 +319,18 @@ test.describe("subscription settings smoke", () => {
// Follow the dashboard link from the checkout return surface.
await Promise.all([page.waitForURL(new RegExp(`${escapeRegExp(dashboardPath)}(?:[?#].*)?$`, "u")), dashboardLink.click()]);
await expectTenantDashboard(page);
expect(page.url()).not.toMatch(/stripe\.com/u);
expect(page.url()).not.toMatch(/mollie\.com/u);
// Reconciled state must be readable on the subscription settings loader and survive a fresh reload.
await page.goto(subscriptionHref ?? subscriptionPath, { waitUntil: "domcontentloaded" });
await expect(page).toHaveURL(/\/settings\/subscription(?:[?#].*)?$/u);
await expectActiveSubscriptionStateAffordances(page);
expect(page.url()).not.toMatch(/stripe\.com/u);
expect(page.url()).not.toMatch(/mollie\.com/u);
await page.reload({ waitUntil: "domcontentloaded" });
await expect(page).toHaveURL(/\/settings\/subscription(?:[?#].*)?$/u);
await expectActiveSubscriptionStateAffordances(page);
expect(page.url()).not.toMatch(/stripe\.com/u);
expect(page.url()).not.toMatch(/mollie\.com/u);
// Reconciled state must persist across a full logout + re-login (fresh appData load).
await signOutTenantUser(page);
@@ -345,7 +345,7 @@ test.describe("subscription settings smoke", () => {
await skipIfUnavailable(page, reloginResponse, "Subscription settings path is not reachable in this environment");
await expect(page).toHaveURL(/\/settings\/subscription(?:[?#].*)?$/u);
await expectActiveSubscriptionStateAffordances(page);
expect(page.url()).not.toMatch(/stripe\.com/u);
expect(page.url()).not.toMatch(/mollie\.com/u);
});
test("renders synthetic invalid checkout return fixture only when operator-enabled", async ({ page }) => {
@@ -391,7 +391,7 @@ test.describe("subscription settings smoke", () => {
await expectNoCriticalA11yViolations(page);
});
test("submits the billing portal action with CSRF without requiring Stripe", async ({ page }) => {
test("submits the billing portal action with CSRF without requiring Mollie", async ({ page }) => {
skipOrFailWhenE2eInputsMissing(
["E2E_TENANT_EMAIL", "E2E_TENANT_PASSWORD", "E2E_TENANT_SUBSCRIPTION_PATH"],
"Subscription billing portal smoke inputs not configured"
@@ -444,7 +444,7 @@ test.describe("subscription settings smoke", () => {
await expect(portalButton).toBeFocused();
await expectNoHorizontalOverflow(page);
await expectNoCriticalA11yViolations(page);
expect(page.url()).not.toMatch(/stripe\.com/u);
expect(page.url()).not.toMatch(/mollie\.com/u);
});
test("submits cancellation action contract with CSRF when cancellation controls are rendered", async ({ page }) => {
@@ -520,7 +520,7 @@ test.describe("subscription settings smoke", () => {
["E2E_TENANT_EMAIL", "E2E_TENANT_PASSWORD", "E2E_TENANT_SUBSCRIPTION_PATH"],
"Subscription cancellation keyboard smoke inputs not configured"
);
expect(process.env.STRIPE_SK ?? "").not.toMatch(/^sk_live_/u);
expect(process.env.MOLLIE_API_KEY ?? "").not.toMatch(/^live_/u);
await loginAsTenantUser(page, credentials!);
const response = await page.goto(subscriptionPath, { waitUntil: "domcontentloaded" });
@@ -547,14 +547,14 @@ test.describe("subscription settings smoke", () => {
await expect(dialog).toBeHidden();
await page.waitForTimeout(250);
expect(submittedPostData.value).toBeNull();
expect(page.url()).not.toMatch(/stripe\.com/u);
expect(page.url()).not.toMatch(/mollie\.com/u);
});
});
test.describe("subscription settings mobile smoke", () => {
test.use({ viewport: narrowMobileViewport, isMobile: true, hasTouch: true });
test.beforeEach(async ({ page }) => {
await failOnStripeNetworkRequests(page);
await failOnPaymentProviderNetworkRequests(page);
});
test("keeps subscription controls reachable on mobile", async ({ page }) => {
@@ -654,14 +654,14 @@ test.describe("subscription settings mobile smoke", () => {
await Promise.all([page.waitForURL(new RegExp(`${escapeRegExp(dashboardPath)}(?:[?#].*)?$`, "u")), dashboardLink.tap()]);
await expectTenantDashboard(page);
expect(page.url()).not.toMatch(/stripe\.com/u);
expect(page.url()).not.toMatch(/mollie\.com/u);
});
});
test.describe("subscription settings compact mobile smoke", () => {
test.use({ viewport: compactMobileViewport, isMobile: true, hasTouch: true });
test.beforeEach(async ({ page }) => {
await failOnStripeNetworkRequests(page);
await failOnPaymentProviderNetworkRequests(page);
});
test("keeps account settings, subscription settings, and checkout catalog usable at 320px", async ({ page }) => {
@@ -814,7 +814,7 @@ test.describe("subscription settings compact mobile smoke", () => {
await expect(portalButton).toBeEnabled();
await expectNoHorizontalOverflow(page);
await expectNoCriticalA11yViolations(page);
expect(page.url()).not.toMatch(/stripe\.com/u);
expect(page.url()).not.toMatch(/mollie\.com/u);
});
});
@@ -1,71 +0,0 @@
import { expect, test } from "./utils/test";
import { expectNoCriticalA11yViolations } from "./utils/axe";
import { getTenantCredentials, loginAsTenantUser, tenantSettingsChatbotPath } from "./utils/auth";
import { expectNoHorizontalOverflow, narrowMobileViewport } from "./utils/mobile";
import { escapeRegExp, interceptCurrentRoutePost, postDataIncludesField, skipIfUnavailable } from "./utils/navigation";
import { skipOrFailWhenE2eFixtureMissing, skipOrFailWhenE2eInputsMissing } from "./utils/readiness";
const credentials = getTenantCredentials();
const dashboardPath = process.env.E2E_TENANT_DASHBOARD_PATH;
const chatbotPath = process.env.E2E_TENANT_CHATBOT_PATH ?? (dashboardPath ? tenantSettingsChatbotPath(dashboardPath) : undefined);
test.describe("tenant chatbot settings mobile a11y", () => {
test.use({ viewport: narrowMobileViewport, isMobile: true, hasTouch: true });
test.beforeEach(() => {
skipOrFailWhenE2eInputsMissing(["E2E_TENANT_EMAIL", "E2E_TENANT_PASSWORD", "E2E_TENANT_DASHBOARD_PATH"], "Tenant chatbot settings E2E inputs not configured");
if (!chatbotPath) {
skipOrFailWhenE2eFixtureMissing("Tenant chatbot settings path could not be derived; set E2E_TENANT_CHATBOT_PATH");
}
});
test("renders access controls without mobile overflow or critical a11y violations", async ({ page }) => {
await loginAsTenantUser(page, credentials!);
const response = await page.goto(chatbotPath!, { waitUntil: "domcontentloaded" });
await skipIfUnavailable(page, response, `Tenant chatbot settings path ${chatbotPath}`);
await expect(page).toHaveURL(new RegExp(`${escapeRegExp(chatbotPath!)}(?:[?#].*)?$`, "u"));
await expect(page.locator('[data-ui-id="ui.settings.chatbot.page"]').first()).toBeVisible();
await expect(page.locator('[data-ui-id="ui.settings.chatbot.master.form"]').first()).toBeVisible();
await expect(page.locator('[data-ui-id="ui.settings.chatbot.defaults.form"]').first()).toBeVisible();
await expect(page.locator('[data-ui-id="ui.settings.chatbot.providers"]').first()).toBeVisible();
await expectNoHorizontalOverflow(page);
await expectNoCriticalA11yViolations(page);
});
test("submits tenant default access contract with csrf without mutating data", async ({ page }) => {
await loginAsTenantUser(page, credentials!);
const response = await page.goto(chatbotPath!, { waitUntil: "domcontentloaded" });
await skipIfUnavailable(page, response, `Tenant chatbot settings path ${chatbotPath}`);
const form = page.locator('[data-ui-id="ui.settings.chatbot.defaults.form"]').first();
await expect(form).toBeVisible();
await form.locator('input[name="accessMode"][value="all_members"]').setChecked(true);
const defaultCapability = form.locator('input[name="defaultCapability"]').first();
if ((await defaultCapability.count()) > 0) {
await defaultCapability.setChecked(true);
}
const csrf = form.locator('input[name="csrf"]').first();
if ((await csrf.count()) > 0) {
await expect(csrf).not.toHaveValue("");
}
const submitted = await interceptCurrentRoutePost(page, { status: 204 });
await form.locator('button[type="submit"]').first().click();
await expect.poll(() => submitted.value).not.toBeNull();
expect(postDataIncludesField(submitted.value, "op", /^update-tenant-defaults$/u)).toBe(true);
expect(postDataIncludesField(submitted.value, "accessMode", /^all_members$/u)).toBe(true);
if ((await defaultCapability.count()) > 0) {
expect(postDataIncludesField(submitted.value, "defaultCapability", /.+/u)).toBe(true);
}
if ((await csrf.count()) > 0) {
expect(postDataIncludesField(submitted.value, "csrf", /.+/u)).toBe(true);
}
});
});
@@ -49,10 +49,10 @@ test.describe("tenant members mobile a11y", () => {
await form.locator('input[name="first-name"]').fill("E2E");
await form.locator('input[name="last-name"]').fill("Invite");
// "send invitation" is a Radix checkbox: the input[name] is a hidden form
// proxy, so toggle it through its visible label instead of the hidden input.
// proxy, so toggle it through the visible checkbox control instead.
const inviteCheckbox = form.locator('input[name="send-invitation-email"]');
if (!(await inviteCheckbox.isChecked().catch(() => false))) {
await form.locator('label[for="send-invitation-email"]').first().click();
await form.getByRole("checkbox").first().click();
}
await expect(inviteCheckbox).toBeChecked();
@@ -5,6 +5,10 @@ import { expectNoHorizontalOverflow } from "./utils/mobile";
import { escapeRegExp, skipIfUnavailable } from "./utils/navigation";
import { skipOrFailWhenE2eFixtureMissing, skipOrFailWhenE2eInputsMissing } from "./utils/readiness";
// R-P2b (D-P2 Admin RBAC): one merged "Rollen und Berechtigungen" tab (S02).
// The old users/permissions sub-tabs redirect (matrix → members, permissions →
// roles); the S01/S02 tab bar links members and roles.
const credentials = getTenantCredentials();
const dashboardPath = process.env.E2E_TENANT_DASHBOARD_PATH;
const rolesAndPermissionsPath =
@@ -23,37 +27,35 @@ test.describe("tenant roles and permissions desktop a11y", () => {
}
});
test("renders users, roles, and permissions tabs without desktop overflow or critical a11y violations", async ({ page }) => {
test("renders the merged roles tab without desktop overflow or critical a11y violations", async ({ page }) => {
await loginAsTenantUser(page, credentials!);
const response = await page.goto(rolesAndPermissionsPath!, { waitUntil: "domcontentloaded" });
await skipIfUnavailable(page, response, `Tenant roles and permissions path ${rolesAndPermissionsPath}`);
const usersPath = `${rolesAndPermissionsPath}/users`;
const rolesPath = `${rolesAndPermissionsPath}/roles`;
const permissionsPath = `${rolesAndPermissionsPath}/permissions`;
await expect(page).toHaveURL(new RegExp(`${escapeRegExp(usersPath)}(?:[?#].*)?$`, "u"));
await expect(page.locator('[data-ui-id="ui.settings.rolesAndPermissions.page"]').first()).toBeVisible();
await expect(page.locator('[data-ui-id="ui.settings.rolesAndPermissions.tabs"]').first()).toBeVisible();
await expect(page.locator(`a[href$="${usersPath}"]`).first()).toBeVisible();
await expect(page.locator(`a[href$="${rolesPath}"]`).first()).toBeVisible();
await expect(page.locator(`a[href$="${permissionsPath}"]`).first()).toBeVisible();
await expect(page.locator('[data-ui-id="ui.settings.rolesAndPermissions.users"] table').first()).toBeVisible();
await expectNoHorizontalOverflow(page);
await expectNoCriticalA11yViolations(page);
await page.locator(`a[href$="${rolesPath}"]`).first().click();
// Index redirects into the merged S02 roles tab.
await expect(page).toHaveURL(new RegExp(`${escapeRegExp(rolesPath)}(?:[?#].*)?$`, "u"));
await expect(page.locator('[data-ui-id="ui.settings.rolesAndPermissions.page"]').first()).toBeVisible();
await expect(page.locator('[data-ui-id="ui.settings.rolesAndPermissions.roles"] table').first()).toBeVisible();
await expectNoHorizontalOverflow(page);
await expectNoCriticalA11yViolations(page);
await expect(page.locator('[data-ui-id="ui.settings.rolesAndPermissions.roles.filter"]').first()).toBeVisible();
// S01/S02 tab bar: link back to the members tab.
await expect(page.locator('[data-ui-id="ui.settings.rolesAndPermissions.tab.members"]').first()).toBeVisible();
await page.locator(`a[href$="${permissionsPath}"]`).first().click();
await expect(page).toHaveURL(new RegExp(`${escapeRegExp(permissionsPath)}(?:[?#].*)?$`, "u"));
await expect(page.locator('[data-ui-id="ui.settings.rolesAndPermissions.permissions"] table').first()).toBeVisible();
await expectNoHorizontalOverflow(page);
await expectNoCriticalA11yViolations(page);
});
test("redirects the legacy users and permissions sub-tabs", async ({ page }) => {
await loginAsTenantUser(page, credentials!);
const usersResponse = await page.goto(`${rolesAndPermissionsPath!}/users`, { waitUntil: "domcontentloaded" });
await skipIfUnavailable(page, usersResponse, `Tenant roles users path ${rolesAndPermissionsPath}/users`);
// Matrix is superseded by the inline role dropdown in the members list (D01).
await expect(page).toHaveURL(/\/settings\/members(?:[?#].*)?$/u);
await page.goto(`${rolesAndPermissionsPath!}/permissions`, { waitUntil: "domcontentloaded" });
await expect(page).toHaveURL(new RegExp(`${escapeRegExp(`${rolesAndPermissionsPath}/roles`)}(?:[?#].*)?$`, "u"));
});
});
@@ -1,14 +1,19 @@
import { expect, test } from "./utils/test";
import { expectNoCriticalA11yViolations } from "./utils/axe";
import { getTenantCredentials, loginAsTenantUser, tenantRolesAndPermissionsPath } from "./utils/auth";
import { getTenantCredentials, loginAsTenantUser, tenantRolesAndPermissionsPath, tenantSettingsMembersPath } from "./utils/auth";
import { compactMobileViewport, expectNoHorizontalOverflow, narrowMobileViewport } from "./utils/mobile";
import { escapeRegExp, interceptCurrentRoutePost, postDataIncludesField, skipIfUnavailable } from "./utils/navigation";
import { skipOrFailWhenE2eFixtureMissing, skipOrFailWhenE2eInputsMissing } from "./utils/readiness";
// R-P2b (D-P2 Admin RBAC): one merged "Rollen und Berechtigungen" tab (S02);
// role assignment happens inline in the members list (D01 dropdown) instead of
// the old users matrix (route redirects to settings/members).
const credentials = getTenantCredentials();
const dashboardPath = process.env.E2E_TENANT_DASHBOARD_PATH;
const rolesAndPermissionsPath =
process.env.E2E_TENANT_ROLES_AND_PERMISSIONS_PATH ?? (dashboardPath ? tenantRolesAndPermissionsPath(dashboardPath) : undefined);
const membersPath = process.env.E2E_TENANT_MEMBERS_PATH ?? (dashboardPath ? tenantSettingsMembersPath(dashboardPath) : undefined);
test.describe("tenant roles and permissions mobile a11y", () => {
test.use({ isMobile: true, hasTouch: true });
@@ -24,35 +29,21 @@ test.describe("tenant roles and permissions mobile a11y", () => {
});
for (const viewport of [narrowMobileViewport, compactMobileViewport]) {
test(`keeps users, roles, and permissions usable at ${viewport.width}px`, async ({ page }) => {
test(`keeps the merged roles tab usable at ${viewport.width}px`, async ({ page }) => {
await page.setViewportSize(viewport);
await loginAsTenantUser(page, credentials!);
const response = await page.goto(rolesAndPermissionsPath!, { waitUntil: "domcontentloaded" });
await skipIfUnavailable(page, response, `Tenant roles and permissions path ${rolesAndPermissionsPath}`);
const usersPath = `${rolesAndPermissionsPath}/users`;
const rolesPath = `${rolesAndPermissionsPath}/roles`;
const permissionsPath = `${rolesAndPermissionsPath}/permissions`;
await expect(page).toHaveURL(new RegExp(`${escapeRegExp(usersPath)}(?:[?#].*)?$`, "u"));
await expect(page.locator('[data-ui-id="ui.settings.rolesAndPermissions.page"]').first()).toBeVisible();
await expect(page.locator('[data-ui-id="ui.settings.rolesAndPermissions.tabs"]').first()).toBeVisible();
await expect(page.locator('[data-ui-id="ui.settings.rolesAndPermissions.users"] table').first()).toBeVisible();
const firstRoleToggle = page.locator('[data-ui-id="ui.settings.rolesAndPermissions.users.roleToggle"]').first();
if ((await firstRoleToggle.count()) > 0) {
await expect(firstRoleToggle).toHaveAccessibleName(/assign|unassign|zuweisen|entziehen/i);
}
await expectNoHorizontalOverflow(page);
await expectNoCriticalA11yViolations(page);
// The tab bar collapses to a <select> below md (TabsVertical), so the tab
// <a> links are hidden on mobile. Navigate the sub-pages directly to verify
// each is usable at this viewport (what this test asserts).
await page.goto(rolesPath, { waitUntil: "domcontentloaded" });
// Index redirects into the merged S02 roles tab.
await expect(page).toHaveURL(new RegExp(`${escapeRegExp(rolesPath)}(?:[?#].*)?$`, "u"));
await expect(page.locator('[data-ui-id="ui.settings.rolesAndPermissions.page"]').first()).toBeVisible();
await expect(page.locator('[data-ui-id="ui.settings.rolesAndPermissions.roles"] table').first()).toBeVisible();
await expect(page.locator('[data-ui-id="ui.settings.rolesAndPermissions.roles.filter"]').first()).toBeVisible();
// The "new role" control is permission-gated and may not render for this
// fixture; assert it only when present (matches the desktop spec's scope).
const rolesNew = page.locator('[data-ui-id="ui.settings.rolesAndPermissions.roles.new"]').first();
@@ -62,31 +53,39 @@ test.describe("tenant roles and permissions mobile a11y", () => {
await expectNoHorizontalOverflow(page);
await expectNoCriticalA11yViolations(page);
await page.goto(permissionsPath, { waitUntil: "domcontentloaded" });
await expect(page).toHaveURL(new RegExp(`${escapeRegExp(permissionsPath)}(?:[?#].*)?$`, "u"));
await expect(page.locator('[data-ui-id="ui.settings.rolesAndPermissions.permissions"] table').first()).toBeVisible();
await expect(page.locator('[data-ui-id="ui.settings.rolesAndPermissions.permissions.table"]').first()).toBeVisible();
// Legacy permissions sub-tab redirects into the merged roles tab.
await page.goto(`${rolesAndPermissionsPath}/permissions`, { waitUntil: "domcontentloaded" });
await expect(page).toHaveURL(new RegExp(`${escapeRegExp(rolesPath)}(?:[?#].*)?$`, "u"));
await expectNoHorizontalOverflow(page);
await expectNoCriticalA11yViolations(page);
});
}
test("submits the mobile role toggle contract without mutating fixture data", async ({ page }) => {
test("submits the inline role toggle contract (D01) without mutating fixture data", async ({ page }) => {
await page.setViewportSize(narrowMobileViewport);
await loginAsTenantUser(page, credentials!);
const usersPath = `${rolesAndPermissionsPath}/users`;
const response = await page.goto(usersPath, { waitUntil: "domcontentloaded" });
await skipIfUnavailable(page, response, `Tenant roles and permissions users path ${usersPath}`);
if (!membersPath) {
skipOrFailWhenE2eFixtureMissing("Tenant members path could not be derived; set E2E_TENANT_MEMBERS_PATH");
}
// The old users matrix redirects to the members list; D01 lives there now.
const response = await page.goto(`${rolesAndPermissionsPath}/users`, { waitUntil: "domcontentloaded" });
await skipIfUnavailable(page, response, `Tenant roles users path ${rolesAndPermissionsPath}/users`);
await expect(page).toHaveURL(new RegExp(`${escapeRegExp(membersPath!)}(?:[?#].*)?$`, "u"));
const roleToggle = page.locator('[data-ui-id="ui.settings.rolesAndPermissions.users.roleToggle"]:not([disabled])').first();
if ((await roleToggle.count()) === 0 || !(await roleToggle.isVisible())) {
skipOrFailWhenE2eFixtureMissing("Tenant roles fixture has no enabled role toggle for mobile contract coverage");
const roleDropdown = page.locator('[data-ui-id="ui.settings.members.roleDropdown"]').first();
if ((await roleDropdown.count()) === 0 || !(await roleDropdown.isVisible())) {
skipOrFailWhenE2eFixtureMissing("Tenant members fixture has no editable role dropdown for mobile contract coverage");
}
await roleDropdown.tap();
const roleCheckbox = page.getByRole("checkbox").first();
if ((await roleCheckbox.count()) === 0) {
skipOrFailWhenE2eFixtureMissing("Tenant members fixture exposes no assignable roles for mobile contract coverage");
}
await expect(roleToggle).toHaveAccessibleName(/assign|unassign|zuweisen|entziehen/i);
const submitted = await interceptCurrentRoutePost(page, { status: 204 });
await roleToggle.tap();
await roleCheckbox.tap();
await expect.poll(() => submitted.value, { message: "role toggle POST payload was captured" }).not.toBeNull();
expect(postDataIncludesField(submitted.value, "action", /^edit$/u)).toBe(true);
@@ -169,10 +169,6 @@ export function tenantSettingsAuditExportPath(dashboardPath: string): string {
return tenantSettingsPath(dashboardPath, "audit-export", process.env.E2E_TENANT_AUDIT_EXPORT_PATH ?? "/app/settings/audit-export");
}
export function tenantSettingsChatbotPath(dashboardPath: string): string {
return tenantSettingsPath(dashboardPath, "chatbot", process.env.E2E_TENANT_CHATBOT_PATH ?? "/app/settings/chatbot");
}
export function tenantRolesAndPermissionsPath(dashboardPath: string): string {
return tenantSettingsPath(dashboardPath, "roles-and-permissions", process.env.E2E_TENANT_ROLES_AND_PERMISSIONS_PATH ?? "/app/settings/roles-and-permissions");
}
@@ -2,7 +2,7 @@ import { test, type Page, type Response } from "@playwright/test";
import { encode } from "turbo-stream";
const SKIPPABLE_STATUSES = new Set([400, 403, 404]);
const STRIPE_HOST_PATTERN = /(^|\.)stripe\.com$/u;
const MOLLIE_HOST_PATTERN = /(^|\.)mollie\.com$/u;
/**
* Wait until the client app has hydrated (`<html data-hydrated="true">`, set by
@@ -157,12 +157,12 @@ export async function interceptCurrentRoutePost(
return submittedPostData;
}
export async function failOnStripeNetworkRequests(page: Page): Promise<void> {
export async function failOnPaymentProviderNetworkRequests(page: Page): Promise<void> {
await page.route("**/*", async (route) => {
const request = route.request();
const requestUrl = new URL(request.url());
if (STRIPE_HOST_PATTERN.test(requestUrl.hostname)) {
throw new Error(`Unexpected Stripe network request during E2E smoke: ${request.method()} ${request.url()}`);
if (MOLLIE_HOST_PATTERN.test(requestUrl.hostname)) {
throw new Error(`Unexpected payment provider network request during E2E smoke: ${request.method()} ${request.url()}`);
}
await route.fallback();
});