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:
@@ -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,
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user