feat(win-update-e2e): dismiss post-creation overlays, use the created terminal directly

This commit is contained in:
Jinwoo Hong
2026-07-06 18:11:10 -04:00
parent 776be625c8
commit 0a13fc0dad
2 changed files with 22 additions and 4 deletions
+16
View File
@@ -170,6 +170,22 @@ async function createWorkspaceFromSeededRepo(page, timeoutMs) {
}
}
/**
* Best-effort dismissal of the post-worktree-creation overlays (setup-script
* prompt, feature tips, update banner) that can intercept pointer/focus events
* over the terminal. Never throws.
*/
export async function dismissOverlays(page) {
const labels = ['Dismiss setup scripts', 'Dismiss tip', 'Dismiss update']
for (const name of labels) {
await page
.getByRole('button', { name })
.first()
.click({ timeout: 3_000 })
.catch(() => {})
}
}
/** Create a new terminal tab via the New tab menu. Returns the count after. */
export async function createTerminalTab(page) {
const before = await page.locator(SORTABLE_TAB).count()
+6 -4
View File
@@ -17,7 +17,7 @@ import { backupInstallState, restoreInstallState } from './registry-shortcut-bac
import {
launchInstalledApp,
ensureTerminal,
createTerminalTab,
dismissOverlays,
listTabIds,
startMarker,
readTerminalTextBestEffort,
@@ -189,11 +189,12 @@ async function runProof(ctx, args) {
// --- Base version: launch, create sessions, start marker, record daemon ---
let session = await launchInstalledApp({ exePath: base.exePath, userDataDir, seedProfile })
ctx.session = session
// A fresh profile has no terminal yet, so create a workspace + terminal.
// A fresh profile has no terminal yet, so create a workspace + terminal, then
// clear the post-creation overlays that would intercept typing.
await ensureTerminal(session.page)
await createTerminalTab(session.page)
await dismissOverlays(session.page)
const tabIds = await listTabIds(session.page)
log('sessions', `tab ids: ${tabIds.join(', ')}`)
log('sessions', `terminal ready; tab ids: ${tabIds.join(', ')}`)
await startMarker(session.page, { canary, pidFile: markerPidFile, heartbeatFile })
const markerLive = await probeHeartbeatAdvancing(heartbeatFile)
@@ -236,6 +237,7 @@ async function runProof(ctx, args) {
session = await launchInstalledApp({ exePath: updated.exePath, userDataDir })
ctx.session = session
await ensureTerminal(session.page)
await dismissOverlays(session.page)
const evidence = await gatherEvidence({
profile: opts.expect,