Added comprehensive documentation for the KMM project structure, build commands, and UI testing setup/troubleshooting. Documentation added: - CLAUDE.md: Complete KMM project guide for Claude Code with architecture, build commands, common tasks, and development patterns - iosApp/UI_TESTS_*.md: UI testing strategy, implementation guides, summaries - iosApp/XCUITEST_*.md: XCUITest implementation and debugging guides - iosApp/TEST_FAILURES_ANALYSIS.md: Analysis of common test failures - iosApp/ACCESSIBILITY_IDENTIFIERS_FIX.md: Guide for fixing accessibility issues - iosApp/FIX_TEST_TARGET*.md: Guides for fixing test target configuration - iosApp/fix_test_target.sh: Script to automate test target setup The CLAUDE.md serves as the primary documentation for working with this repository, providing quick access to build commands, architecture overview, and common development tasks for both iOS and Android platforms. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
2.2 KiB
2.2 KiB
MyCrib 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:
testAppLaunchesAndShowsLoginScreen()- Verifies app launches and shows login UItestCanTypeInLoginFields()- 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
- Always logout first - Each test starts from login screen
- Use flexible selectors - NSPredicate with CONTAINS instead of exact matches
- Wait for elements - Use
waitForExistence(timeout:)instead ofsleep() - Test one thing - Each test focuses on a single user flow
- Clean up - Tests should be independent and repeatable
How to Run Tests
In Xcode (Recommended)
- Open
iosApp.xcodeproj - Select MyCribUITests scheme
- Press Cmd+U or click diamond icon next to test
Command Line
xcodebuild test -project iosApp.xcodeproj -scheme MyCribUITests \
-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
- ✅ Get SimpleLoginTest passing
- Add more login/auth tests based on what works
- Gradually add residence and task tests
- Delete old failing comprehensive tests once new ones work