Skip to content

Commit ff1c08b

Browse files
author
Test User
committed
fix(e2e): remove antipatterns that caused false-positive test passes
Refactored E2E test suite to fail properly when UI elements don't render: - Remove test.skip() inside test bodies (masks bugs when UI fails to load) - Replace expect(x || true).toBe(true) with Playwright's locator.or() - Add else branches to conditional visibility checks with logging - Replace .catch(() => false) with explicit error handling - Add new test_assign_tasks_button.spec.ts for Assign Tasks functionality - Expand seed-test-data.py with additional test project states Files refactored: - test_late_joining_user.spec.ts (3 test.skip removals) - test_task_breakdown.spec.ts (7 test.skip removals) - test_checkpoint_ui.spec.ts (always-true assertions, error swallowing) - test_review_ui.spec.ts (always-true assertions, conditionals) - test_dashboard.spec.ts (error swallowing, conditionals) - test_complete_user_journey.spec.ts (conditional visibility) - test_task_execution_flow.spec.ts (error swallowing, conditionals) - test_metrics_ui.spec.ts (or-patterns, conditionals, error swallowing) Tests now properly fail when expected UI elements are missing, rather than silently passing due to conditional logic.
1 parent 5d13d29 commit ff1c08b

15 files changed

+1039
-209
lines changed

.beads/issues.jsonl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@
162162
{"id":"codeframe-uy5","title":"T119: Unit test for validateAgentCount warns at 11 agents","description":"Unit test for validateAgentCount warns at 11 agents in web-ui/__tests__/lib/validation.test.ts","design":"Create unit test that verifies validateAgentCount function warns when agent count exceeds 10","acceptance_criteria":"- [ ] Test file created\n- [ ] Test verifies warning at 11 agents\n- [ ] Test passes","status":"closed","priority":0,"issue_type":"task","created_at":"2025-11-07T14:04:11.223448022-07:00","updated_at":"2025-11-07T14:13:32.314257251-07:00","closed_at":"2025-11-07T14:13:32.314257251-07:00"}
163163
{"id":"codeframe-vta","title":"Phase 2.2: Frontend Worker Agent Tests","description":"Comprehensive test suite for FrontendWorkerAgent (28 tests covering component generation, type generation, file creation, error handling)","status":"closed","priority":0,"issue_type":"task","created_at":"2025-11-06T20:35:36.435916686-07:00","updated_at":"2025-11-06T20:39:04.699029524-07:00","closed_at":"2025-11-06T20:39:04.699029524-07:00","labels":["testing sprint-4"]}
164164
{"id":"codeframe-vzo","title":"T107: Remove local WebSocket message handlers","description":"Remove local WebSocket message handlers (now in Provider) from Dashboard.tsx","design":"Remove WebSocket message handling code from Dashboard since it's now handled by AgentStateProvider","acceptance_criteria":"- [ ] Local WebSocket handlers removed\n- [ ] No duplicate message processing\n- [ ] Component works correctly","status":"closed","priority":0,"issue_type":"task","created_at":"2025-11-07T13:34:48.841751353-07:00","updated_at":"2025-11-07T13:54:35.671200052-07:00","closed_at":"2025-11-07T13:54:35.671200052-07:00"}
165+
{"id":"codeframe-w2kt","title":"FrontendWorkerAgent receives dict instead of Task model","description":"## Bug Description\n\nThe `FrontendWorkerAgent.execute_task()` method receives a dict instead of a Task model instance, causing AttributeError when accessing `.id` property.\n\n## Error Log\n```\nAttributeError: 'dict' object has no attribute 'id'\n\nTraceback:\n File \"codeframe/agents/frontend_worker_agent.py\", line 121, in execute_task\n logger.info(f\"Frontend agent {self.agent_id} executing task {task.id}: {task.title}\")\nAttributeError: 'dict' object has no attribute 'id'\n```\n\n## Root Cause\nIn `lead_agent.py:1891`, the task is passed as `task_dict` to `agent_instance.execute_task()`:\n```python\nawait agent_instance.execute_task(task_dict)\n```\n\nBut `FrontendWorkerAgent.execute_task()` expects a Task model instance with `.id`, `.title` attributes.\n\n## Files Affected\n- `codeframe/agents/lead_agent.py:1891` - passes dict\n- `codeframe/agents/frontend_worker_agent.py:121` - expects Task model\n- Likely also affects other worker agents\n\n## Fix Options\n1. Convert dict to Task model before passing to execute_task()\n2. Update execute_task() to accept dict and access via `task['id']`\n3. Standardize on one approach across all worker agents\n\n## Found During\nE2E smoke test run on 2026-01-11","status":"open","priority":2,"issue_type":"bug","created_at":"2026-01-11T21:46:41.927045272-07:00","updated_at":"2026-01-11T21:46:41.927045272-07:00","labels":["agents","backend","bug"]}
165166
{"id":"codeframe-w6a","title":"T011-T013: Add create_blocker() to all worker agents","description":"Add create_blocker() method to BackendWorkerAgent, FrontendWorkerAgent, and TestWorkerAgent","status":"closed","priority":1,"issue_type":"task","created_at":"2025-11-08T19:20:47.762253612-07:00","updated_at":"2025-11-14T10:48:48.466794601-07:00","closed_at":"2025-11-14T10:48:48.466794601-07:00","close_reason":"Sprint 6 (049-human-in-loop) complete - merged in PR #18","dependencies":[{"issue_id":"codeframe-w6a","depends_on_id":"codeframe-t4q","type":"blocks","created_at":"2025-11-08T19:23:03.424054613-07:00","created_by":"frankbria"}]}
166167
{"id":"codeframe-w7i","title":"T111: Add useMemo for filtered agent lists","description":"Add useMemo for filtered agent lists (activeAgents) in Dashboard.tsx","design":"Use useMemo to optimize filtering of agents (activeAgents, idleAgents) to prevent recalculation on every render","acceptance_criteria":"- [ ] useMemo added for activeAgents filter\n- [ ] Performance optimization working\n- [ ] Component works correctly","status":"closed","priority":0,"issue_type":"task","created_at":"2025-11-07T13:35:35.006878964-07:00","updated_at":"2025-11-07T13:54:35.67207995-07:00","closed_at":"2025-11-07T13:54:35.67207995-07:00"}
167168
{"id":"codeframe-wg3","title":"Entity Diagram Progress Tracker Tab","description":"Visual progress tracker in Dashboard","status":"open","priority":2,"issue_type":"feature","created_at":"2026-01-06T17:27:02.415766533-07:00","updated_at":"2026-01-06T17:27:02.415766533-07:00","external_ref":"gh-183","labels":["frontend","ux"]}

