diff --git a/apps/desktop/e2e/update/first-run.spec.ts b/apps/desktop/e2e/update/first-run.spec.ts index b38c39f537..fef9ef6928 100644 --- a/apps/desktop/e2e/update/first-run.spec.ts +++ b/apps/desktop/e2e/update/first-run.spec.ts @@ -6,7 +6,8 @@ * straight to chat — on the first launch and on every later one — and never * show the first-run setup chooser or start the bootstrap installer * (#123888, #123800: the chooser / installer came back on every launch while - * the local install was healthy). + * the local install was healthy). The second launch drops the Desktop + * bootstrap marker first: a usable install is recognised off the filesystem. * * Real entry point: the packaged app the install built, launched with the * install's environment and no HERMES_DESKTOP_HERMES_ROOT override, so the app @@ -66,7 +67,13 @@ test('a healthy local install opens straight to chat on every launch: no setup c try { for (const launch of [1, 2]) { - await test.step(`launch ${launch}`, async () => { + await test.step(launch === 1 ? 'launch 1' : 'launch 2, bootstrap marker absent', async () => { + if (launch === 2) { + // A usable install the Desktop bootstrap never stamped (a CLI install from before the + // marker, or one whose marker was lost): usability, not the marker, decides. + fs.rmSync(path.join(facts.checkout, '.hermes-bootstrap-complete'), { force: true }) + } + const installer = startInstallerSampler(facts) const { app, page, logTail } = await launchInstalledApp(facts, env) @@ -77,6 +84,11 @@ test('a healthy local install opens straight to chat on every launch: no setup c throw new Error(`${(error as Error).message}\n${diagnostics(facts, logTail())}`) }) + expect( + await firstRunScreensSeen(page), + `launch ${launch} of a healthy install showed the first-run setup chooser\n${diagnostics(facts, logTail())}` + ).toEqual([]) + // The backend the app started is the user's install, not something it provisioned. const serve = backendServeProcesses(facts) expect(serve.length, `one backend for the install\n${diagnostics(facts)}`).toBe(1) @@ -90,10 +102,6 @@ test('a healthy local install opens straight to chat on every launch: no setup c await send(page, `${U(launch)} hello`, 'Enter', ws) await expect(page.getByText(`${A(launch)} healthy install`)).toBeVisible({ timeout: 120_000 }) - expect( - await firstRunScreensSeen(page), - `launch ${launch} of a healthy install showed the first-run setup chooser\n${diagnostics(facts, logTail())}` - ).toEqual([]) expect( installer.stop(), `launch ${launch} of a healthy install started the bootstrap installer\n${diagnostics(facts, logTail())}` diff --git a/apps/desktop/e2e/update/update-concurrency.spec.ts b/apps/desktop/e2e/update/update-concurrency.spec.ts index f8f60d7e90..381632667b 100644 --- a/apps/desktop/e2e/update/update-concurrency.spec.ts +++ b/apps/desktop/e2e/update/update-concurrency.spec.ts @@ -148,11 +148,12 @@ test('Update now while a terminal update runs is refused, and the panel is truth message: 'the app reports the install current on the new commit' }) .toEqual({ currentSha: target, updateAvailable: false }) - await openAbout(reopened.page) - await expect(reopened.page.getByRole('button', { name: /^update now$/i })).toHaveCount(0, { timeout: 60_000 }) + // Chat first: the About panel replaces the chat view. provider.script(U(1), [{ text: [`${A(1)} `, 'after ', 'terminal ', 'update'] }]) await send(reopened.page, `${U(1)} still here?`, 'Enter', ws2) await expect(reopened.page.getByText(`${A(1)} after terminal update`)).toBeVisible({ timeout: 120_000 }) + await openAbout(reopened.page) + await expect(reopened.page.getByRole('button', { name: /^update now$/i })).toHaveCount(0, { timeout: 60_000 }) } finally { await closeQuietly(reopened.app) }