test: capture cmd launch PTY writes and startup state

This commit is contained in:
Neil
2026-09-06 01:50:29 -07:00
parent fdabb12b02
commit 45b2c598fb
2 changed files with 16 additions and 4 deletions
@@ -56,9 +56,8 @@ jobs:
# grep and worker flags positional filters instead of CLI options.
run: >-
pnpm run test:e2e
tests/e2e/golden-fresh-profile-terminal.spec.ts
tests/e2e/golden-tab-bar-agent-launch.spec.ts
--repeat-each=3
--grep "under cmd.exe"
--workers=1
- name: Upload Playwright traces
+15 -2
View File
@@ -1,3 +1,4 @@
import { installTerminalPtyWriteSpy, readTerminalPtyWriteEntries } from './helpers/terminal-pty-write-spy'
import type { Page } from '@stablyai/playwright-test'
import { expect, test } from './helpers/orca-app'
import {
@@ -54,12 +55,24 @@ test.describe('Windows runtimes', () => {
for (const shell of WINDOWS_SHELLS) {
test(`tab-bar + menu launches an agent under ${shell} @tab-bar-agent-launch-golden`, async ({
orcaPage
orcaPage, electronApp
}) => {
await installTerminalPtyWriteSpy(electronApp)
await openWorkspaceTerminal(orcaPage)
// Each shell family requires different launch-command quoting.
await configureGoldenStubAgent(orcaPage, { agent: 'codex', windowsShell: shell })
await launchGoldenStubAgentFromNewTab(orcaPage)
try {
await launchGoldenStubAgentFromNewTab(orcaPage)
} catch (error) {
console.error('[cmd-pty-writes]', JSON.stringify(await readTerminalPtyWriteEntries(electronApp)))
console.error('[cmd-startup-state]', JSON.stringify(await orcaPage.evaluate(() => {
const state = window.__store!.getState()
const tabId = state.activeTabId
const tab = Object.values(state.tabsByWorktree).flat().find(tab => tab.id === tabId)
return { tab, pending: tabId ? state.pendingStartupByTabId?.[tabId] : null }
})))
throw error
}
expect(await getTerminalContent(orcaPage)).toContain(GOLDEN_STUB_READY_MARKER)
})