mirror of
https://github.com/go-vikunja/vikunja.git
synced 2026-04-25 14:45:20 +00:00
- Add missing task loading API intercepts to project-view-gantt.spec.ts (8 tests) - Add missing API intercepts to project-history.spec.ts (7 project visits) - Add missing API intercepts to filter-persistence.spec.ts (4 tests) - Ensure all task loading endpoints are covered: - **/api/v1/projects/*/views/*/tasks** (when viewId provided) - **/api/v1/projects/*/tasks** (fallback when viewId missing) - **/api/v1/tasks/all** (when projectId is null/undefined) - All tests now wait for API responses with 30s timeout - Intercepts set BEFORE navigation to prevent timing issues 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
3.5 KiB
3.5 KiB
E2E Test Fixes Summary
Problem Analysis
The Vikunja frontend E2E tests were failing with ~42 failures across multiple categories, primarily due to API intercept issues.
Root Cause
Tests were failing with "No request ever occurred" for @loadTasks routes because:
- Incomplete API Coverage: Tests only intercepted specific endpoint patterns but the application calls different endpoints based on context
- Missing Intercepts: Some test files had incomplete or missing API intercept setup
- Timing Issues: Intercepts were sometimes set up after navigation began
Solution Strategy
Comprehensive API Intercept Pattern
Instead of intercepting just one pattern, we now intercept all possible task loading endpoints:
**/api/v1/projects/*/views/*/tasks**- When viewId is provided**/api/v1/projects/*/tasks**- When viewId is missing (fallback)**/api/v1/tasks/all**- When projectId is null/undefined
Files Fixed
Previous Session (Major fixes)
cypress/e2e/project/project-view-kanban.spec.ts- 7 testscypress/e2e/sharing/linkShare.spec.ts- 2 testscypress/e2e/task/task.spec.ts- 9 testscypress/e2e/project/project-view-list.spec.ts- 3 testscypress/e2e/project/project-view-table.spec.ts- 3 testscypress/e2e/task/overview.spec.ts- 2 testscypress/e2e/task/subtask-duplicates.spec.ts- 1 test
Current Session (Additional fixes)
cypress/e2e/sharing/linkShare.spec.ts- Enhanced with comprehensive interceptscypress/e2e/project/project.spec.ts- Added missing intercepts for redirect test
Impact
Before
- Run #17888933035: 42 failures total (13+7+16+6)
- Primary error: "No request ever occurred" for loadTasks routes
- Tests timing out after 30 seconds waiting for API responses
After Previous Major Fixes
- Run #17889256906: 41 failures total (11+7+17+6)
- Slight improvement but main intercept issues remained
Expected After Current Fixes
- Run #17889600751: Currently in progress
- Target: Significant reduction in API-related failures
- Focus: Link share tests and project redirect test should now pass
Technical Details
API Service Architecture
The Vikunja frontend uses different services for task loading:
TaskCollectionService: Uses/projects/{projectId}/views/{viewId}/tasksor/projects/{projectId}/tasksTaskService: Uses/tasks/allfor general task queries
Link Share Authentication
Link shares use:
/shares/{hash}/authfor authentication- Regular task endpoints with share-specific tokens
- Same API patterns but different authentication context
Test Pattern
All fixed tests now follow this pattern:
// Set up comprehensive API intercepts BEFORE navigation
cy.intercept('GET', '**/api/v1/projects/*/views/*/tasks**').as('loadTasks')
cy.intercept('GET', '**/api/v1/projects/*/tasks**').as('loadTasks')
cy.intercept('GET', '**/api/v1/tasks/all**').as('loadTasks')
// Navigate to page
cy.visit('/path')
// Wait for API calls
cy.wait('@loadTasks', {timeout: 30000})
Validation Process
For each fix:
- ✅ ESLint:
pnpm lint:fix - ✅ TypeScript:
pnpm typecheck - ✅ Unit Tests:
pnpm test:unit(690/690 passing) - ✅ Git: Conventional commit messages
- ✅ Push: Changes pushed to remote
Success Metrics
- Target: <10 total E2E failures (vs 42+ baseline)
- Goal: Zero "loadTasks" related timeouts
- Validation: All automated checks continue to pass
This represents a systematic approach to fixing the core API intercept issues affecting the majority of E2E test failures.