Skip to content

Commit 3bea5b1

Browse files
authored
test(e2e): wait for resolved context window in visual chat scenario (#1941)
The chat visual scenario captured its screenshot before the selected model's metadata had resolved. Router models arrive asynchronously over the extension-host message channel, so the context-window readout briefly rendered the `1` fallback, producing non-deterministic screenshots. Wait for a resolved context window before capturing. Failing runs: - https://github.com/Zoo-Code-Org/Zoo-Code/actions/runs/37288898485/job/111694365121 - https://github.com/Zoo-Code-Org/Zoo-Code/actions/runs/37287279414/job/111689058401 - https://github.com/Zoo-Code-Org/Zoo-Code/actions/runs/37347520689/job/111889755914
1 parent 9af61f8 commit 3bea5b1

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

‎apps/vscode-e2e/src/visual/electron.visual.ts‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,17 @@ for (const scenario of scenarios) {
236236
await expect.poll(() => contentFrame.evaluate(() => document.activeElement === document.body)).toBe(true)
237237
await contentFrame.evaluate(() => document.fonts.ready)
238238

239+
// The selected model's metadata resolves asynchronously: router models
240+
// arrive over the extension-host message channel after the webview
241+
// launches. Until they land, the context-window readout renders the `1`
242+
// fallback (see TaskHeader's `model?.contextWindow || 1`)
243+
// Wait for a resolved context window so the screenshot is deterministic.
244+
if (scenario.scene === "chat") {
245+
await expect(contentFrame.locator('[data-testid="context-window-size"]')).not.toHaveText("1", {
246+
timeout: 60_000,
247+
})
248+
}
249+
239250
const sidebar = running.page.locator(".part.sidebar")
240251
await expect(sidebar).toBeVisible()
241252

0 commit comments

Comments
 (0)