Create polished demo videos without editing skills. Mac/Windows/Linux
Make recorder and dashboard regression tests deterministic
webadderalld660b8bb59c3
diff --git a/electron/native/ScreenCaptureKitRecorder.lifecycle.test.ts b/electron/native/ScreenCaptureKitRecorder.lifecycle.test.tsindex 0d29d986..1e01a43e 100644--- a/electron/native/ScreenCaptureKitRecorder.lifecycle.test.ts+++ b/electron/native/ScreenCaptureKitRecorder.lifecycle.test.ts@@ -20,10 +20,15 @@ describe.skipIf(process.platform !== "darwin")("recorder process lifecycle", ()source.indexOf("final class RecorderService"),source.indexOf("guard CommandLine.arguments.count"),);- const commands = source.slice(- source.indexOf("let service = RecorderService()"),- source.indexOf("if !service.waitUntilFinished()"),- );+ const commands = source+ .slice(+ source.indexOf("let service = RecorderService()"),+ source.indexOf("if !service.waitUntilFinished()"),+ )+ .replace(+ "service.stop()",+ "service.stop()\n\tservice.drainCommandsForTest()\n\tcommandsFinished.signal()",+ );writeFileSync(join(directory, "main.swift"),`@@ -47,10 +52,14 @@ final class ScreenCaptureRecorder {func resumeCapture() async -> Bool { true }}${service}+extension RecorderService {+ func drainCommandsForTest() { queue.sync {} }+}+let commandsFinished = DispatchSemaphore(value: 0)${commands}let success = service.waitUntilFinished()-// Keep the process alive long enough to expose a queued second group release.-Thread.sleep(forTimeInterval: 0.2)+// Wait for the reader to enqueue stop AND for the serialized operations to finish.+commandsFinished.wait()exit(success ? 0 : 1)`,);diff --git a/tests/ui/project-dashboard.spec.ts b/tests/ui/project-dashboard.spec.tsindex 8a046619..cff055b3 100644--- a/tests/ui/project-dashboard.spec.ts+++ b/tests/ui/project-dashboard.spec.ts@@ -2,7 +2,7 @@ import fs from "node:fs/promises";import path from "node:path";import { hasFreshProjectThumbnail } from "../../electron/ipc/project/thumbnailFreshness";import { expect, test } from "@playwright/test";-import { installDesktopBridge } from "./bridge";+import { installDesktopBridge, installDesktopBridgeOverrides } from "./bridge";test("home dashboard searches, sorts, opens projects and returns to the editor", async ({page,@@ -746,7 +746,7 @@ test("sidebar cards, separate Import, and shortcut settings use the dashboard fltest("empty filtered libraries do not prompt for a first recording", async ({ page }) => {await installDesktopBridge(page);- await page.addInitScript(() => {+ await installDesktopBridgeOverrides(page, () => {window.electronAPI.getCurrentVideoPath = async () => ({ success: false });});await page.goto("/?windowType=editor");