How We Started Testing SwiftUI Components Without UI Tests
The iOS project team verified SwiftUI components in unit tests using ViewInspector instead of running UI tests. On CI, this revealed issues in the architecture of the test targets.

ViewInspector allows traversing the SwiftUI view hierarchy, finding elements, reading text, checking button states, and triggering their actions without launching the application. This approach is suitable for verifying structure and behavior but does not display pixels, animations, or the actual interface layout.
Stable test execution initially failed due to the combination of UI, unit, and snapshot tests in a single target. They have different environment and dependency requirements, and ViewInspector should only be linked to unit tests, not the main target. Eventually, the test architecture was redesigned: targets were separated, and dependencies were made explicit. The library was selected as a pre-built binary and recompiled after updates.
To compare results, a helper function based on `dump` and reflection was used. It allows comparing value structures even if nested types do not support `Equatable`, but it makes tests sensitive to property renaming and is unsuitable for comparing closures. Test coverage amounted to approximately 50–60%. Visual appearance, animations, and scrolling smoothness were left for manual verification.





