test(desktop): stabilize smoke coverage under load

Signed-off-by: loganj <loganj@squareup.com>
This commit is contained in:
loganj
2026-08-19 15:39:28 +00:00
parent fe7c6808e7
commit a52673c1c1
5 changed files with 21 additions and 11 deletions

View File

@@ -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 }})"

View File

@@ -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",

View File

@@ -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);

View File

@@ -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");

View File

@@ -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();