Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

fix(desktop): poll the smoke window size until the maximize lands (#97182)

Julian Beze921dbb8d1e5
diff --git a/products/desktop/apps/code/tests/e2e/tests/smoke.spec.ts b/products/desktop/apps/code/tests/e2e/tests/smoke.spec.ts
index 555cd5530b8f..9ee0e5cf1db4 100644
--- a/products/desktop/apps/code/tests/e2e/tests/smoke.spec.ts
+++ b/products/desktop/apps/code/tests/e2e/tests/smoke.spec.ts
@@ -50,13 +50,21 @@ test.describe("Smoke Tests", () => {
});
test("window has correct minimum dimensions", async ({ window }) => {
- const bounds = await window.evaluate(() => ({
- width: window.innerWidth,
- height: window.innerHeight,
- }));
+ // The main process maximizes the window on ready-to-show, which can land
+ // after domcontentloaded. Poll so the assertion sees the final size, not
+ // the 600px outer frame the window opens with.
+ const bounds = () =>
+ window.evaluate(() => ({
+ width: window.innerWidth,
+ height: window.innerHeight,
+ }));
- expect(bounds.width).toBeGreaterThanOrEqual(900);
- expect(bounds.height).toBeGreaterThanOrEqual(600);
+ await expect
+ .poll(async () => (await bounds()).width, { timeout: 10000 })
+ .toBeGreaterThanOrEqual(900);
+ await expect
+ .poll(async () => (await bounds()).height, { timeout: 10000 })
+ .toBeGreaterThanOrEqual(600);
});
test("app does not crash within 10 seconds of boot", async ({