Files
honeyDueKMP/iosApp/UI_TEST_STRATEGY.md
Trey t 1e2adf7660 Rebrand from Casera/MyCrib to honeyDue
Total rebrand across KMM project:
- Kotlin package: com.example.casera -> com.tt.honeyDue (dirs + declarations)
- Gradle: rootProject.name, namespace, applicationId
- Android: manifest, strings.xml (all languages), widget resources
- iOS: pbxproj bundle IDs, Info.plist, entitlements, xcconfig
- iOS directories: Casera/ -> HoneyDue/, CaseraTests/ -> HoneyDueTests/, etc.
- Swift source: all class/struct/enum renames
- Deep links: casera:// -> honeydue://, .casera -> .honeydue
- App icons replaced with honeyDue honeycomb icon
- Domains: casera.treytartt.com -> honeyDue.treytartt.com
- Bundle IDs: com.tt.casera -> com.tt.honeyDue
- Database table names preserved

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 06:33:57 -06:00

74 lines
2.2 KiB
Markdown

# HoneyDue iOS UI Test Strategy
## Current Status: REBUILDING FROM SCRATCH
The previous comprehensive tests (50+ tests) were written without proper verification and are failing. We're now taking a methodical approach.
## Phase 1: Foundation Test (IN PROGRESS)
### SimpleLoginTest.swift
- ✅ Created with logout-first logic
- 🔄 Testing in progress
- Contains 2 basic tests:
1. `testAppLaunchesAndShowsLoginScreen()` - Verifies app launches and shows login UI
2. `testCanTypeInLoginFields()` - Verifies we can interact with username/password fields
**Key Feature**: `ensureLoggedOut()` helper automatically logs out before each test
## Phase 2: Build Working Tests Incrementally
Once SimpleLoginTest works, we'll build:
### Authentication Tests (Priority 1)
- Login with valid credentials
- Login with invalid credentials
- Logout flow
- Registration flow
- Password reset flow
### Residence Tests (Priority 2)
- View residences list
- Create residence
- Edit residence
- Delete residence
### Task Tests (Priority 3)
- View tasks
- Create task
- Mark task in progress
- Complete task
## Test Principles
1. **Always logout first** - Each test starts from login screen
2. **Use flexible selectors** - NSPredicate with CONTAINS instead of exact matches
3. **Wait for elements** - Use `waitForExistence(timeout:)` instead of `sleep()`
4. **Test one thing** - Each test focuses on a single user flow
5. **Clean up** - Tests should be independent and repeatable
## How to Run Tests
### In Xcode (Recommended)
1. Open `iosApp.xcodeproj`
2. Select HoneyDueUITests scheme
3. Press Cmd+U or click diamond icon next to test
### Command Line
```bash
xcodebuild test -project iosApp.xcodeproj -scheme HoneyDueUITests \
-destination 'platform=iOS Simulator,name=iPhone 17'
```
## Known Issues
- Previous comprehensive tests (Comprehensive*Tests.swift) are NOT working
- AccessibilityIdentifiers may not all be properly set in views
- Need to verify actual UI structure before writing complex tests
## Next Steps
1. ✅ Get SimpleLoginTest passing
2. Add more login/auth tests based on what works
3. Gradually add residence and task tests
4. Delete old failing comprehensive tests once new ones work