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(e2e): stop bottom-right toasts blocking insight side panel clicks (#82398)

posthog[bot]4d03c8c3f10b
diff --git a/.github/workflows/ci-e2e-playwright.yml b/.github/workflows/ci-e2e-playwright.yml
index 6a7c9f4ce649..029b44e88c4a 100644
--- a/.github/workflows/ci-e2e-playwright.yml
+++ b/.github/workflows/ci-e2e-playwright.yml
@@ -1066,6 +1066,14 @@ jobs:
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
run: |
BRANCH="${{ github.event_name == 'pull_request' && format('pr-{0}', github.event.number) || 'master' }}"
+ # Cloudflare Pages rejects any single file over 25 MiB, which fails the whole
+ # deploy and leaves triagers with no report on a red run. Trace zips and videos
+ # can cross that, so drop them from the copy we publish; the full attachments
+ # stay in the uploaded playwright-test-results artifact. Prune at 24 MiB for margin.
+ # Guarded and non-fatal so a missing/partial report dir still reaches the deploy.
+ if [ -d playwright/playwright-report ]; then
+ find playwright/playwright-report -type f -size +24M -printf 'Pruning oversized report file (%s bytes): %p\n' -delete || true
+ fi
npx --yes wrangler@3 pages deploy playwright/playwright-report \
--project-name=playwright-report \
--branch="$BRANCH" \
diff --git a/playwright/page-models/insightPage.ts b/playwright/page-models/insightPage.ts
index 3797cdae523c..632d64356e3c 100644
--- a/playwright/page-models/insightPage.ts
+++ b/playwright/page-models/insightPage.ts
@@ -226,6 +226,31 @@ export class InsightPage {
// #side-panel, confirming the switch is complete. Scoping to #side-panel
// avoids matching the hidden inline panel.
await this.page.locator('#side-panel .scene-panel-actions-section').first().waitFor({ state: 'visible' })
+ await this.dismissToasts()
+ }
+
+ // Toasts render in the bottom-right corner, which overlaps the bottom of the
+ // side panel. A sticky error toast (the support widget is unavailable in E2E,
+ // so it opens with autoClose:false) or a lingering success/hint toast there
+ // permanently intercepts clicks on the panel's lowest actions — View source
+ // and Delete insight. Close every open toast so those actions are reachable.
+ private async dismissToasts(): Promise<void> {
+ const closeButtons = this.page.locator(
+ '.Toastify__toast [data-attr="toast-close-button"], .Toastify__toast [data-attr="mcp-hint-close"]'
+ )
+ for (let attempt = 0; attempt < 10 && (await closeButtons.count()) > 0; attempt++) {
+ await closeButtons
+ .first()
+ .click({ timeout: 2000 })
+ .catch(() => undefined)
+ }
+ // react-toastify removes a closed toast with a slide-out animation, so a toast
+ // can still intercept clicks for a moment after its close button is clicked. Wait
+ // for the stack to clear so the next action is reachable. Non-fatal: if a stray
+ // toast lingers, the caller's own click retry is the backstop.
+ await expect(this.page.locator('.Toastify__toast'))
+ .toHaveCount(0, { timeout: 5000 })
+ .catch(() => undefined)
}
async clickDeleteInsight(): Promise<void> {