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 audio service health

Louis Beaumont3657a1c9d77e
diff --git a/apps/screenpipe-app-tauri/e2e/README.md b/apps/screenpipe-app-tauri/e2e/README.md
index 795d5a311..73eb9137c 100644
--- a/apps/screenpipe-app-tauri/e2e/README.md
+++ b/apps/screenpipe-app-tauri/e2e/README.md
@@ -160,7 +160,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 recording and requires API auth, health/load, audio, vision, and search endpoints to stay responsive. 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, TCP listeners, process health, Defender visibility, concurrent local API load, focus churn, and rapid Home-window routing |
+| `windows-system-integration.spec.ts` | Windows-only. Verifies isolated data dir, native DLL/WebView2 runtime, display/DPI topology, TCP listeners, process health, Defender visibility, audio service/device health, concurrent local API load, focus churn, and rapid Home-window routing |
| `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 9b62c943e..8409c1c95 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
@@ -44,6 +44,18 @@ type WebView2Info = {
version: string;
};
+type WindowsAudioInfo = {
+ audioService: string;
+ endpointBuilderService: string;
+ audioPnPDeviceCount: number;
+ screamDevicePresent: boolean;
+};
+
+type HealthBody = {
+ status?: string;
+ audio_status?: string;
+};
+
function ps(command: string, timeout = 15_000): string {
return execFileSync(
"powershell.exe",
@@ -284,6 +296,53 @@ if ($hits) { Write-Output "BLOCKED:$($hits.Count)" } else { Write-Output "CLEAR"
expect(result).toBe("CLEAR");
});
+ it("keeps Windows audio services and the device-status API healthy", async function () {
+ if (!isWindows || !api) this.skip();
+
+ const json = ps(`
+$names = New-Object System.Collections.Generic.List[string]
+Get-CimInstance Win32_SoundDevice -ErrorAction SilentlyContinue | ForEach-Object {
+ if ($_.Name) { [void]$names.Add([string]$_.Name) }
+}
+if (Get-Command Get-PnpDevice -ErrorAction SilentlyContinue) {
+ Get-PnpDevice -Class MEDIA -ErrorAction SilentlyContinue | ForEach-Object {
+ if ($_.FriendlyName) { [void]$names.Add([string]$_.FriendlyName) }
+ }
+}
+$audioService = Get-Service -Name Audiosrv -ErrorAction SilentlyContinue
+$endpointBuilder = Get-Service -Name AudioEndpointBuilder -ErrorAction SilentlyContinue
+$uniqueNames = @($names | Sort-Object -Unique)
+[PSCustomObject]@{
+ audioService = [string]$audioService.Status
+ endpointBuilderService = [string]$endpointBuilder.Status
+ audioPnPDeviceCount = $uniqueNames.Count
+ screamDevicePresent = @($uniqueNames | Where-Object { $_ -match 'Scream' }).Count -gt 0
+} | ConvertTo-Json -Compress
+`);
+ const audio = JSON.parse(json) as WindowsAudioInfo;
+
+ expect(audio.audioService).toBe("Running");
+ expect(audio.endpointBuilderService).toBe("Running");
+ expect(audio.audioPnPDeviceCount).toBeGreaterThan(0);
+ if (process.env.GITHUB_ACTIONS === "true") {
+ expect(audio.screamDevicePresent).toBe(true);
+ }
+
+ const [health, deviceStatus] = await Promise.all([
+ fetchJson(apiUrl(api, "/health")),
+ fetchJson(apiUrl(api, "/audio/device/status")),
+ ]);
+ const healthBody = health.body as HealthBody;
+
+ expect(health.ok).toBe(true);
+ expect(typeof healthBody.audio_status).toBe("string");
+ expect(deviceStatus.status).toBeGreaterThan(0);
+ expect(deviceStatus.status).toBeLessThan(500);
+ if (deviceStatus.ok) {
+ expect(typeof deviceStatus.body).toBe("object");
+ }
+ });
+
it("handles concurrent Windows health/search/vision requests without deadlock", async function () {
if (!isWindows || !api) this.skip();