Skip to content

Conversation

@aboelnaga
Copy link
Owner

add mocked e2e tests

Mohamed Abo ElNaga added 2 commits August 4, 2025 18:24
- Create budget-ui-mocked.spec.ts (12 tests) - Basic UI interactions with mocked data
- Create budget-ui-advanced.spec.ts (11 tests) - Complex UI scenarios with mocked data
- Create playwright.mocked.config.ts - Separate config for mocked tests
- Update package.json with new test scripts:
  * test:e2e - Run only E2E tests with real APIs
  * test:mocked - Run only mocked tests for UI automation
  * test:all - Run both test strategies

- Create comprehensive TEST_STRATEGY.md documentation
- Fix route paths (use '/' instead of '/budget-planner')
- Replace waitForLoadState with waitForTimeout for mocked tests

Benefits:
✅ 3/12 mocked tests passing (25% success rate)
✅ Fast execution (15s vs 30s for E2E tests)
✅ No database pollution
✅ Focus on UI automation
✅ Network interception for realistic scenarios

Next: Add missing data-testid attributes to components
- Add data-testid attributes to improve mocked test coverage:
  * cancel-btn - Cancel button in AddBudgetModal
  * reminder-enabled-checkbox - Reminder toggle checkbox
  * reminder-days-input - Reminder days select dropdown
  * fixed-expense-checkbox - Fixed expense toggle checkbox
  * custom-months-section - Custom months selection section
  * year-filter-select - Year filter dropdown
  * total-income, total-expenses, net-amount - Summary cards
  * investment-direction-select - Investment direction dropdown

- Improve test results: 6/22 tests passing (27% success rate)
- Create comprehensive TODO.md for remaining improvements
- Target: 15/22 tests passing (68% success rate)

Benefits:
✅ Fast execution (2.2 minutes for 22 tests)
✅ No database pollution
✅ Focused UI automation
✅ Reliable feedback loops
Base automatically changed from fix/new_frequency-ui to main August 5, 2025 08:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants