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: make brain live view e2e retry-safe

Louis Beaumont3bc376c5f5cc
diff --git a/apps/screenpipe-app-tauri/e2e/specs/brain-overview.spec.ts b/apps/screenpipe-app-tauri/e2e/specs/brain-overview.spec.ts
index 3b856d8ba..16a5ac2df 100644
--- a/apps/screenpipe-app-tauri/e2e/specs/brain-overview.spec.ts
+++ b/apps/screenpipe-app-tauri/e2e/specs/brain-overview.spec.ts
@@ -22,6 +22,10 @@ interface OutputTarget {
revision: number;
}
+interface BrainView {
+ id: string;
+}
+
describe("Brain Live Views", function () {
this.timeout(120_000);
@@ -35,6 +39,14 @@ describe("Brain Live Views", function () {
};
if (config.key) headers.Authorization = `Bearer ${config.key}`;
+ // WDIO retries run against the same app process and data directory. Reset
+ // this test-owned view so a previous failed attempt cannot turn creation
+ // into an optimistic-concurrency update.
+ const existingViews = await invokeOrThrow<BrainView[]>("list_brain_views");
+ if (existingViews.some((view) => view.id === "my-overview")) {
+ await invokeOrThrow("delete_brain_view", { id: "my-overview" });
+ }
+
const slots = [
{
id: "focus-time",
@@ -188,7 +200,7 @@ describe("Brain Live Views", function () {
() => document.body?.innerText || "",
)) as string;
expect(renderedText).toContain("Live Views");
- expect(renderedText).toContain("Dashboards");
+ expect(renderedText).toContain("DASHBOARDS");
expect(renderedText).toContain("CUSTOMIZE");
expect(renderedText).toContain("How I worked today");
expect(renderedText).toContain("Automation opportunities");