diff --git a/tools/win-update-e2e/app-driver.mjs b/tools/win-update-e2e/app-driver.mjs index f10040425..57857e921 100644 --- a/tools/win-update-e2e/app-driver.mjs +++ b/tools/win-update-e2e/app-driver.mjs @@ -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() diff --git a/tools/win-update-e2e/run.mjs b/tools/win-update-e2e/run.mjs index 35b60f1ec..edee9af3e 100644 --- a/tools/win-update-e2e/run.mjs +++ b/tools/win-update-e2e/run.mjs @@ -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,