Shift Left: Unit test your compose UI with reusable robots a...
summary
Shows how far JVM JUnit can replace instrumentation for Compose UI by using reusable robot screens, a tiny toy weather app wired to Open‑Meteo, and a behavior‑driven Kotlin DSL that mirrors feature files so tests read like Given/When/Then. Uses Robolectric’s shadow application to grant/deny permissions, ActivityScenario for deep links, a test lifecycle owner to trigger resume, plus test fixtures or a test module; claims about 95% fidelity and much faster, cheaper CI runs while warning it’s not a silver bullet.
AI-written summary · about
chapters (24)
- 0:00Introduction to Compose UI testing
- 1:02Origin of robot testing in UI
- 2:05Why unit test Compose UI
- 3:50Configuring JVM for private APIs
- 4:53Demo weather app setup
- 5:37Testing permissions in JVM
- 7:03Testing lifecycle events in JUnit
- 8:49Testing deep links in unit tests
- 10:14Compose test rule APIs overview
- 13:48Challenges with UI changes in tests
- 15:12Introducing robot screens for stability
- 17:43Handling merged accessibility nodes
- 18:25Ensuring test stability with waits
- 19:47Reusing robots with test fixtures
- 20:31Robot implementation example
- 21:56Benefits of robot testing
- 22:18Automated vs manual testing coverage
- 24:24Solving knowledge gaps with feature files
- 26:09Writing effective feature files
- 29:18Feature file example breakdown
- 31:02Implementing feature files in tests
- 32:50Creating a Kotlin DSL for tests
- 34:15When to use AI vs manual testing
- 35:16Conclusion and resources
