Skip to content

Update E2E test expectations to match current Dashboard design #88

Description

@frankbria

Problem

E2E tests expect a multi-tab Dashboard design with separate tabs for each feature section (Checkpoints, Metrics, Quality Gates), but the current Dashboard has only 2 tabs (Overview, Context) with all feature panels stacked on the Overview tab.

Current Design

Dashboard tabs (web-ui/src/components/Dashboard.tsx:295-320):

  1. Overview - Contains all feature panels stacked vertically:
    • Discovery Progress
    • Session Status
    • Chat Interface
    • PRD Modal
    • Task Tree View
    • Agent Status
    • Blockers Panel
    • Review Results
    • Lint Trends
    • Quality Gates Panel
    • Checkpoint Panel
    • Metrics Panel
    • Recent Activity
  2. Context - Contains Context Panel for multi-agent context management

Test Expectations

Tests expect separate tabs for each Sprint 10 feature:

  • checkpoint-tab - Navigate to checkpoint section
  • metrics-tab - Navigate to metrics section
  • Possibly quality-gates-tab (if added)

Options

Option A: Update Tests to Match Current Design (Quick - 30 minutes)

Modify tests to:

  1. Remove tab navigation (checkpoint-tab, metrics-tab)
  2. Directly scroll to panels (they're on Overview by default)
  3. Update assertions for stacked layout

Pros:

  • Quick fix
  • No UI changes needed
  • Tests match current implementation

Cons:

  • Loses separation of concerns in tests
  • All panels must load on Overview (slower initial render)

Example Test Change:

// BEFORE
test.beforeEach(async ({ page }) => {
  await page.goto(`${FRONTEND_URL}/projects/${PROJECT_ID}`);
  
  const checkpointTab = page.locator('[data-testid="checkpoint-tab"]');
  await checkpointTab.click();
});

// AFTER
test.beforeEach(async ({ page }) => {
  await page.goto(`${FRONTEND_URL}/projects/${PROJECT_ID}`);
  
  // Checkpoint panel is on Overview tab by default
  const checkpointPanel = page.locator('[data-testid="checkpoint-panel"]');
  await checkpointPanel.scrollIntoViewIfNeeded();
});

Option B: Refactor Dashboard to Match Test Expectations (Recommended - 1-2 hours)

Create dedicated tabs for Sprint 10 features:

  1. Overview - High-level status, discovery, chat, agents
  2. Tasks - Task tree, blockers, review results
  3. Quality Gates - Quality gate checks
  4. Checkpoints - Checkpoint list and management
  5. Metrics - Cost dashboard and token usage
  6. Context - Context panel (existing)

Pros:

  • Better UX - focused views
  • Faster tab switching (lazy load panels)
  • Matches test expectations without test changes
  • Cleaner navigation
  • Easier to find specific features

Cons:

  • More UI work (1-2 hours)
  • Need to update DashboardTab type
  • Need to reorganize panel rendering

Implementation:

// web-ui/src/types/dashboard.ts
export type DashboardTab = 
  | 'overview' 
  | 'tasks'
  | 'quality-gates'
  | 'checkpoints'
  | 'metrics'
  | 'context';

// web-ui/src/components/Dashboard.tsx
{activeTab === 'checkpoints' && (
  <div role="tabpanel" id="checkpoints-panel">
    <CheckpointList projectId={projectId} refreshInterval={30000} />
  </div>
)}

{activeTab === 'metrics' && (
  <div role="tabpanel" id="metrics-panel">
    <CostDashboard projectId={projectId} />
  </div>
)}

Recommendation

Option B - Refactor Dashboard to match test expectations

Rationale:

  1. Tests were written with good UX in mind (focused views)
  2. Current Overview tab is too cluttered (13 different panels)
  3. Dedicated tabs improve navigation and performance
  4. No test changes needed - tests are already correct
  5. Sets better foundation for future feature additions

Decision Criteria

  • If time-constrained: Option A (modify tests)
  • If building for production: Option B (refactor Dashboard)
  • If tests need to pass ASAP: Option A
  • If UX matters: Option B

Impact

Affects all 12 failed E2E tests:

  • 8 checkpoint tests would benefit from dedicated tab
  • 3 metrics tests would benefit from dedicated tab
  • 1 WebSocket test unaffected

Acceptance Criteria

If Option A (Update Tests):

  • Remove tab navigation from checkpoint tests
  • Remove tab navigation from metrics tests
  • Update tests to scroll to panels
  • All E2E tests pass with updated expectations

If Option B (Refactor Dashboard):

  • Add 4 new tabs: Tasks, Quality Gates, Checkpoints, Metrics
  • Move relevant panels to each tab
  • Add data-testid to all tab buttons
  • Implement lazy loading for tab content (optional)
  • All E2E tests pass without changes

Files to Modify

Option A (Tests):

  • tests/e2e/test_checkpoint_ui.spec.ts - Remove tab navigation
  • tests/e2e/test_metrics_ui.spec.ts - Remove tab navigation

Option B (Dashboard):

  • web-ui/src/types/dashboard.ts - Update DashboardTab type
  • web-ui/src/components/Dashboard.tsx - Add tabs and reorganize panels
  • Tests: No changes needed

Related Issues

Metadata

Metadata

Assignees

Labels

P1-high-betaHigh priority - should fix before beta for best experienceenhancementNew feature or requestpriority:mediumtestingtype:bugSomething is broken and needs fixing

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions