~/talk

One test suite for instrumentation and Robolectric tests

Talkat AndroidMakers by droidcon 2024 · on Thursday, 2024-04-25· at 14:00· [testing]
slides:none on file

Claim: one test suite runs on device/emulator and on the JVM using Robolectric. Concrete tools and steps: copy or share tests via a shared test folder, add Robolectric and testImplementation deps, use Gradle tasks (connectedAndroidTest vs testDebugUnitTest), and implement environment-specific helpers like an airplane mode toggler (UIAutomator on device, Settings shadow + broadcast on Robolectric). Built a Robolectric shadow activity to launch secondary screens; it works but needs manual cleanup and IDE workarounds. Speed wins: examples show ~1 minute on Robolectric versus ~3+ minutes on emulators and orchestrator sometimes inflates runs toward an hour.

AI-written summary · about

  1. 0:00Unified testing approach
  2. 3:16Device test execution lifecycle
  3. 6:48Robolectric overview and benefits
  4. 9:18Robolectric history and evolution
  5. 11:22Running Robolectric tests
  6. 13:48Shared test folder challenges
  7. 16:38Multi-activity testing
  8. 24:05System interaction testing
  9. 31:13Device vs Robolectric tests
  10. 34:25Should you use Robolectric?
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.