import { expect, test } from "@playwright/test"; import { waitForAnimations } from "../helpers/animations"; import { installMockBridge, TEST_IDENTITIES } from "../helpers/bridge"; const SHOTS = "test-results/global-agent-config"; /** * Open Settings → Agents through the app UI and wait for the defaults card to * load. CI serves the built SPA with a static file server, so navigating to * `/settings` directly returns a 404 before the client router can start. */ async function openAiDefaultsSettings(page: import("@playwright/test").Page) { await page.goto("/", { waitUntil: "domcontentloaded" }); await page.getByTestId("open-settings").click(); await page.getByTestId("profile-popover-settings").click(); await expect(page.getByTestId("settings-view")).toBeVisible(); await page.getByTestId("settings-nav-agents").click(); await expect(page.getByTestId("settings-global-agent-config")).toBeVisible({ timeout: 10_000, }); await expect(page.locator(".animate-spin").first()).not.toBeVisible({ timeout: 5_000, }); } /** * Navigate to the Agents view and open the Create Agent dialog via the * "New agent" menu item, then fill a placeholder name. */ async function openCreateDialog(page: import("@playwright/test").Page) { await page.goto("/"); await page.getByTestId("open-agents-view").click(); await page.getByTestId("new-agent-card").click(); await page.locator("#persona-display-name").fill("Test Agent"); } async function customizeAgentAi(page: import("@playwright/test").Page) { await page.getByRole("tab", { name: "Customize for this agent" }).click(); } /** * Pick an option from a PersonaDropdownField (menu-based, not a native *