* fix(ci): skip unrelated required checks cleanly Matrix jobs had to start no-op runners to preserve interpolated required-check names. Static named jobs let GitHub report genuine skipped conclusions while keeping those names stable. * fix(ci): gate changes to install patching script * fix(ci): route cross-package test contracts narrowly * fix(ci): keep routed contracts merge-blocking * fix(server): exclude nested test utilities from builds * fix(ci): cover app-owned native and browser domains * refactor(ci): align tests with runtime domains Own browser specs, desktop specs, and Electron-only app code by stable directories so PR routing does not depend on filename conventions. Keep desktop integration coverage inside the required desktop check. * fix(ci): keep routing and desktop suites isolated The routing regression must run before dependency installation, and desktop Vitest must not collect Playwright-owned specs. * fix(ci): isolate desktop e2e runtime * perf(test): isolate Playwright workers * perf(test): parallelize Playwright within specs * fix(test): keep Playwright file scheduling * fix(test): share dynamic Metro fixture * fix(test): preserve own-host restart fixtures * fix(ci): preserve routed contracts after rebase * Stabilize Playwright wheel-scroll assertions
73 lines
2.6 KiB
TypeScript
73 lines
2.6 KiB
TypeScript
import { randomUUID } from "node:crypto";
|
|
import { expect } from "@playwright/test";
|
|
import { test } from "../support/fixtures";
|
|
import { gotoAppShell } from "../support/helpers/app";
|
|
import { createIdleAgent } from "../support/helpers/archive-tab";
|
|
import { openCommandCenter } from "../support/helpers/command-center";
|
|
import { addOfflineHostAndReload } from "../support/helpers/hosts";
|
|
import { expectAgentTabActive } from "../support/helpers/launcher";
|
|
import { seedWorkspace } from "../support/helpers/seed-client";
|
|
import { getServerId } from "../support/helpers/server-id";
|
|
|
|
const PRIMARY_HOST_LABEL = "Primary Host";
|
|
const SECONDARY_HOST_ID = "host-command-center-secondary";
|
|
|
|
test.describe("Command center host labels", () => {
|
|
test.describe.configure({ timeout: 180_000 });
|
|
|
|
test("agent results show the host they live on when more than one host exists", async ({
|
|
page,
|
|
}) => {
|
|
const seeded = await seedWorkspace({ repoPrefix: "command-center-host-" });
|
|
const title = `cc-host-${randomUUID().slice(0, 8)}`;
|
|
|
|
try {
|
|
const agent = await createIdleAgent(seeded.client, {
|
|
cwd: seeded.repoPath,
|
|
workspaceId: seeded.workspaceId,
|
|
title,
|
|
});
|
|
|
|
// A second (offline) host makes the view multi-host, which is when the host label earns its space.
|
|
await gotoAppShell(page);
|
|
await addOfflineHostAndReload(page, {
|
|
serverId: SECONDARY_HOST_ID,
|
|
label: "Secondary Host",
|
|
primaryLabel: PRIMARY_HOST_LABEL,
|
|
});
|
|
|
|
const panel = await openCommandCenter(page);
|
|
|
|
// The shared daemon may carry agents from other specs, so target this agent by its id.
|
|
const row = panel.getByTestId(`command-center-agent-${getServerId()}:${agent.id}`);
|
|
await expect(row).toBeVisible({ timeout: 30_000 });
|
|
await expect(row).toContainText(title);
|
|
await expect(row).toContainText(PRIMARY_HOST_LABEL);
|
|
} finally {
|
|
await seeded.cleanup();
|
|
}
|
|
});
|
|
|
|
test("selecting an agent result opens its workspace tab", async ({ page }) => {
|
|
const seeded = await seedWorkspace({ repoPrefix: "command-center-agent-navigation-" });
|
|
const title = `cc-navigation-${randomUUID().slice(0, 8)}`;
|
|
|
|
try {
|
|
const agent = await createIdleAgent(seeded.client, {
|
|
cwd: seeded.repoPath,
|
|
workspaceId: seeded.workspaceId,
|
|
title,
|
|
});
|
|
|
|
await gotoAppShell(page);
|
|
const panel = await openCommandCenter(page);
|
|
await panel.getByTestId("command-center-input").fill(title);
|
|
await page.keyboard.press("Enter");
|
|
|
|
await expectAgentTabActive(page, agent.id);
|
|
} finally {
|
|
await seeded.cleanup();
|
|
}
|
|
});
|
|
});
|