import { expect, test } from "./utils/test"; import { getTenantCredentials, loginAsTenantUser } from "./utils/auth"; import { skipIfUnavailable } from "./utils/navigation"; import { skipOrFailWhenE2eInputsMissing } from "./utils/readiness"; const credentials = getTenantCredentials(); const dashboardPath = process.env.E2E_TENANT_DASHBOARD_PATH; const settingsBase = dashboardPath?.replace(/\/dashboard\/?$/u, "/settings"); const hubs = [ ["account", "profile"], ["team", "team"], ["workspace", "workspace"], ["billing", "billing"], ["integrations", "integrations"], ["compliance", "compliance"], ["customerPortal", "customer-portal"], ] as const; test.describe("AK-SET-01 settings hub smoke", () => { test.beforeEach(() => { skipOrFailWhenE2eInputsMissing( ["E2E_TENANT_EMAIL", "E2E_TENANT_PASSWORD", "E2E_TENANT_DASHBOARD_PATH"], "Settings hub E2E inputs not configured" ); }); for (const [hubId, path] of hubs) { test(`opens the ${hubId} hub with its persistent tabs`, async ({ page }) => { await loginAsTenantUser(page, credentials!); const response = await page.goto(`${settingsBase}/${path}`, { waitUntil: "domcontentloaded" }); await skipIfUnavailable(page, response, `Settings hub ${hubId}`); await expect(page.locator(`[data-ui-id="ui.settings.hub.${hubId}"]`)).toBeVisible(); await expect(page.locator(`[data-ui-id^="ui.settings.hub.${hubId}.tab."]`).first()).toBeVisible(); }); } });