tests/e2e/e2e-config.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ export const FRONTEND_URL = process.env.FRONTEND_URL || 'http://localhost:3001';
2222
* - ACTIVE: Project 3 - In active phase with running agents and in-progress tasks
2323
* - REVIEW: Project 4 - In review phase with completed tasks awaiting review
2424
* - COMPLETED: Project 5 - In completed phase with all work done
25+
* - TASK_BREAKDOWN: Project 6 - In planning phase with PRD but NO tasks (for task generation UI)
26+
* - ASSIGN_TASKS: Project 7 - In active phase with pending unassigned tasks, NO in-progress tasks
2527
*
2628
* @example
2729
* // Use in tests:
@@ -39,6 +41,10 @@ export const TEST_PROJECT_IDS = {
3941
REVIEW: process.env.E2E_TEST_PROJECT_REVIEW_ID || '4',
4042
/** Project in completed phase - all work done */
4143
COMPLETED: process.env.E2E_TEST_PROJECT_COMPLETED_ID || '5',
44+
/** Project in planning phase with PRD but NO tasks - for task breakdown UI tests */
45+
TASK_BREAKDOWN: process.env.E2E_TEST_PROJECT_TASK_BREAKDOWN_ID || '6',
46+
/** Project in active phase with pending unassigned tasks - for Assign Tasks button tests */
47+
ASSIGN_TASKS: process.env.E2E_TEST_PROJECT_ASSIGN_TASKS_ID || '7',
4248
} as const;
4349

4450
/** Type for valid project IDs */

0 commit comments

Comments
 (0)