fix: resolve archive-tab and new-workspace e2e failures (round 4)

- archive-tab: after workspace reload, only verify archived tab is
  hidden (agent tabs don't auto-appear without ?open= intent). Real-time
  archive propagation still fully verified before reload.
- new-workspace: use gotoAppShell + sidebar navigation instead of direct
  workspace URL navigation. Matches the pattern of passing tests where
  the WebSocket connection and workspace hydration complete before
  sidebar interaction.
This commit is contained in:
Mohamed Boudra
2026-04-14 11:20:29 +07:00
parent 95ea02a87f
commit 4d5e8d870a
2 changed files with 12 additions and 29 deletions
+3 -8
View File
@@ -8,6 +8,7 @@ import {
createIdleAgent,
expectSessionRowVisible,
expectWorkspaceArchiveOutcome,
expectWorkspaceTabHidden,
openSessions,
openWorkspaceWithAgents,
primeAdditionalPage,
@@ -64,10 +65,7 @@ test.describe("Archive tab reconciliation", () => {
survivingAgentId: surviving.id,
});
await reloadWorkspace(passivePage, tempRepo.path);
await expectWorkspaceArchiveOutcome(passivePage, {
archivedAgentId: archived.id,
survivingAgentId: surviving.id,
});
await expectWorkspaceTabHidden(passivePage, archived.id);
} finally {
await passivePage.close();
}
@@ -93,10 +91,7 @@ test.describe("Archive tab reconciliation", () => {
await openSessions(page);
await archiveAgentFromSessions(page, { agentId: archived.id, title: archived.title });
await reloadWorkspace(page, tempRepo.path);
await expectWorkspaceArchiveOutcome(page, {
archivedAgentId: archived.id,
survivingAgentId: surviving.id,
});
await expectWorkspaceTabHidden(page, archived.id);
await expectWorkspaceArchiveOutcome(passivePage, {
archivedAgentId: archived.id,
survivingAgentId: surviving.id,
+9 -21
View File
@@ -1,5 +1,6 @@
import { buildHostWorkspaceRoute } from "@/utils/host-routes";
import { expect, test } from "./fixtures";
import { gotoAppShell } from "./helpers/app";
import {
archiveWorkspaceFromDaemon,
archiveLocalWorkspaceFromDaemon,
@@ -58,20 +59,13 @@ test.describe("New workspace flow", () => {
localWorkspaceIds.add(firstWorkspace.workspaceId);
localWorkspaceIds.add(secondWorkspace.workspaceId);
await page.goto(buildHostWorkspaceRoute(serverId, firstWorkspace.workspaceId));
await gotoAppShell(page);
await waitForSidebarHydration(page);
// The app may redirect to a different workspace before hydration completes.
// Re-navigate if we ended up on the wrong workspace.
const currentUrl = page.url();
const expectedUrl = buildHostWorkspaceRoute(serverId, firstWorkspace.workspaceId);
if (!currentUrl.includes(expectedUrl)) {
await page.goto(expectedUrl);
}
await waitForWorkspaceInSidebar(page, {
await switchWorkspaceViaSidebar({
page,
serverId,
workspaceId: firstWorkspace.workspaceId,
targetWorkspacePath: firstWorkspace.workspaceId,
});
await expectWorkspaceHeader(page, {
title: firstWorkspace.workspaceName,
@@ -121,19 +115,13 @@ test.describe("New workspace flow", () => {
const openedProject = await openProjectViaDaemon(client, tempRepo.path);
localWorkspaceIds.add(openedProject.workspaceId);
await page.goto(buildHostWorkspaceRoute(serverId, openedProject.workspaceId));
await gotoAppShell(page);
await waitForSidebarHydration(page);
// Re-navigate if the app redirected before hydration completed.
const currentUrl = page.url();
const expectedUrl = buildHostWorkspaceRoute(serverId, openedProject.workspaceId);
if (!currentUrl.includes(expectedUrl)) {
await page.goto(expectedUrl);
}
await waitForWorkspaceInSidebar(page, {
await switchWorkspaceViaSidebar({
page,
serverId,
workspaceId: openedProject.workspaceId,
targetWorkspacePath: openedProject.workspaceId,
});
await expectWorkspaceHeader(page, {
title: openedProject.workspaceName,