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 API auth restart UX

Louis Beaumont573587c58ed1
diff --git a/apps/screenpipe-app-tauri/e2e/README.md b/apps/screenpipe-app-tauri/e2e/README.md
index 8948c0f73..ae68de405 100644
--- a/apps/screenpipe-app-tauri/e2e/README.md
+++ b/apps/screenpipe-app-tauri/e2e/README.md
@@ -162,7 +162,7 @@ Saves to `e2e/videos/`.
| `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, visible scrubber clicks, and arrow-key frame stepping; 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, Home close/reopen backend survival, and absence of Windows crash-report events during the suite |
-| `windows-user-journey.spec.ts` | Windows-only. Drives Home search button -> floating Search input -> Timeline -> Home, opens Recording settings to reveal Windows audio troubleshooting controls, and previews the Storage retention safety confirmation without applying destructive cleanup |
+| `windows-user-journey.spec.ts` | Windows-only. Drives Home search button -> floating Search input -> Timeline -> Home, opens Recording settings to reveal Windows audio troubleshooting controls, previews the Storage retention safety confirmation without applying destructive cleanup, and verifies the Privacy API-auth restart warning without restarting |
| `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-user-journey.spec.ts b/apps/screenpipe-app-tauri/e2e/specs/windows-user-journey.spec.ts
index 99fe008c8..ac0db0a06 100644
--- a/apps/screenpipe-app-tauri/e2e/specs/windows-user-journey.spec.ts
+++ b/apps/screenpipe-app-tauri/e2e/specs/windows-user-journey.spec.ts
@@ -142,6 +142,30 @@ async function setSwitchChecked(selector: string, checked: boolean): Promise<voi
);
}
+async function isDataStateSwitchChecked(selector: string): Promise<boolean> {
+ const toggle = await $(selector);
+ await toggle.waitForExist({ timeout: t(15_000) });
+ return (await toggle.getAttribute("data-state")) === "checked";
+}
+
+async function setDataStateSwitchChecked(selector: string, checked: boolean): Promise<void> {
+ const toggle = await $(selector);
+ await toggle.waitForDisplayed({ timeout: t(15_000) });
+
+ if ((await isDataStateSwitchChecked(selector)) !== checked) {
+ await toggle.click();
+ }
+
+ await browser.waitUntil(
+ async () => (await isDataStateSwitchChecked(selector)) === checked,
+ {
+ timeout: t(10_000),
+ interval: 250,
+ timeoutMsg: `${selector} did not become ${checked ? "checked" : "unchecked"}`,
+ },
+ );
+}
+
describe("Windows user journey", function () {
this.timeout(180_000);
@@ -300,4 +324,53 @@ describe("Windows user journey", function () {
const retentionScreenshot = await saveScreenshot("windows-user-journey-storage-retention");
expect(existsSync(retentionScreenshot)).toBe(true);
});
+
+ it("previews Privacy API auth restart requirements without applying them", async function () {
+ if (!isWindows) this.skip();
+
+ await openHomeWindow();
+
+ const settingsNav = await $('[data-testid="nav-settings"]');
+ await settingsNav.waitForDisplayed({ timeout: t(15_000) });
+ await settingsNav.click();
+
+ const privacyNav = await $('[data-testid="settings-nav-privacy"]');
+ await privacyNav.waitForDisplayed({ timeout: t(15_000) });
+ await privacyNav.click();
+
+ await waitForBodyText(
+ (bodyText) =>
+ bodyText.includes("require api authentication") &&
+ bodyText.includes("all api requests require a valid token"),
+ "Privacy settings did not show the API authentication controls",
+ );
+
+ const apiAuthSwitchSelector = '[data-testid="privacy-api-auth-switch"]';
+ const apiAuthSwitch = await $(apiAuthSwitchSelector);
+ await apiAuthSwitch.waitForDisplayed({ timeout: t(20_000) });
+ if (!(await apiAuthSwitch.isEnabled())) {
+ this.skip();
+ }
+
+ const initiallyChecked = await isDataStateSwitchChecked(apiAuthSwitchSelector);
+ try {
+ await setDataStateSwitchChecked(apiAuthSwitchSelector, !initiallyChecked);
+
+ const applyRestart = await $('[data-testid="privacy-apply-restart"]');
+ await applyRestart.waitForDisplayed({ timeout: t(10_000) });
+
+ await waitForBodyText(
+ (bodyText) =>
+ bodyText.includes("apply & restart") &&
+ bodyText.includes("auth changes to take effect") &&
+ bodyText.includes("existing browser connections"),
+ "Privacy API auth toggle did not explain the restart requirement",
+ );
+
+ const privacyScreenshot = await saveScreenshot("windows-user-journey-privacy-api-auth-restart");
+ expect(existsSync(privacyScreenshot)).toBe(true);
+ } finally {
+ await setDataStateSwitchChecked(apiAuthSwitchSelector, initiallyChecked).catch(() => {});
+ }
+ });
});