MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / run

Function run

e2e/desktop/update-card.test.ts:53–83  ·  view source on GitHub ↗
(runDir: string)

Source from the content-addressed store, hash-verified

51);
52
53const run = async (runDir: string) => {
54 const home = mkdtempSync(join(tmpdir(), "executor-update-desktop-"));
55 const app = await launchDesktop(home);
56 try {
57 const page = await app.firstWindow({ timeout: 120_000 });
58 await page.waitForLoadState("domcontentloaded");
59 await page.locator("aside.desktop-macos-sidebar").waitFor({ timeout: 90_000 });
60
61 // The desktop-native card: the available version and a Restart action — and
62 // crucially NOT the npm command the web/CLI card carries.
63 await page.getByText("Update available").waitFor({ timeout: 60_000 });
64 await page.getByText(`v${FORCED_VERSION}`).waitFor({ timeout: 10_000 });
65 const restart = page.getByRole("button", { name: "Restart to update" });
66 await restart.waitFor({ timeout: 10_000 });
67 expect(
68 await page.getByText("npm i -g", { exact: false }).count(),
69 "the desktop card shows no npm command",
70 ).toBe(0);
71 await page.screenshot({ path: join(runDir, "01-desktop-update-card.png") });
72
73 // Clicking Restart drives the install IPC. Outside a packaged build that
74 // reflects "installing" rather than quitting (the real quitAndInstall only
75 // runs packaged), so the wiring is provable without tearing the app down.
76 await restart.click();
77 await page.getByText("Restarting…").waitFor({ timeout: 10_000 });
78 await page.screenshot({ path: join(runDir, "02-restarting.png") });
79 } finally {
80 await app.close().catch(() => {});
81 rmSync(home, { recursive: true, force: true });
82 }
83};

Callers 1

Calls 3

countMethod · 0.80
launchDesktopFunction · 0.70
closeMethod · 0.65

Tested by

no test coverage detected