From dede51d2862e68227d57ab23f7359a66354243d8 Mon Sep 17 00:00:00 2001 From: Devin Foley Date: Sun, 4 Oct 2026 00:19:21 -0700 Subject: [PATCH] test: prevent announcements from obscuring quota screenshots Co-Authored-By: Paperclip --- tests/e2e/cost-accounting.spec.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tests/e2e/cost-accounting.spec.ts b/tests/e2e/cost-accounting.spec.ts index 926a9d693ca..37a011c4cb9 100644 --- a/tests/e2e/cost-accounting.spec.ts +++ b/tests/e2e/cost-accounting.spec.ts @@ -33,16 +33,17 @@ test("provider quotas keep accounts separate, preserve unknown usage, and retain await page.setViewportSize({ width: 1440, height: 1000 }); await page.clock.install(); await page.goto(`/${company.issuePrefix}/activity/costs`); - const dismissAnnouncement = page.getByRole("button", { name: "Dismiss announcement" }); - if (await dismissAnnouncement.isVisible()) await dismissAnnouncement.click(); await page.getByRole("tab", { name: "Providers", exact: true }).click(); const personal = page.locator("section").filter({ has: page.getByText("Personal subscription", { exact: true }) }); const team = page.locator("section").filter({ has: page.getByText("Team subscription", { exact: true }) }); const providerCard = page.locator('[data-slot="card"]').filter({ has: personal }); + // Announcement timing is unrelated to quota behavior; keep its floating + // card from covering the evidence when the provider card scrolls into view. + const screenshotOptions = { style: '[aria-label="Paperclip announcements"] { visibility: hidden; }' }; await expect(personal.getByRole("progressbar", { name: "5h: 42%" })).toBeVisible(); await expect(team.getByText("Usage not reported", { exact: true })).toBeVisible(); await expect(team.getByRole("progressbar")).toHaveCount(0); - await info.attach("provider-quota-multiple-accounts-and-unknown-usage", { body: await providerCard.screenshot(), contentType: "image/png" }); + await info.attach("provider-quota-multiple-accounts-and-unknown-usage", { body: await providerCard.screenshot(screenshotOptions), contentType: "image/png" }); refreshFails = true; const refresh = page.waitForResponse(response => response.url().endsWith("/costs/quota-windows")); @@ -52,7 +53,7 @@ test("provider quotas keep accounts separate, preserve unknown usage, and retain await expect(team.getByText("Usage not reported", { exact: true })).toBeVisible(); await expect(personal.getByText("Showing the last available quota. Updates will resume automatically.", { exact: true })).toBeVisible(); await expect(page.getByText("raw provider command failed", { exact: false })).toHaveCount(0); - await info.attach("provider-quota-refresh-failure-retains-readings", { body: await providerCard.screenshot(), contentType: "image/png" }); + await info.attach("provider-quota-refresh-failure-retains-readings", { body: await providerCard.screenshot(screenshotOptions), contentType: "image/png" }); } finally { await request.delete(api); }