* 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
111 lines
3.8 KiB
TypeScript
111 lines
3.8 KiB
TypeScript
import { test } from "../support/fixtures";
|
||
import { closeCommandCenter, openCommandCenter } from "../support/helpers/command-center";
|
||
import {
|
||
applyCommandCenterAgentControls,
|
||
chooseCommandCenterAgentControl,
|
||
expectCommandCenterAgentControlSelected,
|
||
expectFocusedAgentControls,
|
||
expectWorkspaceAgentConfiguration,
|
||
submitDraftAgent,
|
||
waitForDraftComposer,
|
||
} from "../support/helpers/command-center-agent-controls";
|
||
import { clickNewChat, gotoWorkspace } from "../support/helpers/launcher";
|
||
import { openAgentRoute, seedMockAgentWorkspace } from "../support/helpers/mock-agent";
|
||
import { seedWorkspace } from "../support/helpers/seed-client";
|
||
import { getServerId } from "../support/helpers/server-id";
|
||
|
||
const CREATE_AGENT_PREFERENCES_KEY = "@paseo:create-agent-preferences";
|
||
|
||
async function seedMockDraftPreferences(page: import("@playwright/test").Page): Promise<void> {
|
||
await page.addInitScript(
|
||
({ preferencesKey, serverId }) => {
|
||
localStorage.setItem(
|
||
preferencesKey,
|
||
JSON.stringify({
|
||
serverId,
|
||
provider: "mock",
|
||
providerPreferences: {
|
||
mock: {
|
||
model: "five-minute-stream",
|
||
mode: "load-test",
|
||
},
|
||
},
|
||
}),
|
||
);
|
||
},
|
||
{ preferencesKey: CREATE_AGENT_PREFERENCES_KEY, serverId: getServerId() },
|
||
);
|
||
}
|
||
|
||
test.describe("Command Center agent controls", () => {
|
||
test.describe.configure({ timeout: 180_000 });
|
||
|
||
test("changes a running agent setting and preserves its selected row", async ({ page }) => {
|
||
const workspace = await seedMockAgentWorkspace({
|
||
repoPrefix: "command-center-live-controls-",
|
||
title: "Command Center live controls",
|
||
model: "five-minute-stream",
|
||
});
|
||
try {
|
||
// A stale runtime mode makes selecting the provider's supported mode
|
||
// exercise the live setting RPC instead of the selected-row no-op.
|
||
await workspace.client.setAgentMode(workspace.agentId, "legacy-mode");
|
||
await openAgentRoute(page, {
|
||
workspaceId: workspace.workspaceId,
|
||
agentId: workspace.agentId,
|
||
});
|
||
await openCommandCenter(page);
|
||
await chooseCommandCenterAgentControl({
|
||
page,
|
||
query: "load test",
|
||
choice: "Mode › Load test",
|
||
});
|
||
await expectWorkspaceAgentConfiguration(workspace, {
|
||
id: workspace.agentId,
|
||
provider: "mock",
|
||
model: "five-minute-stream",
|
||
modeId: "load-test",
|
||
});
|
||
await openCommandCenter(page);
|
||
await expectCommandCenterAgentControlSelected({
|
||
page,
|
||
query: "load test",
|
||
choice: "Mode › Load test",
|
||
});
|
||
} finally {
|
||
await workspace.cleanup();
|
||
}
|
||
});
|
||
|
||
test("applies draft model and setting choices to the created agent", async ({ page }) => {
|
||
const workspace = await seedWorkspace({ repoPrefix: "command-center-draft-controls-" });
|
||
await seedMockDraftPreferences(page);
|
||
|
||
try {
|
||
await openDraftComposer(page, workspace.workspaceId);
|
||
await applyCommandCenterAgentControls(page, DRAFT_AGENT_CONTROL_CHOICES);
|
||
await closeCommandCenter(page);
|
||
await submitDraftAgent(page, "Create an agent with Command Center draft choices");
|
||
await expectFocusedAgentControls(page, DRAFT_AGENT_CONTROL_CHOICES);
|
||
await expectWorkspaceAgentConfiguration(workspace, {
|
||
provider: "mock",
|
||
model: "ten-second-stream",
|
||
modeId: "load-test",
|
||
});
|
||
} finally {
|
||
await workspace.cleanup();
|
||
}
|
||
});
|
||
});
|
||
|
||
const DRAFT_AGENT_CONTROL_CHOICES = [
|
||
{ query: "ten second stream", choice: "Model › Mock Load Test › Ten second stream" },
|
||
{ query: "load test", choice: "Mode › Load test" },
|
||
] as const;
|
||
|
||
async function openDraftComposer(page: import("@playwright/test").Page, workspaceId: string) {
|
||
await gotoWorkspace(page, workspaceId);
|
||
await clickNewChat(page);
|
||
await waitForDraftComposer(page);
|
||
}
|