From bc710ac7265dbd25bee6fd090cc14784a0932906 Mon Sep 17 00:00:00 2001 From: Tianyi Cui <53024+tianyicui@users.noreply.github.com> Date: Fri, 18 Sep 2026 19:02:10 +0800 Subject: [PATCH] test(web): await the settled branch action in fork snapshots The merged performance/usage preference hides elapsed-time controls by default. The release-only mid-turn fork scenario still waited for "Ran for", so its ARIA check timed out despite a completed child turn. Wait for the visible, enabled branch action belonging to live turn 2. That action requires the settled turn tail and directly exercises the fork affordance this scenario owns. Preserve the existing exact-cut, synthetic closer, resume-header, completed-turn, and streaming checks. Keep the default preference rather than enabling unrelated timing UI. Refresh only the obsolete elapsed-time button in the ARIA expected output. Session JSONL inputs, historical generations, snapshot versions, and production code remain unchanged. The former wait failed locally; the four-case scenario passes in ordinary comparison mode after this fix. --- apps/web/tests/expected/fork-mid-turn/ui.expected.md | 1 - apps/web/tests/fork-mid-turn.e2e.ts | 9 ++++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/apps/web/tests/expected/fork-mid-turn/ui.expected.md b/apps/web/tests/expected/fork-mid-turn/ui.expected.md index 00605bb572..1350afec53 100644 --- a/apps/web/tests/expected/fork-mid-turn/ui.expected.md +++ b/apps/web/tests/expected/fork-mid-turn/ui.expected.md @@ -15,5 +15,4 @@ - button "Good response" - button "Bad response" - button "Branch into a new conversation" -- button "Ran for {{duration}}" - text: {{clock}} diff --git a/apps/web/tests/fork-mid-turn.e2e.ts b/apps/web/tests/fork-mid-turn.e2e.ts index 780cb58e4b..5718043c8a 100644 --- a/apps/web/tests/fork-mid-turn.e2e.ts +++ b/apps/web/tests/fork-mid-turn.e2e.ts @@ -71,8 +71,7 @@ describe('web e2e: exact-boundary fork seeds branch closers and continues', () = scaffold = await launchWebScaffold({ replayFixture: join(replayDir, 'override-only.jsonl'), replayOverride, - // Decode timing is part of the rendered turn tail; keep it non-zero and - // deterministic in both isolated and parallel replay/refresh lanes. + // Use paced chunks for the child continuation's live-stream assertions. paceMs: 5, }) const fixture = await readFile(await selectedSessionFixture(SEED), 'utf8') @@ -174,7 +173,11 @@ describe('web e2e: exact-boundary fork seeds branch closers and continues', () = onTestFailed(() => saveFailureShot(page, 'web-e2e-fork-mid-turn-aria')) await page.getByText(`${DONE_MARKER}.`, { exact: false }).last().waitFor({ timeout: 10_000 }) const flow = page.locator('[data-chat-flow]') - await flow.getByText(/Ran for/).last().waitFor({ timeout: 10_000 }) + const branchAction = flow.locator('[data-turn-tail="2"]').getByRole('button', { + name: 'Branch into a new conversation', exact: true, + }) + await branchAction.waitFor({ timeout: 10_000 }) + expect(await branchAction.isEnabled()).toBe(true) const snapshot = (await captureStableAria(page, '[data-chat-flow]', scaffold.workspaceCwd)) .split(SEED_ID).join('{{seededId}}') await compareOrRefreshGolden(UI_EXPECTED, snapshot, MODE)