Skip to content

YC (S26) | Open Computer History | Continuously record your company computer work, map your workflows, help you find work worth automating, and power your agents' context

test(e2e): cover Windows Home reopen lifecycle

Louis Beaumont15aff9be3622
diff --git a/apps/screenpipe-app-tauri/e2e/README.md b/apps/screenpipe-app-tauri/e2e/README.md
index 67e813f17..848aa8ca0 100644
--- a/apps/screenpipe-app-tauri/e2e/README.md
+++ b/apps/screenpipe-app-tauri/e2e/README.md
@@ -161,7 +161,7 @@ Saves to `e2e/videos/`.
| `home-window.spec.ts` | Opens Home window; clicks through Home, Pipes, Timeline, Help, Settings nav items |
| `timeline.spec.ts` | Navigates to Timeline; seeds a capture event; verifies at least one frame renders |
| `windows-core-recording.spec.ts` | Windows opt-in. Enables real vision recording and requires API auth, health/load, audio/device, vision, and search endpoints to stay responsive. In CI it uses `SCREENPIPE_E2E_SEED=onboarding,no-audio` so hosted runners exercise OCR without booting Whisper. When the runner exposes usable desktop frames, it also shows a foreground marker window and verifies OCR indexing/query search plus Timeline frame metadata; hosted runners without frames self-skip those capture-dependent assertions. |
-| `windows-system-integration.spec.ts` | Windows-only. Verifies isolated data dir, native DLL/WebView2 runtime, display/DPI topology, localhost-only API binding, process health, Defender visibility, audio service/device health, concurrent local API load, focus churn, rapid Home-window routing, and absence of Windows crash-report events during the suite |
+| `windows-system-integration.spec.ts` | Windows-only. Verifies isolated data dir, native DLL/WebView2 runtime, display/DPI topology, localhost-only API binding, process health, Defender visibility, audio service/device health, concurrent local API load, focus churn, rapid Home-window routing, Home close/reopen backend survival, and absence of Windows crash-report events during the suite |
| `hd-recording-pipeline.spec.ts` | macOS opt-in. Starts an HD timer session via `/capture/hd/start`; asserts the controller goes active, a non-empty `hd_*.mp4` chunk is written, and OCR keeps indexing during HD (high-fps + indexing decouple, #3699/#3707) |
| `settings-sections.spec.ts` | Navigates General → Recording → AI → Speakers settings; verifies content and no crash |
| `audio-fallback.spec.ts` | macOS opt-in spec for the Screenpipe Cloud → local Whisper fallback alert and `/notify` history |
diff --git a/apps/screenpipe-app-tauri/e2e/specs/windows-system-integration.spec.ts b/apps/screenpipe-app-tauri/e2e/specs/windows-system-integration.spec.ts
index 938a64e17..e536c11e6 100644
--- a/apps/screenpipe-app-tauri/e2e/specs/windows-system-integration.spec.ts
+++ b/apps/screenpipe-app-tauri/e2e/specs/windows-system-integration.spec.ts
@@ -17,7 +17,7 @@ import { E2E_DATA_DIR, getAppPath, getAppPid, WEBDRIVER_PORT } from "../helpers/
import { authHeaders, fetchJson, getLocalApiConfig, waitForLocalApi } from "../helpers/api-utils.js";
import { saveScreenshot } from "../helpers/screenshot-utils.js";
import { openHomeWindow, waitForAppReady, t } from "../helpers/test-utils.js";
-import { showWindow, waitForWindowUrl } from "../helpers/tauri.js";
+import { closeWindow, showWindow, waitForWindowHandle, waitForWindowUrl } from "../helpers/tauri.js";
const isWindows = process.platform === "win32";
@@ -461,6 +461,51 @@ $uniqueNames = @($names | Sort-Object -Unique)
expect(existsSync(screenshot)).toBe(true);
});
+ it("keeps the backend alive across Windows Home close and reopen", async function () {
+ if (!isWindows || !api) this.skip();
+
+ await openHomeWindow();
+ await showWindow({ Search: { query: null } });
+ await waitForWindowHandle("search", t(10_000));
+ await browser.switchToWindow("search");
+ const searchInput = await $('input[placeholder*="search memory"]');
+ await searchInput.waitForExist({ timeout: t(15_000) });
+
+ const handlesBeforeClose = await browser.getWindowHandles();
+ expect(handlesBeforeClose.filter((handle) => handle === "home")).toHaveLength(1);
+
+ try {
+ await closeWindow({ Home: { page: null } });
+ await browser.pause(t(750));
+
+ const handlesAfterClose = await browser.getWindowHandles();
+ expect(handlesAfterClose.filter((handle) => handle === "home")).toHaveLength(1);
+
+ const healthWhileClosed = await fetchJson(apiUrl(api, "/health"));
+ expect(healthWhileClosed.ok).toBe(true);
+
+ await showWindow({ Home: { page: "home" } });
+ await waitForWindowHandle("home", t(10_000));
+ await browser.switchToWindow("home");
+ await waitForWindowUrl("/home", undefined, t(12_000));
+ expect(await pageIsAlive()).toBe(true);
+
+ const handlesAfterReopen = await browser.getWindowHandles();
+ expect(handlesAfterReopen.filter((handle) => handle === "home")).toHaveLength(1);
+
+ const healthAfterReopen = await fetchJson(apiUrl(api, "/health"));
+ expect(healthAfterReopen.ok).toBe(true);
+ } finally {
+ if ((await browser.getWindowHandles()).includes("home")) {
+ await browser.switchToWindow("home").catch(() => {});
+ }
+ await closeWindow({ Search: { query: null } }).catch(() => {});
+ if ((await browser.getWindowHandles()).includes("home")) {
+ await browser.switchToWindow("home").catch(() => {});
+ }
+ }
+ });
+
it("keeps the WebView responsive after native Windows focus churn", async function () {
if (!isWindows || !api) this.skip();