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.
This commit is contained in:
Tianyi Cui committed 2026-09-18 19:02:10 +08:00
1 parent c95d045fdc
commit bc710ac726
2 files changed
+6 -4

No files matched your search

@@ -15,5 +15,4 @@
- button "Good response"
- button "Bad response"
- button "Branch into a new conversation"
- button "Ran for {{duration}}"
- text: {{clock}}
+6 -3
View File
@@ -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)