From 313abd97364a3e368032cda7a7dd7c208e493a58 Mon Sep 17 00:00:00 2001 From: "paseo-bot[bot]" <266920839+paseo-bot[bot]@users.noreply.github.com> Date: Mon, 2 Nov 2026 21:20:07 +0000 Subject: [PATCH] test(app): express History recovery through browser helpers --- .../browser/archived-codex-agent.real.spec.ts | 33 ++++++++++++------- 1 file changed, 22 insertions(+), 11 deletions(-) diff --git a/packages/app/e2e/browser/archived-codex-agent.real.spec.ts b/packages/app/e2e/browser/archived-codex-agent.real.spec.ts index 68ec0d150e..e14c9a7a45 100644 --- a/packages/app/e2e/browser/archived-codex-agent.real.spec.ts +++ b/packages/app/e2e/browser/archived-codex-agent.real.spec.ts @@ -3,7 +3,14 @@ import { tmpdir } from "node:os"; import path from "node:path"; import { test, expect } from "../support/fixtures"; import type { Page } from "@playwright/test"; -import { closeWorkspaceAgentTab, openSessions } from "../support/helpers/archive-tab"; +import { + clickSessionRow, + closeWorkspaceAgentTab, + expectSessionRowArchived, + expectSessionRowNotArchived, + openSessions, +} from "../support/helpers/archive-tab"; +import { expectComposerEditable } from "../support/helpers/composer"; import { assertChatTranscript, cleanupRewindFlow, @@ -41,6 +48,14 @@ async function closeAgentTab(page: Page, agentId: string): Promise { await closeWorkspaceAgentTab(page, agentId); } +async function unarchiveOpenAgent(page: Page): Promise { + await page.getByRole("button", { name: "Unarchive", exact: true }).click(); + await expect(page.getByRole("button", { name: "Unarchive", exact: true })).toHaveCount(0, { + timeout: 60_000, + }); + await expectComposerEditable(page); +} + test.describe("archived Codex agent recovery", () => { test.setTimeout(600_000); @@ -141,17 +156,13 @@ test.describe("archived Codex agent recovery", () => { ]); await closeAgentTab(page, handle.agentId); await openSessions(page); - const row = page.getByTestId(`agent-row-${getServerId()}-${handle.agentId}`); - await expect(row.getByText("Archived", { exact: true })).toBeVisible(); - await row.click(); - await page.getByRole("button", { name: "Unarchive", exact: true }).click(); - await expect(page.getByRole("textbox", { name: "Message agent..." })).toBeVisible({ - timeout: 60_000, - }); + await expectSessionRowArchived(page, "rewind-flow-codex-"); + await clickSessionRow(page, "rewind-flow-codex-"); + await unarchiveOpenAgent(page); await openSessions(page); - await expect(row.getByText("Archived", { exact: true })).toHaveCount(0); - await row.click(); - await expect(page.getByRole("textbox", { name: "Message agent..." })).toBeEditable(); + await expectSessionRowNotArchived(page, "rewind-flow-codex-"); + await clickSessionRow(page, "rewind-flow-codex-"); + await expectComposerEditable(page); } finally { await cleanupRewindFlow({ handle, cwd }); }