Files
orca/tests/e2e/terminal-tab-screenshot.ts
mirror 34fa2cd5ca
Skill update round trip / roundtrip (false, macos-latest, copy, 1.5.17) (push) Canceled after 0s
Skill update round trip / roundtrip (false, macos-latest, symlink, 1.5.17) (push) Canceled after 0s
Skill update round trip / roundtrip (false, ubuntu-latest, copy, 1.5.17) (push) Canceled after 0s
Skill update round trip / roundtrip (false, ubuntu-latest, symlink, 1.5.17) (push) Canceled after 0s
Skill update round trip / roundtrip (false, ubuntu-latest, symlink, latest) (push) Canceled after 0s
Skill update round trip / roundtrip (false, windows-latest, copy, 1.5.17) (push) Canceled after 0s
Skill update round trip / roundtrip (false, windows-latest, symlink, 1.5.17) (push) Canceled after 0s
Skill update round trip / roundtrip (true, macos-latest, copy, 1.5.17) (push) Canceled after 0s
Skill update round trip / roundtrip (true, macos-latest, symlink, 1.5.17) (push) Canceled after 0s
Skill update round trip / roundtrip (true, ubuntu-latest, copy, 1.5.17) (push) Canceled after 0s
Skill update round trip / roundtrip (true, ubuntu-latest, symlink, 1.5.17) (push) Canceled after 0s
Skill update round trip / roundtrip (true, windows-latest, copy, 1.5.17) (push) Canceled after 0s
Skill update round trip / roundtrip (true, windows-latest, symlink, 1.5.17) (push) Canceled after 0s
source snapshot 2026-09-02
2026-09-02 02:03:16 +08:00

22 lines
844 B
TypeScript

import type { Page } from '@stablyai/playwright-test'
import { expect } from './helpers/orca-app'
function tabScreenLocator(page: Page, tabId: string): ReturnType<Page['locator']> {
return page.locator(`[data-terminal-tab-id="${tabId}"] .xterm-screen`).first()
}
export async function captureStableTabScreenshot(page: Page, tabId: string): Promise<Buffer> {
const screen = tabScreenLocator(page, tabId)
await expect(screen).toBeVisible()
let previous = await screen.screenshot({ animations: 'disabled' })
for (let attempt = 0; attempt < 10; attempt += 1) {
await page.waitForTimeout(250)
const next = await screen.screenshot({ animations: 'disabled' })
if (next.equals(previous)) {
return next
}
previous = next
}
throw new Error(`Terminal surface for tab ${tabId} did not stabilize for screenshot`)
}