Fix 5 remaining Playwright e2e failures
- Wait for ?open= intent consumption before expecting agent tabs - Blur composer before second Meta+t to prevent shortcut swallowing - Use projectDisplayName from daemon instead of computed path label - Increase setup streaming script terminal timeout for CI
This commit is contained in:
@@ -188,6 +188,11 @@ export async function openWorkspaceWithAgents(
|
|||||||
const serverId = getServerId();
|
const serverId = getServerId();
|
||||||
for (const agent of agents) {
|
for (const agent of agents) {
|
||||||
await page.goto(buildHostAgentDetailRoute(serverId, agent.id, agent.cwd));
|
await page.goto(buildHostAgentDetailRoute(serverId, agent.id, agent.cwd));
|
||||||
|
// Wait for the ?open=agent:xxx intent to be consumed by the layout effect.
|
||||||
|
// The layout removes the query param via history.replaceState once processed.
|
||||||
|
await page.waitForFunction(() => !window.location.search.includes("open="), {
|
||||||
|
timeout: 15_000,
|
||||||
|
});
|
||||||
await waitForWorkspaceTabsVisible(page);
|
await waitForWorkspaceTabsVisible(page);
|
||||||
await expectWorkspaceTabVisible(page, agent.id);
|
await expectWorkspaceTabVisible(page, agent.id);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -67,6 +67,8 @@ test.describe("Tab creation", () => {
|
|||||||
.toBe(countBefore + 1);
|
.toBe(countBefore + 1);
|
||||||
const countAfterFirst = await countTabsOfKind(page, "draft");
|
const countAfterFirst = await countTabsOfKind(page, "draft");
|
||||||
|
|
||||||
|
// Blur the composer so the second shortcut isn't swallowed by the focused input
|
||||||
|
await page.evaluate(() => (document.activeElement as HTMLElement)?.blur?.());
|
||||||
await pressNewTabShortcut(page);
|
await pressNewTabShortcut(page);
|
||||||
await expect
|
await expect
|
||||||
.poll(() => countTabsOfKind(page, "draft"), { timeout: 15_000 })
|
.poll(() => countTabsOfKind(page, "draft"), { timeout: 15_000 })
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ test.describe("New workspace flow", () => {
|
|||||||
});
|
});
|
||||||
await expectWorkspaceHeader(page, {
|
await expectWorkspaceHeader(page, {
|
||||||
title: firstWorkspace.workspaceName,
|
title: firstWorkspace.workspaceName,
|
||||||
subtitle: workspaceLabelFromPath(firstRepo.path),
|
subtitle: firstWorkspace.projectDisplayName,
|
||||||
});
|
});
|
||||||
|
|
||||||
await switchWorkspaceViaSidebar({
|
await switchWorkspaceViaSidebar({
|
||||||
@@ -79,7 +79,7 @@ test.describe("New workspace flow", () => {
|
|||||||
});
|
});
|
||||||
await expectWorkspaceHeader(page, {
|
await expectWorkspaceHeader(page, {
|
||||||
title: secondWorkspace.workspaceName,
|
title: secondWorkspace.workspaceName,
|
||||||
subtitle: workspaceLabelFromPath(secondRepo.path),
|
subtitle: secondWorkspace.projectDisplayName,
|
||||||
});
|
});
|
||||||
|
|
||||||
await switchWorkspaceViaSidebar({
|
await switchWorkspaceViaSidebar({
|
||||||
@@ -89,7 +89,7 @@ test.describe("New workspace flow", () => {
|
|||||||
});
|
});
|
||||||
await expectWorkspaceHeader(page, {
|
await expectWorkspaceHeader(page, {
|
||||||
title: firstWorkspace.workspaceName,
|
title: firstWorkspace.workspaceName,
|
||||||
subtitle: workspaceLabelFromPath(firstRepo.path),
|
subtitle: firstWorkspace.projectDisplayName,
|
||||||
});
|
});
|
||||||
} finally {
|
} finally {
|
||||||
await secondRepo.cleanup();
|
await secondRepo.cleanup();
|
||||||
@@ -119,7 +119,7 @@ test.describe("New workspace flow", () => {
|
|||||||
});
|
});
|
||||||
await expectWorkspaceHeader(page, {
|
await expectWorkspaceHeader(page, {
|
||||||
title: openedProject.workspaceName,
|
title: openedProject.workspaceName,
|
||||||
subtitle: workspaceLabelFromPath(tempRepo.path),
|
subtitle: openedProject.projectDisplayName,
|
||||||
});
|
});
|
||||||
|
|
||||||
await clickNewWorkspaceButton(page, {
|
await clickNewWorkspaceButton(page, {
|
||||||
|
|||||||
@@ -226,6 +226,7 @@ test.describe("Workspace setup streaming", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test("launches script terminals after setup completes", async ({ page }) => {
|
test("launches script terminals after setup completes", async ({ page }) => {
|
||||||
|
test.setTimeout(90_000);
|
||||||
const client = await connectWorkspaceSetupClient();
|
const client = await connectWorkspaceSetupClient();
|
||||||
const repo = await createTempGitRepo("setup-svc-ui-", {
|
const repo = await createTempGitRepo("setup-svc-ui-", {
|
||||||
paseoConfig: {
|
paseoConfig: {
|
||||||
@@ -272,9 +273,11 @@ test.describe("Workspace setup streaming", () => {
|
|||||||
// Verify the terminal surface rendered
|
// Verify the terminal surface rendered
|
||||||
await expect(page.getByTestId("terminal-surface").first()).toBeVisible({ timeout: 10_000 });
|
await expect(page.getByTestId("terminal-surface").first()).toBeVisible({ timeout: 10_000 });
|
||||||
|
|
||||||
// Verify the terminal output contains "listening on" (xterm renders text in .xterm-rows)
|
// Verify the terminal output contains "listening on" (xterm renders text in .xterm-rows).
|
||||||
|
// The script is spawned after setup completes and needs time for the shell to start,
|
||||||
|
// the command to be typed, and Node to boot the HTTP server. Give extra time on CI.
|
||||||
await expect(page.locator(".xterm-rows").first()).toContainText("listening on", {
|
await expect(page.locator(".xterm-rows").first()).toContainText("listening on", {
|
||||||
timeout: 30_000,
|
timeout: 60_000,
|
||||||
});
|
});
|
||||||
} finally {
|
} finally {
|
||||||
await client.close();
|
await client.close();
|
||||||
|
|||||||
Reference in New Issue
Block a user