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:
Mohamed Boudra
2026-04-14 10:19:42 +07:00
parent 19585709d5
commit e647c61fb5
4 changed files with 16 additions and 6 deletions
+5
View File
@@ -188,6 +188,11 @@ export async function openWorkspaceWithAgents(
const serverId = getServerId();
for (const agent of agents) {
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 expectWorkspaceTabVisible(page, agent.id);
}
+2
View File
@@ -67,6 +67,8 @@ test.describe("Tab creation", () => {
.toBe(countBefore + 1);
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 expect
.poll(() => countTabsOfKind(page, "draft"), { timeout: 15_000 })
+4 -4
View File
@@ -65,7 +65,7 @@ test.describe("New workspace flow", () => {
});
await expectWorkspaceHeader(page, {
title: firstWorkspace.workspaceName,
subtitle: workspaceLabelFromPath(firstRepo.path),
subtitle: firstWorkspace.projectDisplayName,
});
await switchWorkspaceViaSidebar({
@@ -79,7 +79,7 @@ test.describe("New workspace flow", () => {
});
await expectWorkspaceHeader(page, {
title: secondWorkspace.workspaceName,
subtitle: workspaceLabelFromPath(secondRepo.path),
subtitle: secondWorkspace.projectDisplayName,
});
await switchWorkspaceViaSidebar({
@@ -89,7 +89,7 @@ test.describe("New workspace flow", () => {
});
await expectWorkspaceHeader(page, {
title: firstWorkspace.workspaceName,
subtitle: workspaceLabelFromPath(firstRepo.path),
subtitle: firstWorkspace.projectDisplayName,
});
} finally {
await secondRepo.cleanup();
@@ -119,7 +119,7 @@ test.describe("New workspace flow", () => {
});
await expectWorkspaceHeader(page, {
title: openedProject.workspaceName,
subtitle: workspaceLabelFromPath(tempRepo.path),
subtitle: openedProject.projectDisplayName,
});
await clickNewWorkspaceButton(page, {
@@ -226,6 +226,7 @@ test.describe("Workspace setup streaming", () => {
});
test("launches script terminals after setup completes", async ({ page }) => {
test.setTimeout(90_000);
const client = await connectWorkspaceSetupClient();
const repo = await createTempGitRepo("setup-svc-ui-", {
paseoConfig: {
@@ -272,9 +273,11 @@ test.describe("Workspace setup streaming", () => {
// Verify the terminal surface rendered
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", {
timeout: 30_000,
timeout: 60_000,
});
} finally {
await client.close();