Skip to content

Evenfire is an intelligence layer platform for running LLM agents that take real actions, on your infrastructure

TypeScript

test(desktop-e2e): assert the continuity spec runs the checkout build

Alfredo Lopez71ae923b43dc
diff --git a/desktop-app/test/e2e-playwright/stateful-stateless-switch-continuity.spec.ts b/desktop-app/test/e2e-playwright/stateful-stateless-switch-continuity.spec.ts
index 01bfd7de1..a23a49f04 100644
--- a/desktop-app/test/e2e-playwright/stateful-stateless-switch-continuity.spec.ts
+++ b/desktop-app/test/e2e-playwright/stateful-stateless-switch-continuity.spec.ts
@@ -33,9 +33,13 @@ import {
test,
} from '@playwright/test'
import { execFile } from 'node:child_process'
+import { realpathSync } from 'node:fs'
+import nodePath from 'node:path'
import { promisify } from 'node:util'
import {
+ DESKTOP_APP_ROOT,
EXTERNAL_REST_API_BASE_URL,
+ MAIN_ENTRY,
RPC_PROXY_BASE_URL,
assertAllowedTarget,
desktopCredentials,
@@ -47,6 +51,25 @@ import {
const execFileAsync = promisify(execFile)
+/**
+ * The journey only proves this branch if Desktop runs from this checkout: the
+ * Electron runtime from its node_modules and the main bundle it just built.
+ */
+async function expectCheckoutBuild(app: ElectronApplication): Promise<void> {
+ const identity = await app.evaluate(({ app: electronApp }) => ({
+ packaged: electronApp.isPackaged,
+ execPath: process.execPath,
+ argv: process.argv,
+ }))
+ const electronDist = realpathSync(nodePath.join(DESKTOP_APP_ROOT, 'node_modules/electron/dist'))
+ console.info(
+ `[825] desktop build execPath=${identity.execPath} main=${MAIN_ENTRY} packaged=${identity.packaged}`
+ )
+ expect(identity.packaged, 'Desktop must not be a packaged app').toBe(false)
+ expect(realpathSync(identity.execPath).startsWith(`${electronDist}${nodePath.sep}`)).toBe(true)
+ expect(identity.argv).toContain(MAIN_ENTRY)
+}
+
const HOST_NAMESPACE = 'mcp-host'
const WORKSPACE_PATH = '/workspace'
const POD_READY_TIMEOUT_MS = 300_000
@@ -516,6 +539,7 @@ test('#825 — a conversation survives stateful -> stateless -> stateful switche
await test.step('1. log in through the UI', async () => {
;({ app, page } = await launchDesktopApp(testInfo))
+ await expectCheckoutBuild(app)
await login(currentPage(), credentials)
await expect(currentPage().getByTestId('nav-chat')).toBeVisible({ timeout: 30_000 })
})
@@ -552,6 +576,7 @@ test('#825 — a conversation survives stateful -> stateless -> stateful switche
app = undefined
page = undefined
;({ app, page } = await launchDesktopApp(testInfo))
+ await expectCheckoutBuild(app)
const p = currentPage()
await expect(p.locator('.boot-overlay')).toBeHidden({ timeout: 30_000 })
await expect(p.getByTestId('nav-chat')).toBeVisible({ timeout: 30_000 })