~/talk

Write your first Compose UI test

Talkat Android Dev Summit 2022 · 2022-10-24..11-14· [android, testing]
slides:none on file

Shows how to write a UI test for a Jetpack Compose calculator that actually clicks buttons and asserts behavior: sets content with a test rule, uses onNodeWithText then switches to onNode(hasText(...).and(hasClick())) to disambiguate two “3” nodes, verifies the formula text and an error message after entering an invalid input, uses AndroidComposeRule with ComponentActivity to access string resources, and explains why color assertions require screenshot tests because the semantics tree omits visual color.

AI-written summary · about

  1. 0:00Introduction to compose tests
  2. 0:34Setting up the test class
  3. 1:39Finding and clicking nodes
  4. 2:12Creating specific matchers
  5. 3:35Asserting element existence
  6. 3:58Testing error handling
  7. 4:57Using string resources
  8. 5:26Understanding semantic nodes
~/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.