/** * E2E screenshots + regression tests for agent-lifecycle feedback (PR #1766): * * 1. Persona delete confirm dialog shows "Also deletes N agent instance(s)." * when the persona has linked managed-agent instances. * 2. Global-config save reports "Saved. Restarted N agents." when running agents * were restarted. * 3. Global-config save reports plain "Saved." when no agents were restarted; * the old "Running agents keep their current settings…" text is gone. */ import { expect, test } from "@playwright/test"; import { waitForAnimations } from "../helpers/animations"; import { installMockBridge } from "../helpers/bridge"; const SHOTS = "test-results/screenshots-lifecycle"; // Persona ID used across the cascade-delete test. Must be a custom (non-builtin) // persona so the actions menu renders the Delete path. const CASCADE_PERSONA_ID = "custom:test-cascade"; // Stable fake pubkeys for the two seeded managed agents. 64 lowercase hex chars // that don't collide with TEST_IDENTITIES pubkeys. const CASCADE_AGENT_A_PUBKEY = "aa".repeat(32); const CASCADE_AGENT_B_PUBKEY = "bb".repeat(32); /** * Navigate to the Agents view and wait for its unified list to mount. */ async function openAgentsView(page: import("@playwright/test").Page) { await page.goto("/"); await page.getByTestId("open-agents-view").click(); await expect(page.getByTestId("unified-agents-groups")).toBeVisible({ timeout: 10_000, }); } 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, }); } async function makeGlobalDefaultsDirty( page: import("@playwright/test").Page, effort = "high", ) { // The defaults editor renders the app's styled dropdown (not a native //