navigation-panes.e2e.ts 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410
  1. // Web e2e scenarios: navigation & panes — the Trajectory view and timing
  2. // overview, its local details inspector, and sidebar search, all over ONE rich
  3. // two-turn seeded fixture rendered purely from the log (the seeded-history
  4. // pattern: zero model calls in replay, so every surface here is the client
  5. // fold + host history RPC, not replay binding). The seed is recorded live
  6. // under the standard discipline: turn 1 produces a bash call plus two
  7. // parallel reads in one assistant message (tool-call density for the
  8. // trajectory ledger/timing lanes), turn 2 a markdown-rich reply.
  9. import { mkdir, readFile, writeFile } from 'node:fs/promises'
  10. import { fileURLToPath } from 'node:url'
  11. import { join } from 'node:path'
  12. import type { Browser, Page, Response } from 'playwright'
  13. import { chromium } from 'playwright'
  14. import { afterAll, afterEach, beforeAll, beforeEach, describe, expect, it, onTestFailed } from 'vitest'
  15. import { parseSessionLog } from '@deepseek-ai/dsh-llm-replay'
  16. import type { SessionEvent } from '@deepseek-ai/dsh-session'
  17. import {
  18. assertFixtureInventory, captureStableAria, compareOrRefreshGolden, fixtureUserPrompts,
  19. launchWebScaffold, recordFixture, seedSession, watchConsole, webSnapshotMode, type WebScaffold,
  20. } from './scaffold.ts'
  21. import { newEnglishPage, saveFailureShot } from './support.ts'
  22. const SNAPSHOT_DIR = fileURLToPath(new URL('./snapshots/navigation-panes', import.meta.url))
  23. const SEED = join(SNAPSHOT_DIR, 'seed.jsonl')
  24. const TRAJECTORY_EXPECTED = join(SNAPSHOT_DIR, 'trajectory.expected.md')
  25. const SEARCH_EXPECTED = join(SNAPSHOT_DIR, 'search-results.expected.md')
  26. const TERMINAL_EXPECTED = join(SNAPSHOT_DIR, 'terminal-card.expected.md')
  27. const MODE = webSnapshotMode()
  28. const SEED_ID = 'navigation-panes-web-e2e'
  29. // Turn 1 leads with a distinctive word: the session-title fallback takes the
  30. // first words of the first message, so the sidebar-search scenario has a
  31. // known-matching query ('navscenario') without depending on a live title call.
  32. const PROMPT_TURN1 = 'NavScenario: first run bash to print exactly NAVIGATION_OK, then read nav-a.md and nav-b.md using two read calls in ONE assistant message, then reply with the single word FIRST_DONE and stop.'
  33. const PROMPT_TURN2 = 'Reply in markdown with: a level-2 heading "Navigation Summary", a bulleted list of exactly two items, and a fenced code block containing echo WATERFALL. Then stop.'
  34. async function baselineResponse(
  35. page: Page,
  36. method: 'session.list' | 'workspace.list',
  37. ): Promise<Response> {
  38. return page.waitForResponse(response => (
  39. response.request().method() === 'POST'
  40. && new URL(response.url()).pathname === `/api/${method}`
  41. ), { timeout: 30_000 })
  42. }
  43. async function assertBaselineSucceeded(response: Response, method: string): Promise<void> {
  44. expect(response.ok(), `${method} baseline HTTP response`).toBe(true)
  45. const body = await response.json() as { result?: { ok?: unknown } }
  46. expect(body.result?.ok, `${method} baseline RPC result`).toBe(true)
  47. }
  48. async function ensureSeedOpen(page: Page): Promise<void> {
  49. const chat = page.getByRole('tab', { name: 'Chat', exact: true })
  50. const search = page.getByPlaceholder('Search name, keywords', { exact: false })
  51. if (await chat.count() === 0) {
  52. await search.fill('WATERFALL')
  53. const result = page.getByRole('tree', { name: 'Search results' }).getByRole('treeitem')
  54. await expect.poll(() => result.count(), { timeout: 15_000 }).toBe(1)
  55. await result.click()
  56. await chat.waitFor({ timeout: 15_000 })
  57. }
  58. await chat.click()
  59. await page.getByText('FIRST_DONE', { exact: true }).waitFor({ timeout: 15_000 })
  60. if (await search.inputValue() !== '') {
  61. await search.fill('')
  62. await expect.poll(() => search.inputValue(), { timeout: 5_000 }).toBe('')
  63. }
  64. }
  65. describe('web e2e: navigation & panes over a rich seeded session', () => {
  66. let scaffold: WebScaffold
  67. let browser: Browser
  68. let page: Page
  69. let tripwire: ReturnType<typeof watchConsole> = { warnings: [], pageErrors: [] }
  70. let slotErrors: string[] = []
  71. beforeAll(async () => {
  72. scaffold = await launchWebScaffold({})
  73. // The workspace-aware flow runs sessions in <workspaceCwd>/workspace;
  74. // the read targets must live in that session cwd (pre-creation is safe:
  75. // create-by-name adopts an existing directory).
  76. const sessionCwd = join(scaffold.workspaceCwd, 'workspace')
  77. await mkdir(sessionCwd, { recursive: true })
  78. await writeFile(join(sessionCwd, 'nav-a.md'), '# alpha nav\n')
  79. await writeFile(join(sessionCwd, 'nav-b.md'), '# beta nav\n')
  80. if (MODE !== 'record') {
  81. const raw = await readFile(SEED, 'utf8')
  82. expect(fixtureUserPrompts(raw), 'seed fixture must carry exactly the two drive prompts')
  83. .toEqual([PROMPT_TURN1, PROMPT_TURN2])
  84. await seedSession(scaffold, raw, SEED_ID)
  85. }
  86. browser = await chromium.launch()
  87. }, 120_000)
  88. beforeEach(async () => {
  89. page = await newEnglishPage(browser)
  90. tripwire = watchConsole(page)
  91. slotErrors = []
  92. page.on('console', (message) => {
  93. if (message.type() === 'error' && /slot entry crashed/i.test(message.text())) {
  94. slotErrors.push(message.text())
  95. }
  96. })
  97. // Initial navigation and list ownership settle only after both independent
  98. // RPC baselines succeed; arm before navigation so neither response is missed.
  99. const sessionBaseline = baselineResponse(page, 'session.list')
  100. const workspaceBaseline = baselineResponse(page, 'workspace.list')
  101. const [, sessionResponse, workspaceResponse] = await Promise.all([
  102. page.goto(scaffold.baseUrl, { waitUntil: 'load' }),
  103. sessionBaseline,
  104. workspaceBaseline,
  105. ])
  106. await Promise.all([
  107. assertBaselineSucceeded(sessionResponse, 'session.list'),
  108. assertBaselineSucceeded(workspaceResponse, 'workspace.list'),
  109. ])
  110. await page.waitForSelector('[class*="frame"]', { timeout: 30_000 })
  111. // The frame mounts before the asynchronous session-list baseline lands.
  112. // Search must target the settled seeded row, not the startup input that
  113. // the ready projection replaces.
  114. await page.getByText('1 session', { exact: true }).waitFor({ timeout: 30_000 })
  115. }, 120_000)
  116. afterEach(async () => {
  117. const failures: unknown[] = []
  118. try {
  119. expect({
  120. pageErrors: tripwire.pageErrors,
  121. slotErrors,
  122. warnings: tripwire.warnings,
  123. }).toEqual({
  124. pageErrors: [],
  125. slotErrors: [],
  126. warnings: [],
  127. })
  128. } catch (error) {
  129. failures.push(error)
  130. }
  131. await page?.close().catch((error: unknown) => failures.push(error))
  132. if (failures.length === 1) throw failures[0]
  133. if (failures.length > 1) throw new AggregateError(failures, 'navigation case cleanup failed')
  134. })
  135. afterAll(async () => {
  136. const failures: unknown[] = []
  137. await browser?.close().catch((error: unknown) => failures.push(error))
  138. await scaffold?.close().catch((error: unknown) => failures.push(error))
  139. if (failures.length === 1) throw failures[0]
  140. if (failures.length > 1) throw new AggregateError(failures, 'navigation e2e cleanup failed')
  141. })
  142. it.skipIf(MODE !== 'record')('records the two-turn seed live through the composer', async () => {
  143. onTestFailed(() => saveFailureShot(page, 'web-e2e-navigation-record'))
  144. const input = page.locator('textarea').first()
  145. await input.waitFor({ timeout: 10_000 })
  146. let sessionId: Awaited<ReturnType<WebScaffold['whenTurnSettled']>> | undefined
  147. for (const prompt of [PROMPT_TURN1, PROMPT_TURN2]) {
  148. const settled = scaffold.whenTurnSettled()
  149. // Turn 2 types into the same composer once turn 1 unlocks it.
  150. await expect.poll(() => input.isEnabled(), { timeout: 15_000 }).toBe(true)
  151. await input.fill(prompt)
  152. await input.press('Enter')
  153. sessionId = await settled
  154. }
  155. await recordFixture(scaffold, sessionId!, SEED)
  156. // Fixture honesty: the recording must carry the shape the replay
  157. // scenarios assert on — three calls in turn 1 and two closed turns.
  158. const recorded = parseSessionLog(await readFile(SEED, 'utf8'))
  159. expect(recorded.filter(e => e.type === 'turn/end')).toHaveLength(2)
  160. const calls = recorded.filter((e): e is SessionEvent & { data: { name: string } } => e.type === 'tool/call')
  161. expect(calls.map(e => e.data.name).sort()).toEqual(['bash', 'read', 'read'])
  162. }, 400_000)
  163. it.skipIf(MODE === 'record')('finds an unopened seeded session by message content and opens it', async () => {
  164. onTestFailed(() => saveFailureShot(page, 'web-e2e-navigation-search'))
  165. // The API baselines can settle before React commits their projection. The
  166. // seeded count is the final user-visible barrier before editing search.
  167. await page.getByText('1 session', { exact: true }).waitFor({ timeout: 30_000 })
  168. const search = page.getByPlaceholder('Search name, keywords', { exact: false })
  169. // The cold row has not been opened, so only the persisted log can satisfy
  170. // this query. First search lazily reconciles the SQLite content index.
  171. await search.fill('zzzqx-no-such-session')
  172. await page.getByText('No matching sessions').waitFor({ timeout: 30_000 })
  173. await expect.poll(
  174. () => page.getByRole('tree', { name: 'Search results' }).getByRole('treeitem').count(),
  175. { timeout: 10_000 },
  176. ).toBe(0)
  177. await search.fill('WATERFALL')
  178. const resultTree = page.getByRole('tree', { name: 'Search results' })
  179. const result = resultTree.getByRole('treeitem')
  180. await expect.poll(() => result.count(), { timeout: 30_000 }).toBe(1)
  181. await expect.poll(() => result.getByText('WATERFALL', { exact: false }).count(), {
  182. timeout: 10_000,
  183. }).toBeGreaterThanOrEqual(1)
  184. const snapshot = (await captureStableAria(page, '[class*="listArea"]', scaffold.workspaceCwd))
  185. .split(SEED_ID).join('{{seededId}}')
  186. await compareOrRefreshGolden(SEARCH_EXPECTED, snapshot, MODE)
  187. await result.click()
  188. // Search navigation addresses the session, not a specific event, and the
  189. // query remains until the user explicitly clears it.
  190. await expect.poll(() => search.inputValue(), { timeout: 5_000 }).toBe('WATERFALL')
  191. await expect.poll(() => page.getByText('FIRST_DONE', { exact: true }).count(), { timeout: 15_000 }).toBeGreaterThanOrEqual(1)
  192. await expect.poll(() => page.getByRole('heading', { name: 'Navigation Summary' }).count(), { timeout: 15_000 }).toBe(1)
  193. await page.getByRole('button', { name: 'Clear search' }).click()
  194. await expect.poll(() => search.inputValue(), { timeout: 5_000 }).toBe('')
  195. await expect.poll(() => page.locator('[role="treeitem"]').count(), { timeout: 10_000 }).toBeGreaterThanOrEqual(1)
  196. }, 90_000)
  197. it.skipIf(MODE === 'record')('renders the trajectory ledger and opens its local record inspector', async () => {
  198. onTestFailed(() => saveFailureShot(page, 'web-e2e-navigation-trajectory'))
  199. await ensureSeedOpen(page)
  200. await page.getByRole('tab', { name: 'Trajectory' }).click()
  201. await page.waitForTimeout(100)
  202. const overlayLayout = await page.getByRole('table').evaluate((table) => {
  203. const host = table.closest('[data-conversation-scroll]')
  204. const seat = host?.querySelector('[data-composer-seat]') ?? null
  205. const pane = table.parentElement
  206. return {
  207. hostPosition: host === null ? null : getComputedStyle(host).position,
  208. paneOverflowX: pane === null ? null : getComputedStyle(pane).overflowX,
  209. paneScrollableWidth: pane === null ? null : pane.scrollWidth - pane.clientWidth,
  210. seatPosition: seat === null ? null : getComputedStyle(seat).position,
  211. }
  212. })
  213. expect(overlayLayout).toEqual({
  214. hostPosition: 'relative',
  215. paneOverflowX: 'hidden',
  216. paneScrollableWidth: 0,
  217. seatPosition: 'absolute',
  218. })
  219. expect({
  220. pageErrors: tripwire.pageErrors,
  221. slotErrors,
  222. warnings: tripwire.warnings,
  223. }).toEqual({
  224. pageErrors: [],
  225. slotErrors: [],
  226. warnings: [],
  227. })
  228. // Turn rules partition the ledger without restoring a separate header row.
  229. await expect.poll(() => page.locator('tr[data-turn-start="true"]').count(), { timeout: 15_000 }).toBe(2)
  230. await expect.poll(() => page.getByRole('columnheader').count(), { timeout: 10_000 }).toBe(0)
  231. await page.locator('tr[data-kind="tool"]').first().click()
  232. const details = page.getByRole('complementary', { name: 'Event details' })
  233. await expect.poll(() => details.count(), { timeout: 10_000 }).toBe(1)
  234. expect(await details.getByRole('tabpanel').evaluate(panel => getComputedStyle(panel).overflowX))
  235. .toBe('hidden')
  236. await page.evaluate(() => { document.body.setAttribute('data-ds-dark-theme', '') })
  237. const darkSummarySurfaces = await details.getByRole('heading', { name: 'Payload' }).evaluate(heading => ({
  238. heading: getComputedStyle(heading).backgroundColor,
  239. panel: getComputedStyle(heading.closest('[aria-label="Event details"]')!).backgroundColor,
  240. }))
  241. expect(darkSummarySurfaces.heading).toBe(darkSummarySurfaces.panel)
  242. await page.evaluate(() => { document.body.removeAttribute('data-ds-dark-theme') })
  243. await page.getByRole('tab', { name: 'Result' }).click()
  244. await expect.poll(() => page.getByText('NAVIGATION_OK', { exact: false }).count(), { timeout: 10_000 }).toBeGreaterThanOrEqual(1)
  245. const assistantSpan = page.locator('[data-timeline-span="message"][data-assistant-timing="true"]').first()
  246. await assistantSpan.hover()
  247. const timingTooltip = page.getByRole('tooltip')
  248. await timingTooltip.waitFor({ timeout: 5_000 })
  249. await expect.poll(() => timingTooltip.textContent(), { timeout: 5_000 }).toMatch(/TTFT .* Decoding/)
  250. const assistantTimingStyle = await assistantSpan.evaluate(node => ({
  251. background: getComputedStyle(node).backgroundImage,
  252. ttft: getComputedStyle(node).getPropertyValue('--trajectory-assistant-ttft'),
  253. }))
  254. expect(assistantTimingStyle.background).toContain('linear-gradient')
  255. expect(assistantTimingStyle.ttft).toMatch(/%$/)
  256. const snapshot = (await captureStableAria(page, '[class*="viewArea"]', scaffold.workspaceCwd))
  257. .split(SEED_ID).join('{{seededId}}')
  258. await compareOrRefreshGolden(TRAJECTORY_EXPECTED, snapshot, MODE)
  259. await details.getByRole('button', { name: 'Close details' }).click()
  260. }, 60_000)
  261. it.skipIf(MODE === 'record')('focuses the ledger by dragging an overview interval', async () => {
  262. onTestFailed(() => saveFailureShot(page, 'web-e2e-navigation-timeline'))
  263. await ensureSeedOpen(page)
  264. await page.getByRole('tab', { name: 'Trajectory' }).click()
  265. const plot = page.getByLabel('Timeline overview; drag horizontally to focus events')
  266. await plot.waitFor({ timeout: 15_000 })
  267. const before = await page.locator('tr[data-kind]').count()
  268. const box = await plot.boundingBox()
  269. if (box === null) throw new Error('trajectory timeline plot has no layout box')
  270. await page.mouse.move(box.x + box.width * 0.55, box.y + box.height / 2)
  271. await page.mouse.down()
  272. await page.mouse.move(box.x + box.width * 0.9, box.y + box.height / 2)
  273. await page.mouse.up()
  274. await expect.poll(() => page.locator('tr[data-timeline-focus="outside"]').count(), { timeout: 10_000 })
  275. .toBeGreaterThan(0)
  276. await expect.poll(() => page.locator('tr[data-kind]').count(), { timeout: 10_000 }).toBe(before)
  277. await plot.click({ button: 'right' })
  278. await expect.poll(() => page.locator('tr[data-timeline-focus]').count(), { timeout: 10_000 }).toBe(0)
  279. }, 60_000)
  280. it.skipIf(MODE === 'record')('bash and file-path rows leave the default details column closed', async () => {
  281. onTestFailed(() => saveFailureShot(page, 'web-e2e-navigation-details'))
  282. await ensureSeedOpen(page)
  283. const bashRow = page.locator('[data-sample="bash"]').first()
  284. await bashRow.waitFor({ timeout: 15_000 })
  285. const frame = page.locator('[style*="grid-template-columns"]').first()
  286. expect(await frame.getAttribute('data-details-collapsed')).toBe('true')
  287. // The row click is the card's expand toggle (unified tool-row
  288. // interaction); it must not drive layout geometry either way.
  289. await bashRow.click()
  290. await expect.poll(() => frame.getAttribute('data-details-collapsed'), { timeout: 5_000 }).toBe('true')
  291. // The card's own controls are outside the summary row and must not open
  292. // details either — the expanded terminal card is read in place.
  293. await page.locator('[data-sample="bash"] ~ div [data-terminal] [class*="_copyButton_"]').first().click()
  294. await expect.poll(() => frame.getAttribute('data-details-collapsed'), { timeout: 5_000 }).toBe('true')
  295. // Read summaries are host-open file links; they also must not open details.
  296. const fileLink = page.locator('[data-variant="read"] button').first()
  297. await fileLink.waitFor({ timeout: 10_000 })
  298. await fileLink.click()
  299. await expect.poll(() => frame.getAttribute('data-details-collapsed'), { timeout: 5_000 }).toBe('true')
  300. }, 60_000)
  301. it.skipIf(MODE === 'record')('renders the bash row as a terminal card in the real browser', async () => {
  302. onTestFailed(() => saveFailureShot(page, 'web-e2e-navigation-terminal'))
  303. await ensureSeedOpen(page)
  304. // The card is expand-gated behind the whole-row toggle (the unified
  305. // tool-row interaction): open it if this fresh view leaves it collapsed.
  306. // Expanded, the recorded command's own output sits in the message flow,
  307. // derived from the logged call/result presentations alone.
  308. const bashRow = page.locator('[data-sample="bash"]').first()
  309. await bashRow.waitFor({ timeout: 15_000 })
  310. if (await bashRow.getAttribute('aria-expanded') !== 'true') await bashRow.click()
  311. const card = page.locator('[data-sample="bash"] ~ div [data-terminal]').first()
  312. await card.waitFor({ timeout: 15_000 })
  313. // Real layout, not jsdom's stub (which computes no geometry at all):
  314. // squeeze the output pane below its content width and the line must keep
  315. // its single row and overflow sideways instead of folding. Soft-wrapping
  316. // here is what shredded the column alignment this card exists to hold.
  317. const layout = await card.locator('[class*="_output_"]').first().evaluate((node) => {
  318. const pane = node as HTMLElement
  319. const row = pane.querySelector<HTMLElement>('[class*="_line_"]')
  320. if (row === null) throw new Error('output pane has no line')
  321. const before = row.offsetHeight
  322. const restore = pane.style.width
  323. pane.style.width = '8px'
  324. const squeezed = { wrapped: row.offsetHeight > before, scrollsSideways: pane.scrollWidth > pane.clientWidth }
  325. pane.style.width = restore
  326. return { whiteSpace: getComputedStyle(row).whiteSpace, overflowX: getComputedStyle(pane).overflowX, ...squeezed }
  327. })
  328. expect(layout).toEqual({ whiteSpace: 'pre', overflowX: 'auto', wrapped: false, scrollsSideways: true })
  329. // The run-state dot's color is the whole point of it and is the one thing
  330. // jsdom cannot report: --dsw-* tokens resolve only against the real theme
  331. // stylesheet. This command settled cleanly, so the dot must be the green
  332. // success token — a red one here would read as a failed command.
  333. const dot = await card.locator('[class*="_runState_"][data-state]').first().evaluate((node) => {
  334. // The token lives on body, so the probe must sit in the same cascade.
  335. const probe = document.createElement('span')
  336. probe.style.color = 'var(--dsw-alias-state-success-primary)'
  337. document.body.appendChild(probe)
  338. const success = getComputedStyle(probe).color
  339. probe.remove()
  340. return {
  341. state: node.getAttribute('data-state'),
  342. color: getComputedStyle(node as HTMLElement).color,
  343. success,
  344. // One label per card (the state is the call's), so it hangs off the
  345. // prompt column rather than the row the dot sits in.
  346. label: node.closest('[class*="_prompt_"]')?.querySelector('[class*="_runStateLabel_"]')?.textContent ?? null,
  347. // The dot precedes the prompt label in document order, which is what
  348. // puts it to the left of the `$`.
  349. beforePrompt: node.compareDocumentPosition(node.parentElement!.querySelector('[class*="_cwd_"]')!)
  350. === Node.DOCUMENT_POSITION_FOLLOWING,
  351. // The dot lives in the card's OWN left padding, so it sits inside the
  352. // card box yet left of the prompt text. Owning the reservation as padding
  353. // rather than margin is what keeps a consumer's own margin from
  354. // cancelling it and letting a container clip the dot — geometry jsdom
  355. // cannot compute.
  356. insideCard: (node as HTMLElement).getBoundingClientRect().left
  357. >= (node.closest('[data-terminal]')?.getBoundingClientRect().left ?? Infinity),
  358. leftOfPrompt: (node as HTMLElement).getBoundingClientRect().right
  359. <= (node.closest('[class*="_promptLine_"]')
  360. ?.querySelector('[class*="_cwd_"]')
  361. ?.getBoundingClientRect().left ?? -Infinity),
  362. }
  363. })
  364. expect(dot.state).toBe('done')
  365. expect(dot.label).toBe('Done')
  366. expect(dot.beforePrompt).toBe(true)
  367. expect(dot.insideCard).toBe(true)
  368. expect(dot.leftOfPrompt).toBe(true)
  369. // Resolved through the theme token, not a literal hex in the component.
  370. expect(dot.success).toMatch(/^rgb/)
  371. expect(dot.color).toBe(dot.success)
  372. // Golden of the card at rest — captured before the copy click, whose
  373. // confirmation label self-reverts on a timer and would not hold still.
  374. const snapshot = (await captureStableAria(page, '[data-terminal]', scaffold.workspaceCwd))
  375. .split(SEED_ID).join('{{seededId}}')
  376. await compareOrRefreshGolden(TERMINAL_EXPECTED, snapshot, MODE)
  377. // Copy writes the raw output through the browser's own clipboard, which in
  378. // a real page is the async Clipboard API rather than the jsdom fallback.
  379. await page.context().grantPermissions(['clipboard-read', 'clipboard-write'])
  380. await card.locator('[class*="_copyButton_"]').first().click()
  381. await expect.poll(() => card.locator('[class*="_copyButton_"]').first().textContent(), { timeout: 5_000 })
  382. .toBe('Copied')
  383. expect(await page.evaluate(() => navigator.clipboard.readText())).toContain('NAVIGATION_OK')
  384. }, 60_000)
  385. it.skipIf(MODE === 'record')('keeps the recorded fixture inventory exact', async () => {
  386. await assertFixtureInventory(SNAPSHOT_DIR, [
  387. 'seed.jsonl', 'search-results.expected.md', 'trajectory.expected.md',
  388. 'terminal-card.expected.md',
  389. ])
  390. })
  391. })