Add comprehensive E2E tests for trace viewer with adversarial cases#353
Add comprehensive E2E tests for trace viewer with adversarial cases#353anandgupta42 merged 6 commits intomainfrom
Conversation
- Tab switching: use closest('.tab') instead of ev.target.dataset for
robust event delegation, fix variable shadowing of 't' trace data
- Waterfall view: switch from per-row onclick closures to event
delegation with data-idx, preventing potential closure bugs
- Tree view: use index-based span lookup (data-idx) instead of
spanId-based lookup (data-sid), fixing duplicate spanId edge case
- Log view: make entries clickable with detail panel support, add
selection highlighting (.log-entry.sel)
- All views now use consistent event delegation pattern with
closest() for click handling
https://claude.ai/code/session_01G3S1w3PzzCwdAMb6GkD8sV
Add 39 Playwright-based tests covering: - E2E user flows: tab switching, waterfall/tree/log clicks, detail panel, chat view, summary cards, header tags, rapid tab switching - Adversarial cases: empty spans, single session, duplicate spanIds, XSS in names/metadata, special chars in spanId, null/undefined spanIds, very long names (10K chars), 100+ spans, error status, orphaned spans, deeply nested tree (5 levels), missing metadata/summary, circular refs, DE attributes, negative/zero durations, live mode, unicode https://claude.ai/code/session_01G3S1w3PzzCwdAMb6GkD8sV
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (4)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
… expanding - Waterfall: shows tool input summary (command, file path, query) and generation model/tokens inline - Tree: adds preview line below each span name with the same smart summaries - Log: shows tool input preview and generation model inline alongside existing output preview - New getPreview() helper extracts the most useful field from span input based on kind https://claude.ai/code/session_01G3S1w3PzzCwdAMb6GkD8sV
Summary
Added extensive end-to-end tests for the trace viewer HTML renderer using Playwright, covering both normal user workflows and adversarial edge cases. Also fixed several bugs in the viewer's event handling and styling discovered during test development.
Changes:
Test Suite (
tracing-viewer-e2e.test.ts):Viewer Fixes (
viewer.ts):.closest('.tab')for more robust event delegation.selstyling for log entries to show selection state (matching waterfall/tree behavior)cursor: pointerto log entries to indicate clickabilityDependencies:
playwright-core1.58.2 to dev dependencies for browser automationTest Plan
The new test suite provides comprehensive coverage:
Tests are skipped gracefully if Chromium is not available in the environment.
Checklist
https://claude.ai/code/session_01G3S1w3PzzCwdAMb6GkD8sV