Dashboardspotlightgetsentry/spotlight E2E: body.textConte…

getsentry/spotlight E2E: body.textContent() races React hydration — use web-first nav selector instead

Category: gotcha
Confidence: 0.90
ID: 019ef50a-80f4-736b-b2ec-4b8b7fb04d66
Project ID: ec1699be-a430-4fc6-879b-c437a47171b4
Cross-project: No
Recalled in other projects: 2
Source session: 1Kk7IpoikrcYvirwm
Created: 2026-06-23 15:12:46
Updated: 2026-06-23 15:12:46

Cross-Project Recalls

ProjectHitsLast recalled
opencode-lore 1 13h ago
opencode 1 10d ago

Content

Trap: body.waitFor() then body.textContent() !== '' looks like a safe readiness check because the body element exists immediately. Fix: the body element is present in the SPA HTML shell before React hydrates, so a one-shot read races React's first render. Other tests pass incidentally due to sendTestEnvelope 500ms settle delay or explicit waitForTimeout(1000). Stable readiness selector: nav[aria-label="Navigation"] in TelemetrySidebar.tsx — renders unconditionally once React mounts, independent of event data. Use a waitForAppReady(page, timeout) helper in fixtures.ts that asserts this nav locator is visible with Playwright's built-in auto-retry.

Move to: