# 17. UI Test Suite (Compose Testing) meta: id: android-production-17 feature: android-production priority: P1 depends_on: [] tags: [testing, ui-tests, quality] objective: - Implement comprehensive UI tests using Jetpack Compose Testing framework for all critical user journeys deliverables: - Compose UI tests for auth flows - Compose UI tests for dashboard and services - Compose UI tests for settings - Test utilities and mocks steps: 1. Set up Compose testing: - Dependencies already in build.gradle.kts (androidx.compose.ui.test.junit4) - Create test directory structure - Add TestRule for ComposeTestRule 2. Create auth tests: - Test onboarding flow - Test login with valid credentials - Test login with invalid credentials - Test signup flow - Test forgot password flow - Test biometric prompt 3. Create dashboard tests: - Test dashboard loads with widgets - Test navigation to services - Test alert list and detail - Test threat score display - Test pull-to-refresh 4. Create service tests: - Test DarkWatch screen - Test VoicePrint screen - Test SpamShield screen - Test HomeTitle screen - Test RemoveBrokers screen 5. Create settings tests: - Test settings screen loads - Test profile update - Test notification toggles - Test logout 6. Add test utilities: - Mock repository implementations - Test data factories - Navigation test helpers - Hilt test configuration 7. Configure CI: - Run UI tests on PR - Test on multiple API levels (28, 30, 33, 34) - Generate test reports tests: - UI: All critical paths covered - CI: Tests run automatically - Coverage: 80%+ of composables tested acceptance_criteria: - 20+ Compose UI test cases - Auth flow fully tested - All 5 services have UI tests - Dashboard and alerts tested - Settings and profile tested - Tests run on API 28, 30, 33, 34 - Tests complete in <10 minutes - Hilt injection working in tests - Mock repositories for isolated tests - CI runs UI tests on every PR - Screenshots on failure validation: - Run UI tests → all pass - Introduce UI bug → test fails - Check test report → screenshots for failures - CI pipeline → UI tests green notes: - Compose testing uses semantics and test tags - Use createComposeRule() for Compose tests - Hilt testing requires HiltTestApplication - Test on emulators with different screen sizes