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

feat: Windows E2E tests with self-hosted runner + bb CLI

Louis Beaumont8f5cb8ceadf4
diff --git a/.github/scripts/e2e/lib.ts b/.github/scripts/e2e/lib.ts
index b6213420f..2790bdd17 100644
--- a/.github/scripts/e2e/lib.ts
+++ b/.github/scripts/e2e/lib.ts
@@ -1,11 +1,18 @@
/**
* E2E test library — shared helpers for all test scripts
- * Requires: bb (bigbrother CLI) in PATH or at ~/Documents/bigbrother/target/release/bb
+ * Cross-platform: macOS + Windows
+ * Requires: bb (bigbrother CLI) in PATH or at known locations
*/
import { $ } from "bun";
import { existsSync, mkdirSync } from "fs";
import { join } from "path";
+import { tmpdir, platform, hostname } from "os";
+
+// ── Platform ────────────────────────────────────────────────────────────────
+
+export const IS_WINDOWS = platform() === "win32";
+export const IS_MACOS = platform() === "darwin";
// ── Config ──────────────────────────────────────────────────────────────────
@@ -16,17 +23,78 @@ export const TIMEOUT_SHORT = 5_000;
export const TIMEOUT_MEDIUM = 15_000;
export const TIMEOUT_LONG = 60_000;
-export const ARTIFACTS_DIR =
- process.env.ARTIFACTS_DIR ??
- join("/tmp", "screenpipe-e2e", new Date().toISOString().replace(/[:.]/g, "-"));
+const defaultArtifacts = IS_WINDOWS
+ ? join(tmpdir(), "screenpipe-e2e", new Date().toISOString().replace(/[:.]/g, "-"))
+ : join("/tmp", "screenpipe-e2e", new Date().toISOString().replace(/[:.]/g, "-"));
+
+export const ARTIFACTS_DIR = process.env.ARTIFACTS_DIR ?? defaultArtifacts;
+
+// ── Platform-specific selectors ─────────────────────────────────────────────
+
+/**
+ * Selector helpers that map to platform-appropriate accessibility roles.
+ * macOS uses AX roles (AXWebArea, AXMenuBarItem, etc.)
+ * Windows uses UIA ControlTypes (Document, MenuBar, MenuItem, etc.)
+ */
+export const sel = {
+ webArea: IS_WINDOWS ? "role:Document" : "role:AXWebArea",
+ window: IS_WINDOWS ? "role:Window" : "role:AXWindow",
+ menuBarItem: (name: string) =>
+ IS_WINDOWS
+ ? `role:MenuItem AND name~:${name}`
+ : `role:AXMenuBarItem AND title~:${name}`,
+ menuItem: (name: string) =>
+ IS_WINDOWS
+ ? `role:MenuItem AND name~:${name}`
+ : `role:AXMenuItem AND title:${name}`,
+ staticText: (name: string) =>
+ IS_WINDOWS
+ ? `role:Text AND name~:${name}`
+ : `role:AXStaticText AND name~:${name}`,
+ textField: IS_WINDOWS ? "role:Edit" : "role:AXTextField",
+ textArea: IS_WINDOWS ? "role:Edit" : "role:AXTextArea",
+ button: (name: string) =>
+ IS_WINDOWS
+ ? `role:Button AND name~:${name}`
+ : `role:AXButton AND title~:${name}`,
+ titleContains: (text: string) =>
+ IS_WINDOWS ? `name~:${text}` : `title~:${text}`,
+ titleExact: (text: string) =>
+ IS_WINDOWS ? `name:${text}` : `title:${text}`,
+};
+
+// ── Platform-specific shortcuts ─────────────────────────────────────────────
+
+export const shortcuts = {
+ /** Show/hide main window */
+ showApp: IS_WINDOWS
+ ? { key: "s", modifiers: "alt" }
+ : { key: "s", modifiers: "cmd,ctrl" },
+ /** Open search panel */
+ search: IS_WINDOWS
+ ? { key: "k", modifiers: "alt" }
+ : { key: "k", modifiers: "cmd,ctrl" },
+ /** Close window */
+ closeWindow: IS_WINDOWS
+ ? { key: "F4", modifiers: "alt" }
+ : { key: "w", modifiers: "cmd" },
+};
// ── Find bb binary ─────────────────────────────────────────────────────────
-const BB_PATHS = [
- "bb",
- join(process.env.HOME ?? "", "Documents/bigbrother/target/release/bb"),
- "/usr/local/bin/bb",
-];
+const BB_PATHS = IS_WINDOWS
+ ? [
+ "bb",
+ "bb.exe",
+ join(process.env.USERPROFILE ?? "", "Documents/bigbrother/target/release/bb.exe"),
+ join(process.env.USERPROFILE ?? "", "Documents/bigbrother/target/release/bb"),
+ "C:\\Program Files\\bb\\bb.exe",
+ ]
+ : [
+ "bb",
+ join(process.env.HOME ?? "", "Documents/bigbrother/target/release/bb"),
+ "/usr/local/bin/bb",
+ ];
let BB = "";
for (const p of BB_PATHS) {
@@ -38,7 +106,12 @@ for (const p of BB_PATHS) {
}
} catch {}
}
-if (!BB) throw new Error("bb (bigbrother) not found. Build it: cd ~/Documents/bigbrother && cargo build --release");
+if (!BB) {
+ const hint = IS_WINDOWS
+ ? "Build it: cd %USERPROFILE%\\Documents\\bigbrother && cargo build --release -p bb"
+ : "Build it: cd ~/Documents/bigbrother && cargo build --release";
+ throw new Error(`bb (bigbrother) not found. ${hint}`);
+}
// ── State ───────────────────────────────────────────────────────────────────
@@ -179,7 +252,7 @@ export async function press(key: string) {
}
/** Keyboard shortcut */
-export async function shortcut(key: string, modifiers = "cmd") {
+export async function shortcut(key: string, modifiers = IS_WINDOWS ? "alt" : "cmd") {
await bb("shortcut", key, "--modifiers", modifiers);
}
@@ -201,6 +274,43 @@ export async function tree(): Promise<any> {
/** Sleep for ms */
export const sleep = (ms: number) => new Promise((r) => setTimeout(r, ms));
+// ── Process helpers ─────────────────────────────────────────────────────────
+
+/** Check if screenpipe process is running (cross-platform) */
+export function isScreenpipeRunning(): boolean {
+ if (IS_WINDOWS) {
+ const proc = Bun.spawnSync(["tasklist", "/FI", "IMAGENAME eq screenpipe*", "/NH"]);
+ const out = proc.stdout.toString();
+ return out.includes("screenpipe");
+ } else {
+ const proc = Bun.spawnSync(["pgrep", "-f", "screenpipe"]);
+ return proc.exitCode === 0;
+ }
+}
+
+/** Get system info (cross-platform) */
+export function getSystemInfo(): { hostname: string; os: string; cpu: string; memGB: number } {
+ const host = hostname();
+
+ if (IS_WINDOWS) {
+ const osInfo = Bun.spawnSync(["cmd", "/c", "ver"]).stdout.toString().trim();
+ const cpuInfo = Bun.spawnSync([
+ "powershell", "-NoProfile", "-Command",
+ "(Get-CimInstance Win32_Processor).Name",
+ ]).stdout.toString().trim();
+ const memInfo = Bun.spawnSync([
+ "powershell", "-NoProfile", "-Command",
+ "[math]::Round((Get-CimInstance Win32_ComputerSystem).TotalPhysicalMemory / 1GB)",
+ ]).stdout.toString().trim();
+ return { hostname: host, os: osInfo, cpu: cpuInfo, memGB: parseInt(memInfo) || 0 };
+ } else {
+ const osVersion = Bun.spawnSync(["sw_vers", "-productVersion"]).stdout.toString().trim();
+ const chip = Bun.spawnSync(["sysctl", "-n", "machdep.cpu.brand_string"]).stdout.toString().trim();
+ const memBytes = parseInt(Bun.spawnSync(["sysctl", "-n", "hw.memsize"]).stdout.toString().trim());
+ return { hostname: host, os: `macOS ${osVersion}`, cpu: chip, memGB: Math.round(memBytes / 1073741824) };
+ }
+}
+
// ── HTTP helpers ────────────────────────────────────────────────────────────
/** Fetch JSON from URL */
diff --git a/.github/scripts/e2e/run-all.ts b/.github/scripts/e2e/run-all.ts
index f41f29d7e..7ecc4f779 100644
--- a/.github/scripts/e2e/run-all.ts
+++ b/.github/scripts/e2e/run-all.ts
@@ -1,6 +1,7 @@
#!/usr/bin/env bun
/**
* E2E test runner — runs all test suites in order
+ * Cross-platform: macOS + Windows
* Usage:
* bun .github/scripts/e2e/run-all.ts [--suite <name>]
* bun .github/scripts/e2e/run-all.ts # runs all
@@ -8,7 +9,10 @@
*/
import { join, dirname } from "path";
-import { ARTIFACTS_DIR, HEALTH_URL } from "./lib";
+import {
+ ARTIFACTS_DIR, HEALTH_URL, IS_WINDOWS, IS_MACOS,
+ isScreenpipeRunning, getSystemInfo,
+} from "./lib";
import { mkdirSync } from "fs";
const c = {
@@ -23,7 +27,8 @@ const SUITES = [
{ name: "window", file: "test-main-window.ts" },
{ name: "settings", file: "test-settings.ts" },
{ name: "recording", file: "test-recording.ts" },
- { name: "permissions", file: "test-permissions.ts" },
+ // permissions suite is macOS-only (accessibility/screen recording perms)
+ ...(IS_MACOS ? [{ name: "permissions", file: "test-permissions.ts" }] : []),
{ name: "onboarding", file: "test-onboarding.ts" },
{ name: "chat", file: "test-chat.ts" },
];
@@ -37,12 +42,8 @@ for (let i = 0; i < args.length; i++) {
}
}
-// System info
-const hostname = Bun.spawnSync(["hostname"]).stdout.toString().trim();
-const osVersion = Bun.spawnSync(["sw_vers", "-productVersion"]).stdout.toString().trim();
-const chip = Bun.spawnSync(["sysctl", "-n", "machdep.cpu.brand_string"]).stdout.toString().trim();
-const memBytes = parseInt(Bun.spawnSync(["sysctl", "-n", "hw.memsize"]).stdout.toString().trim());
-const memGB = Math.round(memBytes / 1073741824);
+// System info (cross-platform)
+const sysInfo = getSystemInfo();
console.log(c.bold("╔══════════════════════════════════════╗"));
console.log(c.bold("║ screenpipe e2e test runner ║"));
@@ -50,17 +51,17 @@ console.log(c.bold("╚═══════════════════
console.log("");
console.log(`artifacts: ${ARTIFACTS_DIR}`);
console.log(`time: ${new Date().toLocaleString()}`);
-console.log(`host: ${hostname}`);
-console.log(`os: ${osVersion}`);
-console.log(`chip: ${chip}`);
-console.log(`memory: ${memGB}GB`);
+console.log(`host: ${sysInfo.hostname}`);
+console.log(`os: ${sysInfo.os}`);
+console.log(`cpu: ${sysInfo.cpu}`);
+console.log(`memory: ${sysInfo.memGB}GB`);
+console.log(`platform: ${IS_WINDOWS ? "windows" : IS_MACOS ? "macos" : "linux"}`);
console.log("");
mkdirSync(ARTIFACTS_DIR, { recursive: true });
// Preflight: check app is running
-const pgrep = Bun.spawnSync(["pgrep", "-f", "screenpipe"]);
-if (pgrep.exitCode !== 0) {
+if (!isScreenpipeRunning()) {
console.log(c.red("error: screenpipe is not running"));
console.log("start the app first, then run tests");
process.exit(1);
@@ -80,7 +81,9 @@ try {
}
}
-const scriptDir = dirname(new URL(import.meta.url).pathname);
+const scriptDir = IS_WINDOWS
+ ? dirname(new URL(import.meta.url).pathname).replace(/^\/([A-Za-z]:)/, "$1")
+ : dirname(new URL(import.meta.url).pathname);
let passed = 0;
let failed = 0;
const failedNames: string[] = [];
diff --git a/.github/scripts/e2e/test-app-launch.ts b/.github/scripts/e2e/test-app-launch.ts
index 9d1420158..de3756a12 100644
--- a/.github/scripts/e2e/test-app-launch.ts
+++ b/.github/scripts/e2e/test-app-launch.ts
@@ -1,10 +1,12 @@
-import { suite, test, summary, screenshot, assertExists, assertHealthField } from "./lib";
+import {
+ suite, test, summary, screenshot, assertExists, assertHealthField,
+ sel, IS_WINDOWS, IS_MACOS, isScreenpipeRunning,
+} from "./lib";
suite("app launch & health");
await test("app process running", async () => {
- const proc = Bun.spawnSync(["pgrep", "-f", "screenpipe"]);
- if (proc.exitCode !== 0) throw new Error("screenpipe process not found");
+ if (!isScreenpipeRunning()) throw new Error("screenpipe process not found");
});
await test("health API responds", async () => {
@@ -16,16 +18,29 @@ await test("health status healthy", () => assertHealthField("status", "healthy")
await test("health frame_status ok", () => assertHealthField("frame_status", "ok"));
await test("health audio_status ok", () => assertHealthField("audio_status", "ok"));
-await test("tray icon exists", () => assertExists("role:AXMenuBarItem AND name~:status"));
-await test("tray shows recording", () => assertExists("title:● recording"));
-await test("tray version present", () => assertExists("title~:version"));
-await test("tray settings item", () => assertExists("role:AXMenuItem AND title:settings"));
-await test("tray quit item", () => assertExists("role:AXMenuItem AND title:quit screenpipe"));
-await test("tray changelog item", () => assertExists("role:AXMenuItem AND title:changelog"));
-await test("tray show screenpipe", () => assertExists("title~:show screenpipe"));
-await test("tray stop recording", () => assertExists("role:AXMenuItem AND title:stop recording"));
-await test("tray start recording", () => assertExists("role:AXMenuItem AND title:start recording"));
-await test("tray send feedback", () => assertExists("role:AXMenuItem AND title:send feedback"));
+if (IS_MACOS) {
+ // macOS tray tests use AX-specific selectors
+ await test("tray icon exists", () => assertExists("role:AXMenuBarItem AND name~:status"));
+ await test("tray shows recording", () => assertExists("title:● recording"));
+ await test("tray version present", () => assertExists("title~:version"));
+ await test("tray settings item", () => assertExists("role:AXMenuItem AND title:settings"));
+ await test("tray quit item", () => assertExists("role:AXMenuItem AND title:quit screenpipe"));
+ await test("tray changelog item", () => assertExists("role:AXMenuItem AND title:changelog"));
+ await test("tray show screenpipe", () => assertExists("title~:show screenpipe"));
+ await test("tray stop recording", () => assertExists("role:AXMenuItem AND title:stop recording"));
+ await test("tray start recording", () => assertExists("role:AXMenuItem AND title:start recording"));
+ await test("tray send feedback", () => assertExists("role:AXMenuItem AND title:send feedback"));
+}
+
+if (IS_WINDOWS) {
+ // Windows system tray tests — tray icons live in notification area
+ // bb on Windows can find elements via UIA in the notification area
+ await test("tray icon accessible", async () => {
+ // On Windows, the tray icon is in the system notification area
+ // Try to find screenpipe in the notification overflow or tray
+ await assertExists(sel.titleContains("screenpipe"), 10_000);
+ });
+}
await screenshot("01-tray-health");
diff --git a/.github/scripts/e2e/test-chat.ts b/.github/scripts/e2e/test-chat.ts
index c35a18ac8..ce91b89a7 100644
--- a/.github/scripts/e2e/test-chat.ts
+++ b/.github/scripts/e2e/test-chat.ts
@@ -1,27 +1,30 @@
import {
suite, test, summary, screenshot, assertExists,
shortcut, find, click, sleep, TIMEOUT_MEDIUM,
+ sel, shortcuts, bb,
} from "./lib";
suite("chat");
await test("navigate to chat area", async () => {
- await shortcut("s", "cmd,ctrl");
+ await bb("activate", "screenpipe-app");
+ await sleep(500);
+ const s = shortcuts.showApp;
+ await shortcut(s.key, s.modifiers);
await sleep(2000);
- await assertExists("role:AXWebArea", TIMEOUT_MEDIUM);
+ await assertExists(sel.webArea, TIMEOUT_MEDIUM);
});
await test("chat page loads", async () => {
- // Verify webview is functional
- await assertExists("role:AXWebArea", TIMEOUT_MEDIUM);
+ await assertExists(sel.webArea, TIMEOUT_MEDIUM);
});
-await test("window not crashed", () => assertExists("role:AXWindow"));
+await test("window not crashed", () => assertExists(sel.window));
await test("can focus text input", async () => {
- const textAreas = await find("role:AXTextArea").catch(() => []);
+ const textAreas = await find(sel.textArea).catch(() => []);
if (textAreas.length > 0) {
- await click("role:AXTextArea");
+ await click(sel.textArea);
}
// No text area found = might be on timeline page, that's ok
});
diff --git a/.github/scripts/e2e/test-main-window.ts b/.github/scripts/e2e/test-main-window.ts
index ce7083d41..c04243d9b 100644
--- a/.github/scripts/e2e/test-main-window.ts
+++ b/.github/scripts/e2e/test-main-window.ts
@@ -1,22 +1,23 @@
import {
suite, test, summary, screenshot, assertExists, shortcut, bb,
press, scrape, sleep, TIMEOUT_MEDIUM,
+ sel, shortcuts, IS_WINDOWS, IS_MACOS,
} from "./lib";
suite("main window UI");
-await test("open main window (⌃⌘S)", async () => {
- // Activate app first to ensure shortcut is received
+await test("open main window", async () => {
await bb("activate", "screenpipe-app");
await sleep(500);
- await shortcut("s", "cmd,ctrl");
+ const s = shortcuts.showApp;
+ await shortcut(s.key, s.modifiers);
await sleep(3000);
- await assertExists("role:AXWebArea", TIMEOUT_MEDIUM);
+ await assertExists(sel.webArea, TIMEOUT_MEDIUM);
});
-await test("window has webview", () => assertExists("role:AXWebArea"));
+await test("window has webview", () => assertExists(sel.webArea));
-await test("search button exists", () => assertExists("title~:search"));
+await test("search button exists", () => assertExists(sel.titleContains("search")));
await test("timeline has time labels", async () => {
const result = await scrape();
@@ -32,12 +33,13 @@ await test("timeline has app labels", async () => {
if (meaningful.length < 3) throw new Error(`only ${meaningful.length} meaningful texts`);
});
-await test("notifications region exists", () => assertExists("title~:Notifications"));
+await test("notifications region exists", () => assertExists(sel.titleContains("Notifications")));
-await test("open search panel (⌃⌘K)", async () => {
- await shortcut("k", "cmd,ctrl");
+await test("open search panel", async () => {
+ const s = shortcuts.search;
+ await shortcut(s.key, s.modifiers);
await sleep(1000);
- await assertExists("role:AXTextField", TIMEOUT_MEDIUM);
+ await assertExists(sel.textField, TIMEOUT_MEDIUM);
});
await test("close search panel (Esc)", async () => {
@@ -45,10 +47,18 @@ await test("close search panel (Esc)", async () => {
await sleep(1000);
});
-await test("screenpipe menu exists", () => assertExists("role:AXMenuBarItem AND title:screenpipe"));
-await test("edit menu exists", () => assertExists("role:AXMenuBarItem AND title:Edit"));
-await test("about menu item", () => assertExists("role:AXMenuItem AND title:About screenpipe"));
-await test("check for updates item", () => assertExists("title~:Check for Updates"));
+if (IS_MACOS) {
+ await test("screenpipe menu exists", () => assertExists("role:AXMenuBarItem AND title:screenpipe"));
+ await test("edit menu exists", () => assertExists("role:AXMenuBarItem AND title:Edit"));
+ await test("about menu item", () => assertExists("role:AXMenuItem AND title:About screenpipe"));
+ await test("check for updates item", () => assertExists("title~:Check for Updates"));
+}
+
+if (IS_WINDOWS) {
+ // Windows app has a title bar with the app name
+ await test("window title contains screenpipe", () =>
+ assertExists(sel.titleContains("screenpipe")));
+}
await screenshot("02-main-window");
diff --git a/.github/scripts/e2e/test-onboarding.ts b/.github/scripts/e2e/test-onboarding.ts
index ba286e453..571c5d68b 100644
--- a/.github/scripts/e2e/test-onboarding.ts
+++ b/.github/scripts/e2e/test-onboarding.ts
@@ -1,25 +1,37 @@
import {
suite, test, summary, screenshot, assertExists, click,
press, scrape, sleep, TIMEOUT_MEDIUM,
+ sel, IS_WINDOWS, IS_MACOS, bb, shortcuts, shortcut,
} from "./lib";
suite("onboarding flow");
-await test("trigger onboarding from tray", async () => {
- // Use app menu bar (tray AXPress unreliable)
- await click("role:AXMenuBarItem AND title:screenpipe");
- await sleep(500);
- // Onboarding might be a menu item or we trigger via tray
- // Try finding the onboarding tray item directly
- try {
- await click("role:AXMenuItem AND title:onboarding");
- } catch {
- // Fall back to pressing escape and trying tray
- await press("Escape");
+await test("trigger onboarding", async () => {
+ if (IS_MACOS) {
+ await click("role:AXMenuBarItem AND title:screenpipe");
await sleep(500);
+ try {
+ await click("role:AXMenuItem AND title:onboarding");
+ } catch {
+ await press("Escape");
+ await sleep(500);
+ }
+ } else {
+ // On Windows, try to trigger onboarding via tray or menu
+ await bb("activate", "screenpipe-app");
+ await sleep(500);
+ const s = shortcuts.showApp;
+ await shortcut(s.key, s.modifiers);
+ await sleep(2000);
+ // Try to find onboarding trigger in the UI
+ try {
+ await click(sel.titleContains("onboarding"));
+ } catch {
+ // May not be available if already completed — that's ok
+ }
}
await sleep(3000);
- await assertExists("role:AXWebArea", TIMEOUT_MEDIUM);
+ await assertExists(sel.webArea, TIMEOUT_MEDIUM);
});
await test("onboarding has skip/content", async () => {
diff --git a/.github/scripts/e2e/test-permissions.ts b/.github/scripts/e2e/test-permissions.ts
index 310b795a0..2b202f647 100644
--- a/.github/scripts/e2e/test-permissions.ts
+++ b/.github/scripts/e2e/test-permissions.ts
@@ -1,23 +1,26 @@
import {
suite, test, summary, screenshot, assertHealthField,
- shortcut, scrape, tree, sleep,
+ shortcut, scrape, tree, sleep, IS_WINDOWS, IS_MACOS,
+ shortcuts, sel,
} from "./lib";
suite("permissions");
-await test("no permission banner when granted", async () => {
- await shortcut("s", "cmd,ctrl");
- await sleep(2000);
- const result = await scrape();
- const texts: string[] = (result?.data?.items ?? []).map((i: any) => (i.text ?? "").toLowerCase());
- const allText = texts.join(" ");
- const warningKeywords = ["permission", "grant", "missing", "denied", "allow"];
- for (const kw of warningKeywords) {
- if (allText.includes(kw) && (allText.includes("grant") || allText.includes("missing") || allText.includes("denied"))) {
- throw new Error(`permission warning found: "${kw}" in UI text`);
+if (IS_MACOS) {
+ await test("no permission banner when granted", async () => {
+ await shortcut("s", "cmd,ctrl");
+ await sleep(2000);
+ const result = await scrape();
+ const texts: string[] = (result?.data?.items ?? []).map((i: any) => (i.text ?? "").toLowerCase());
+ const allText = texts.join(" ");
+ const warningKeywords = ["permission", "grant", "missing", "denied", "allow"];
+ for (const kw of warningKeywords) {
+ if (allText.includes(kw) && (allText.includes("grant") || allText.includes("missing") || allText.includes("denied"))) {
+ throw new Error(`permission warning found: "${kw}" in UI text`);
+ }
}
- }
-});
+ });
+}
await test("screen recording permission", () => assertHealthField("frame_status", "ok"));
await test("microphone permission", () => assertHealthField("audio_status", "ok"));
diff --git a/.github/scripts/e2e/test-recording.ts b/.github/scripts/e2e/test-recording.ts
index f0800a406..5add29cd8 100644
--- a/.github/scripts/e2e/test-recording.ts
+++ b/.github/scripts/e2e/test-recording.ts
@@ -2,6 +2,7 @@ import {
suite, test, summary, screenshot, assertExists,
assertHealthField, assertSearchResults, fetchJson,
waitForHealth, sleep, HEALTH_URL, TIMEOUT_MEDIUM,
+ sel,
} from "./lib";
suite("recording pipeline");
@@ -39,7 +40,7 @@ await test("monitors detected in health", async () => {
});
await test("recording state visible in tray", async () => {
- await assertExists("title~:recording");
+ await assertExists(sel.titleContains("recording"));
});
await test("health stays healthy after 10s", async () => {
diff --git a/.github/scripts/e2e/test-settings.ts b/.github/scripts/e2e/test-settings.ts
index 4aeed1f92..3c62d5356 100644
--- a/.github/scripts/e2e/test-settings.ts
+++ b/.github/scripts/e2e/test-settings.ts
@@ -1,25 +1,47 @@
import {
suite, test, summary, screenshot, assertExists, click,
shortcut, sleep, TIMEOUT_MEDIUM,
+ sel, shortcuts, IS_WINDOWS, IS_MACOS, bb,
} from "./lib";
suite("settings page");
async function openSettings() {
- await click("role:AXMenuBarItem AND title:screenpipe");
- await sleep(500);
- // "Settings..." (with ellipsis) is the exact menu item title
- await click("role:AXMenuItem AND title:Settings...");
+ if (IS_MACOS) {
+ await click("role:AXMenuBarItem AND title:screenpipe");
+ await sleep(500);
+ await click("role:AXMenuItem AND title:Settings...");
+ } else {
+ // On Windows, open via tray menu or navigate within the app
+ // First ensure main window is open
+ await bb("activate", "screenpipe-app");
+ await sleep(500);
+ const s = shortcuts.showApp;
+ await shortcut(s.key, s.modifiers);
+ await sleep(2000);
+ // Try clicking a settings button/link in the UI
+ try {
+ await click(sel.titleContains("settings"));
+ } catch {
+ // Fallback: try the gear icon or settings text
+ try {
+ await click(sel.button("settings"));
+ } catch {
+ // Last resort: look for any settings-related element
+ await click(sel.titleContains("Settings"));
+ }
+ }
+ }
await sleep(3000);
}
async function navigateTo(label: string) {
- await click(`role:AXStaticText AND name~:${label}`);
+ await click(sel.staticText(label));
await sleep(1000);
}
async function assertLoaded() {
- await assertExists("role:AXWebArea", TIMEOUT_MEDIUM);
+ await assertExists(sel.webArea, TIMEOUT_MEDIUM);
}
await test("open settings", async () => {
@@ -37,7 +59,8 @@ for (const section of sections) {
}
await test("close settings", async () => {
- await shortcut("w", "cmd");
+ const s = shortcuts.closeWindow;
+ await shortcut(s.key, s.modifiers);
await sleep(1000);
});
diff --git a/.github/workflows/e2e-windows.yml b/.github/workflows/e2e-windows.yml
new file mode 100644
index 000000000..a374acbff
--- /dev/null
+++ b/.github/workflows/e2e-windows.yml
@@ -0,0 +1,273 @@
+name: Windows E2E Tests
+
+on:
+ # Run after app release builds complete
+ workflow_run:
+ workflows: ["Release App"]
+ types: [completed]
+ branches: [main]
+ # Manual trigger
+ workflow_dispatch:
+ inputs:
+ runner:
+ description: "Runner label (self-hosted runner name)"
+ required: false
+ default: "windows-desktop-test"
+ fallback_to_hosted:
+ description: "Fall back to GitHub-hosted runner if self-hosted unavailable"
+ type: boolean
+ default: true
+
+concurrency:
+ group: e2e-windows-${{ github.ref }}
+ cancel-in-progress: false # don't cancel — these are slow and important
+
+jobs:
+ # ── Self-hosted runner (primary) ────────────────────────────────────────────
+ e2e-self-hosted:
+ name: Windows E2E (self-hosted)
+ runs-on: [self-hosted, "${{ inputs.runner || 'windows-desktop-test' }}"]
+ timeout-minutes: 30
+ # Only run if release build succeeded (or manual dispatch)
+ if: >
+ github.event_name == 'workflow_dispatch' ||
+ github.event.workflow_run.conclusion == 'success'
+
+ steps:
+ - uses: actions/checkout@v4
+
+ - name: System info
+ shell: pwsh
+ run: |
+ echo "hostname: $env:COMPUTERNAME"
+ echo "os: $((Get-CimInstance Win32_OperatingSystem).Caption)"
+ echo "cpu: $((Get-CimInstance Win32_Processor).Name)"
+ echo "memory: $([math]::Round((Get-CimInstance Win32_ComputerSystem).TotalPhysicalMemory / 1GB))GB"
+
+ - name: Install/update BigBrother CLI
+ shell: pwsh
+ run: |
+ $bbDir = "$env:USERPROFILE\Documents\bigbrother"
+ if (Test-Path $bbDir) {
+ cd $bbDir
+ git pull
+ } else {
+ cd "$env:USERPROFILE\Documents"
+ git clone https://github.com/louis030195/bigbrother.git
+ }
+ cd $bbDir
+ cargo build --release -p bb
+ # Add to PATH for this job
+ $bbBin = "$bbDir\target\release"
+ echo $bbBin | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
+ # Verify
+ & "$bbBin\bb.exe" --version
+
+ - name: Wait for screenpipe to be running
+ shell: pwsh
+ run: |
+ # On self-hosted runner, screenpipe should already be running as startup item
+ $proc = Get-Process -Name "screenpipe*" -ErrorAction SilentlyContinue
+ if (-not $proc) {
+ echo "screenpipe not running, attempting to start..."
+ $appPath = Get-ChildItem "$env:LOCALAPPDATA\screenpipe" -Filter "screenpipe*.exe" -Recurse | Select-Object -First 1
+ if ($appPath) {
+ Start-Process $appPath.FullName
+ Start-Sleep -Seconds 15
+ } else {
+ echo "warning: could not find screenpipe executable"
+ }
+ }
+ # Wait for health API
+ for ($i = 1; $i -le 30; $i++) {
+ try {
+ $response = Invoke-RestMethod -Uri "http://localhost:3030/health" -TimeoutSec 5
+ echo "health API ready"
+ break
+ } catch {
+ echo "waiting for health API... ($i/30)"
+ Start-Sleep -Seconds 2
+ }
+ }
+
+ - name: Setup Bun
+ uses: oven-sh/setup-bun@v2
+ with:
+ bun-version: latest
+
+ - name: Run E2E tests
+ id: e2e
+ shell: pwsh
+ env:
+ ARTIFACTS_DIR: ${{ runner.temp }}\e2e-artifacts
+ run: |
+ bun .github/scripts/e2e/run-all.ts 2>&1 | Tee-Object -FilePath "${{ runner.temp }}\e2e-full.log"
+
+ - name: Upload artifacts
+ if: always()
+ uses: actions/upload-artifact@v4
+ with:
+ name: e2e-windows-self-hosted-${{ github.run_id }}
+ path: |
+ ${{ runner.temp }}\e2e-artifacts\
+ ${{ runner.temp }}\e2e-full.log
+ retention-days: 14
+
+ # ── GitHub-hosted fallback ──────────────────────────────────────────────────
+ # Runs API-only tests (no bb/UI automation) when self-hosted is unavailable
+ e2e-hosted-fallback:
+ name: Windows E2E (hosted fallback)
+ runs-on: windows-latest
+ timeout-minutes: 45
+ needs: e2e-self-hosted
+ if: >
+ always() &&
+ needs.e2e-self-hosted.result == 'skipped' ||
+ needs.e2e-self-hosted.result == 'failure' ||
+ needs.e2e-self-hosted.result == 'cancelled'
+
+ steps:
+ - uses: actions/checkout@v4
+
+ - name: Setup Bun
+ uses: oven-sh/setup-bun@v2
+ with:
+ bun-version: latest
+
+ - name: Setup Node
+ uses: actions/setup-node@v4
+ with:
+ node-version: 22
+
+ - name: Install Chocolatey
+ run: |
+ [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
+ Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
+
+ - name: Install dependencies
+ shell: pwsh
+ run: |
+ choco install ffmpeg openssl -y
+ echo "C:\ProgramData\chocolatey\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
+
+ - name: Install Scream virtual audio
+ shell: powershell
+ run: |
+ Invoke-WebRequest https://github.com/duncanthrax/scream/releases/download/4.0/Scream4.0.zip -OutFile Scream4.0.zip
+ Expand-Archive -Path Scream4.0.zip -DestinationPath Scream
+ openssl req -batch -verbose -x509 -newkey rsa -keyout ScreamCertificate.pvk -out ScreamCertificate.cer -nodes -extensions v3_req
+ openssl pkcs12 -export -nodes -in ScreamCertificate.cer -inkey ScreamCertificate.pvk -out ScreamCertificate.pfx -passout pass:
+
+ - name: Set up MSVC
+ uses: ilammy/msvc-dev-cmd@v1
+
+ - name: Sign and Install Scream Driver
+ shell: powershell
+ run: |
+ signtool sign /v /fd SHA256 /f ScreamCertificate.pfx Scream\Install\driver\x64\Scream.cat
+ Import-Certificate -FilePath ScreamCertificate.cer -CertStoreLocation Cert:\LocalMachine\root
+ Import-Certificate -FilePath ScreamCertificate.cer -CertStoreLocation Cert:\LocalMachine\TrustedPublisher
+ Scream\Install\helpers\devcon-x64.exe install Scream\Install\driver\x64\Scream.inf *Scream
+ timeout-minutes: 5
+
+ - name: Start Windows Audio Service
+ shell: powershell
+ run: |
+ $service = Get-Service -Name audiosrv
+ if ($service.Status -ne 'Running') {
+ net start audiosrv
+ } else {
+ Write-Host "Audio service is already running"
+ }
+
+ - name: Set up Rust
+ uses: actions-rust-lang/setup-rust-toolchain@v1
+ with:
+ toolchain: stable
+ override: true
+ cache: true
+ target: x86_64-pc-windows-msvc
+ rustflags: ""
+
+ - name: Install vcpkg
+ uses: lukka/run-vcpkg@v11
+ with:
+ vcpkgGitCommitId: "7adc2e4d49e8d0efc07a369079faa6bc3dbb90f3"
+
+ - name: Install LLVM and Clang
+ uses: KyleMayes/install-llvm-action@v2
+ with:
+ version: "10.0"
+ directory: "C:\\Program Files\\LLVM"
+
+ - name: Install pip
+ uses: actions/setup-python@v5
+ with:
+ python-version: "3.13"
+
+ - name: Copy library for MKL
+ shell: pwsh
+ run: |
+ $mkl_dir = "apps/screenpipe-app-tauri/src-tauri/mkl"
+ New-Item -ItemType Directory -Force -Path $mkl_dir | Out-Null
+ python -m pip install --upgrade pip
+ $temp_dir = "temp_omp"
+ New-Item -ItemType Directory -Force -Path $temp_dir | Out-Null
+ python -m pip install intel-openmp --target $temp_dir
+ Get-ChildItem -Path $temp_dir -Recurse -Filter "*.dll" | ForEach-Object {
+ Copy-Item $_.FullName -Destination $mkl_dir -Force
+ }
+ $dll_count = (Get-ChildItem -Path $mkl_dir -Filter "*.dll").Count
+ if ($dll_count -eq 0) { throw "No DLLs found!" }
+ Remove-Item -Path $temp_dir -Recurse -Force
+
+ - name: Copy library for vcredist
+ shell: powershell
+ run: |
+ $vcredist_dir = "apps/screenpipe-app-tauri/src-tauri/vcredist"
+ New-Item -ItemType Directory -Force -Path $vcredist_dir | Out-Null
+ Copy-Item C:\Windows\System32\vcruntime140.dll -Destination $vcredist_dir -Force
+
+ - name: Build screenpipe CLI
+ shell: pwsh
+ env:
+ CARGO_PROFILE_RELEASE_STRIP: symbols
+ CARGO_PROFILE_RELEASE_PANIC: abort
+ run: cargo build --release -p screenpipe-server --target x86_64-pc-windows-msvc
+
+ - name: Start screenpipe backend
+ shell: pwsh
+ run: |
+ $env:Path = "target\x86_64-pc-windows-msvc\release;$env:Path"
+ Start-Process -FilePath "target\x86_64-pc-windows-msvc\release\screenpipe.exe" -WindowStyle Hidden
+ # Wait for health
+ for ($i = 1; $i -le 30; $i++) {
+ try {
+ Invoke-RestMethod -Uri "http://localhost:3030/health" -TimeoutSec 5
+ Write-Host "health API ready"
+ break
+ } catch {
+ Write-Host "waiting for health API... ($i/30)"
+ Start-Sleep -Seconds 2
+ }
+ }
+
+ - name: Run API-only E2E tests
+ shell: pwsh
+ env:
+ ARTIFACTS_DIR: ${{ runner.temp }}\e2e-artifacts
+ run: |
+ # On hosted runner without bb, only run API tests
+ bun .github/scripts/e2e/run-all.ts --suite api 2>&1 | Tee-Object -FilePath "${{ runner.temp }}\e2e-full.log"
+ bun .github/scripts/e2e/run-all.ts --suite recording 2>&1 | Tee-Object -FilePath "${{ runner.temp }}\e2e-recording.log" -Append
+
+ - name: Upload artifacts
+ if: always()
+ uses: actions/upload-artifact@v4
+ with:
+ name: e2e-windows-hosted-${{ github.run_id }}
+ path: |
+ ${{ runner.temp }}\e2e-artifacts\
+ ${{ runner.temp }}\e2e-full.log
+ ${{ runner.temp }}\e2e-recording.log
+ retention-days: 14