Testing Jetpack Compose UI
summary
Claims that Jetpack Compose testing differs from View testing: no view hierarchy, declarative UI, no IDs but Modifier.testTag and semantic properties, and tests run synchronized by default. Uses the Compose testing library (versus old Espresso flows), exercising UI with find/matchers, performClick and assertIsDisplayed, verifying text and navigation. Demonstrates setting initial state for composables in tests. Notes a real-world issue with singleInstance activities and fixes by providing a test-specific manifest or build variant.
AI-written summary · about
chapters (7)
- 0:00Introduction
- 1:30Compose vs traditional UI
- 8:53Testing button clicks
- 16:26Navigation and state testing
- 22:54Reusing test composables
- 26:06Fixing instrumentation issues
- 29:00Q&A
related talks
36mTesting Jetpack Compose UI
34mOverview of UI testing in Compose
33mHow to Test Your Compose UI
05m5 ways Compose improves UI testing
46mTesting Compose Anew: Simplicity, Reliability, Flexibility
29mComposing With Confidence
47mDancing Around the Semantics Tree: UI Testing Compose Screens
07mWrite your first Compose UI test
