# PlantGuide UI Tests ## Quick Start ```bash # Compile only (no device required) xcodebuild build-for-testing \ -project PlantGuide.xcodeproj \ -scheme PlantGuide \ -destination 'platform=iOS Simulator,name=iPhone 17' # Run all UI tests xcodebuild test \ -project PlantGuide.xcodeproj \ -scheme PlantGuide \ -destination 'platform=iOS Simulator,name=iPhone 17' \ -only-testing:PlantGuideUITests ``` ## Directory Layout ``` PlantGuideUITests/ Foundation/ # Shared infrastructure BaseUITestCase # Base class for all tests UITestID # Accessibility identifier constants WaitHelpers # Predicate-based waits (no sleep!) Helpers/ LaunchConfigKey # Launch arg/env constants Screens/ # Page objects TabBarScreen CameraScreen CollectionScreen TodayScreen SettingsScreen PlantDetailScreen ``` ## Conventions - Inherit `BaseUITestCase`, not `XCTestCase` - Use `UITestID.*` identifiers, not localized strings - Use screen objects for element access and assertions - Launch with `launchClean()`, `launchWithMockData()`, or `launchOffline()` - Replace `sleep()` with `waitUntilHittable()` / `waitUntilGone()` / `waitForExistence(timeout:)` ## Adding a Test See [Docs/XCUITest-Authoring.md](../Docs/XCUITest-Authoring.md) for full guide.