From a52673c1c1fdd917c6bb4e2f102cca18baa2bfe0 Mon Sep 17 00:00:00 2001 From: loganj Date: Wed, 19 Aug 2026 15:39:28 +0000 Subject: [PATCH] test(desktop): stabilize smoke coverage under load Signed-off-by: loganj --- .github/workflows/ci.yml | 4 ++-- desktop/playwright.config.ts | 1 + .../e2e/message-feedback-snapshots.spec.ts | 2 ++ desktop/tests/e2e/messaging.spec.ts | 17 ++++++++++++----- .../tests/e2e/onboarding-agent-defaults.spec.ts | 8 ++++---- 5 files changed, 21 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a832c0a0af..9ca12c7cae 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -234,7 +234,7 @@ jobs: strategy: fail-fast: false matrix: - shard: [1, 2, 3, 4] + shard: [1, 2, 3, 4, 5, 6, 7, 8] permissions: contents: read steps: @@ -274,7 +274,7 @@ jobs: - name: Desktop E2E build run: pnpm -C desktop build:e2e - name: Desktop smoke e2e - run: cd desktop && pnpm exec playwright test --project=smoke --shard=${{ matrix.shard }}/4 + run: cd desktop && pnpm exec playwright test --project=smoke --shard=${{ matrix.shard }}/8 - name: Summarize flaky tests if: ${{ !cancelled() }} run: node scripts/summarize-flaky-tests.mjs playwright-report.json "Desktop Smoke E2E (${{ matrix.shard }})" diff --git a/desktop/playwright.config.ts b/desktop/playwright.config.ts index 7d06c4da91..30f9a7f6c2 100644 --- a/desktop/playwright.config.ts +++ b/desktop/playwright.config.ts @@ -8,6 +8,7 @@ export default defineConfig({ reporter: [ ["list"], ["html", { open: "never", outputFolder: "playwright-report" }], + ["json", { outputFile: "playwright-report.json" }], ], use: { baseURL: "http://127.0.0.1:4173", diff --git a/desktop/tests/e2e/message-feedback-snapshots.spec.ts b/desktop/tests/e2e/message-feedback-snapshots.spec.ts index 18776d7f25..76f1b975a2 100644 --- a/desktop/tests/e2e/message-feedback-snapshots.spec.ts +++ b/desktop/tests/e2e/message-feedback-snapshots.spec.ts @@ -101,10 +101,12 @@ test("profile hover uses the channel hover surface", async ({ page }) => { const profile = page.getByTestId("sidebar-profile-card"); const channel = page.getByTestId("channel-random"); await channel.hover(); + await waitForAnimations(page); const channelHoverColor = await channel.evaluate( (element) => getComputedStyle(element).backgroundColor, ); await profile.hover(); + await waitForAnimations(page); await expect(profile).toHaveCSS("background-color", channelHoverColor); await waitForAnimations(page); diff --git a/desktop/tests/e2e/messaging.spec.ts b/desktop/tests/e2e/messaging.spec.ts index 368a15b3f1..e4c511e751 100644 --- a/desktop/tests/e2e/messaging.spec.ts +++ b/desktop/tests/e2e/messaging.spec.ts @@ -374,6 +374,18 @@ test.beforeEach(async ({ page }, testInfo) => { ...(testInfo.title.includes("clears Sending after") ? { sendMessageDelayMs: 800 } : {}), + ...(testInfo.title.includes("shows your avatar") + ? { + searchProfiles: [ + { + pubkey: TEST_IDENTITIES.tyler.pubkey, + displayName: "tyler", + avatarUrl: + 'data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"%3E%3Crect width="16" height="16" rx="4" fill="%2300a36c"/%3E%3C/svg%3E', + }, + ], + } + : {}), }; await installMockBridge(page, mock); }); @@ -2321,11 +2333,6 @@ test("shows your avatar on your own message when profile avatar is set", async ( 'data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"%3E%3Crect width="16" height="16" rx="4" fill="%2300a36c"/%3E%3C/svg%3E'; await page.goto("/"); - await openSettings(page, "profile"); - await page.getByTestId("profile-avatar-edit").click(); - await page.getByTestId("profile-avatar-url").fill(avatarUrl); - await page.getByTestId("profile-avatar-done").click(); - await page.getByTestId("settings-back-to-app").click(); await page.getByTestId("channel-general").click(); await expect(page.getByTestId("chat-title")).toHaveText("general"); diff --git a/desktop/tests/e2e/onboarding-agent-defaults.spec.ts b/desktop/tests/e2e/onboarding-agent-defaults.spec.ts index 3a15d21767..3b55aa8380 100644 --- a/desktop/tests/e2e/onboarding-agent-defaults.spec.ts +++ b/desktop/tests/e2e/onboarding-agent-defaults.spec.ts @@ -951,7 +951,7 @@ test("concurrent installs each keep their own state — one fails, one succeeds" // Per-runtime config lets both be in flight simultaneously. installAcpRuntimeByRuntime: { claude: { - delayMs: 600, + delayMs: 6_000, result: { success: false, steps: [ @@ -967,7 +967,7 @@ test("concurrent installs each keep their own state — one fails, one succeeds" }, }, codex: { - delayMs: 200, + delayMs: 2_000, result: { success: true, steps: [ @@ -1006,7 +1006,7 @@ test("concurrent installs each keep their own state — one fails, one succeeds" // Codex settles first (shorter delay): success indicator, no error. await expect(page.getByTestId("onboarding-runtime-ready-codex")).toBeVisible({ - timeout: 3_000, + timeout: 10_000, }); await expect(page.getByTestId("onboarding-runtime-error-codex")).toHaveCount( 0, @@ -1017,7 +1017,7 @@ test("concurrent installs each keep their own state — one fails, one succeeds" // Claude settles: failure error visible; codex still shows ready (not reset). const claudeError = page.getByTestId("onboarding-runtime-error-claude"); - await expect(claudeError).toBeVisible({ timeout: 3_000 }); + await expect(claudeError).toBeVisible({ timeout: 10_000 }); await expect( page.getByTestId("onboarding-runtime-ready-codex"), ).toBeVisible();