Day 13: Dashboard E2E Testing, Performance Validation & Backend Fixes

~5 min read

What I Built

  • Complete Next.js 16 admin console with TypeScript and Tailwind CSS
  • 30 Playwright E2E tests across 5 browsers (Chrome, Firefox, Safari, Mobile)
  • Lighthouse performance auditing with 90+ score targets
  • Frontend performance tests (load time <3s, 50+ FPS interactions)
  • k6 load testing for dashboard APIs (p95 <500ms, p99 <1s)
  • Performance budgets and Core Web Vitals monitoring
  • Fixed backend test UNIQUE constraint violations with UUID-based IBKR order IDs
  • Resolved Python 3.14 datetime deprecation warnings by migrating to timezone-aware datetime.now(timezone.utc)
  • All 100 backend tests passing with zero deprecation warnings

Code Highlight

// packages/console/e2e/dashboard.spec.ts
test.describe("Dashboard", () => {
  test.beforeEach(async ({ page }) => {
    await page.goto("http://localhost:3000");
  });

  test("should display profile comparison metrics", async ({ page }) => {
    const profiles = page.locator('[data-testid="profile-comparison"]');
    await expect(profiles).toBeVisible();

    // Check that multiple profiles are shown
    const profileCards = page.locator('[data-testid="profile-card"]');
    await expect(profileCards).toHaveCountGreaterThan(1);
  });
});

Backend Fixes Code Highlight

# Fixed UNIQUE constraint violations in tests
unique_ibkr_id = f"IBKR-{uuid4().hex[:8].upper()}"
await manager.mark_submitted(pending.id, unique_ibkr_id)

# Migrated from deprecated datetime.utcnow() to timezone-aware
from datetime import datetime, timezone
timestamp=datetime.now(timezone.utc),  # Instead of datetime.utcnow()
created_at=datetime.now(timezone.utc),  # Instead of datetime.utcnow()

Architecture Decision

Renamed packages/web to packages/console for clarity - eliminates confusion between the marketing website and admin console. The admin console is now properly scoped as the professional trading dashboard frontend.

Testing Results

All 30 E2E tests pass across 5 browser configurations, covering Phase 1 dashboard features:

  • Dashboard loading with equity curve visualization
  • Real-time SSE equity updates (simulated)
  • Timezone conversion for trade timestamps
  • Trade history table sorting functionality
  • Profile comparison metrics display
  • API error handling with graceful degradation
  • Performance: load time <3s, 50+ FPS interactions
  • Load testing: p95 <500ms, p99 <1s for dashboard APIs

Backend testing suite fully validated with all 100 tests passing:

  • Fixed UNIQUE constraint violations in IBKR order ID tests
  • Eliminated Python 3.14 datetime deprecation warnings
  • Zero deprecation warnings from application code
  • All async database operations and state transitions working

Next Steps

Day 14: Edge hypothesis definition and live trading gates - defining the EMA+RSI strategy parameters and establishing the criteria for moving from paper trading to live trading.


Follow @therealkamba on X for regular updates. View all posts →