* 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
132 lines
4.4 KiB
TypeScript
132 lines
4.4 KiB
TypeScript
import { buildHostAgentDetailRoute, buildHostWorkspaceRoute } from "@/utils/host-routes";
|
|
import { expect, test } from "../support/fixtures";
|
|
import { createIdleAgent, openWorkspaceWithAgents } from "../support/helpers/archive-tab";
|
|
import { waitForTabBar, expectAgentTabActive } from "../support/helpers/launcher";
|
|
import { seedWorkspace } from "../support/helpers/seed-client";
|
|
import { getServerId } from "../support/helpers/server-id";
|
|
|
|
async function pressSettingsToggleShortcut(page: import("@playwright/test").Page) {
|
|
const modifier = process.platform === "darwin" ? "Meta" : "Control";
|
|
await page.keyboard.press(`${modifier}+Comma`);
|
|
}
|
|
|
|
async function expectSendBehavior(
|
|
page: import("@playwright/test").Page,
|
|
expected: "interrupt" | "queue",
|
|
) {
|
|
await expect
|
|
.poll(async () => {
|
|
const raw = await page.evaluate(() => localStorage.getItem("@paseo:app-settings"));
|
|
if (!raw) {
|
|
return null;
|
|
}
|
|
return (JSON.parse(raw) as { sendBehavior?: string }).sendBehavior ?? null;
|
|
})
|
|
.toBe(expected);
|
|
}
|
|
|
|
async function openAgentRouteAndExpectFocused(input: {
|
|
page: import("@playwright/test").Page;
|
|
serverId: string;
|
|
workspaceId: string;
|
|
agentId: string;
|
|
}) {
|
|
await input.page.goto(
|
|
buildHostAgentDetailRoute(input.serverId, input.agentId, input.workspaceId),
|
|
);
|
|
await input.page.waitForURL(
|
|
(url) => url.pathname.includes("/workspace/") && !url.searchParams.has("open"),
|
|
{ timeout: 60_000 },
|
|
);
|
|
await waitForTabBar(input.page);
|
|
await expectAgentTabActive(input.page, input.agentId);
|
|
}
|
|
|
|
test.describe("Settings toggle tab regression", () => {
|
|
test.describe.configure({ timeout: 180_000 });
|
|
|
|
test("toggling settings after changing a setting returns to the same workspace tab", async ({
|
|
page,
|
|
}) => {
|
|
const serverId = getServerId();
|
|
const workspace = await seedWorkspace({ repoPrefix: "settings-toggle-tab-" });
|
|
|
|
try {
|
|
const firstAgent = await createIdleAgent(workspace.client, {
|
|
cwd: workspace.repoPath,
|
|
workspaceId: workspace.workspaceId,
|
|
title: `settings-toggle-a-${Date.now()}`,
|
|
});
|
|
const secondAgent = await createIdleAgent(workspace.client, {
|
|
cwd: workspace.repoPath,
|
|
workspaceId: workspace.workspaceId,
|
|
title: `settings-toggle-b-${Date.now()}`,
|
|
});
|
|
|
|
await openWorkspaceWithAgents(page, [firstAgent, secondAgent]);
|
|
await waitForTabBar(page);
|
|
await expectAgentTabActive(page, secondAgent.id);
|
|
|
|
await pressSettingsToggleShortcut(page);
|
|
await expect(page).toHaveURL(/\/settings\/general$/);
|
|
|
|
await page.getByRole("button", { name: "Queue", exact: true }).click();
|
|
await expectSendBehavior(page, "queue");
|
|
await page.getByRole("button", { name: "Interrupt", exact: true }).click();
|
|
await expectSendBehavior(page, "interrupt");
|
|
|
|
await pressSettingsToggleShortcut(page);
|
|
await expect(page).toHaveURL(buildHostWorkspaceRoute(serverId, workspace.workspaceId));
|
|
await waitForTabBar(page);
|
|
await expectAgentTabActive(page, secondAgent.id);
|
|
|
|
await page.reload();
|
|
await waitForTabBar(page);
|
|
await expectAgentTabActive(page, secondAgent.id);
|
|
} finally {
|
|
await workspace.cleanup();
|
|
}
|
|
});
|
|
|
|
test("refresh after navigating between agent routes keeps the latest agent focused", async ({
|
|
page,
|
|
}) => {
|
|
const serverId = getServerId();
|
|
const workspace = await seedWorkspace({ repoPrefix: "agent-route-refresh-" });
|
|
|
|
try {
|
|
const firstAgent = await createIdleAgent(workspace.client, {
|
|
cwd: workspace.repoPath,
|
|
workspaceId: workspace.workspaceId,
|
|
title: `agent-route-refresh-a-${Date.now()}`,
|
|
});
|
|
const secondAgent = await createIdleAgent(workspace.client, {
|
|
cwd: workspace.repoPath,
|
|
workspaceId: workspace.workspaceId,
|
|
title: `agent-route-refresh-b-${Date.now()}`,
|
|
});
|
|
|
|
await openAgentRouteAndExpectFocused({
|
|
page,
|
|
serverId,
|
|
workspaceId: workspace.workspaceId,
|
|
agentId: firstAgent.id,
|
|
});
|
|
await openAgentRouteAndExpectFocused({
|
|
page,
|
|
serverId,
|
|
workspaceId: workspace.workspaceId,
|
|
agentId: secondAgent.id,
|
|
});
|
|
|
|
for (let attempt = 0; attempt < 5; attempt += 1) {
|
|
await page.reload();
|
|
await waitForTabBar(page);
|
|
await expectAgentTabActive(page, secondAgent.id);
|
|
}
|
|
} finally {
|
|
await workspace.cleanup();
|
|
}
|
|
});
|
|
});
|