Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Snackbar in Compose with Friendly UI Testing
Search
Somkiat Khitwongwattana
September 23, 2025
Technology
0
75
Snackbar in Compose with Friendly UI Testing
A guide to creating and testing Snackbar in Jetpack Compose, with a focus on friendly UI testing.
Somkiat Khitwongwattana
September 23, 2025
Tweet
Share
More Decks by Somkiat Khitwongwattana
See All by Somkiat Khitwongwattana
Gemini in Android Studio - Google I/O Bangkok '25
akexorcist
0
250
Adopting Jetpack Compose in Your Existing Project - GDG DevFest Bangkok 2024
akexorcist
0
210
Why App Signing Matters for Your Android Apps - Android Bangkok Conference 2024
akexorcist
1
580
Building the automated Android UI testing in Continuous integration at LINE MAN Wongnai
akexorcist
1
830
Building the automated Android UI testing in Continuous integration at LINE MAN Wongnai
akexorcist
1
75
What's new in Android 14 - IO Extended George Town 2023
akexorcist
1
340
All you need to know about new Logcat in Android Studio - DevFest Bangkok 2022
akexorcist
0
94
Backend for mobile app - Droidcon SG 2022
akexorcist
0
88
Backend for mobile app - Android Bangkok Conference 2022
akexorcist
1
170
Other Decks in Technology
See All in Technology
AWSにおけるTrend Vision Oneの効果について
shimak
0
100
GopherCon Tour 概略
logica0419
2
160
神回のメカニズムと再現方法/Mechanisms and Playbook for Kamikai scrumat2025
moriyuya
3
180
Why React!?? Next.jsそしてReactを改めてイチから選ぶ
ypresto
10
4k
生成AIを活用したZennの取り組み事例
ryosukeigarashi
0
180
業務自動化プラットフォーム Google Agentspace に入門してみる #devio2025
maroon1st
0
180
Findy Team+のSOC2取得までの道のり
rvirus0817
0
280
Azure SynapseからAzure Databricksへ 移行してわかった新時代のコスト問題!?
databricksjapan
0
110
Pure Goで体験するWasmの未来
askua
1
170
いま注目しているデータエンジニアリングの論点
ikkimiyazaki
0
570
C# 14 / .NET 10 の新機能 (RC 1 時点)
nenonaninu
1
1.4k
Tomorrow graphlib, Let us use everybody
hayaosuzuki
0
160
Featured
See All Featured
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
17k
Keith and Marios Guide to Fast Websites
keithpitt
411
22k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
34
6.1k
Unsuck your backbone
ammeep
671
58k
It's Worth the Effort
3n
187
28k
Imperfection Machines: The Place of Print at Facebook
scottboms
269
13k
The Cult of Friendly URLs
andyhume
79
6.6k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
1.1k
Building an army of robots
kneath
306
46k
Practical Orchestrator
shlominoach
190
11k
Art, The Web, and Tiny UX
lynnandtonic
303
21k
Transcript
Snackbar in Compose with Friendly UI Testing Somkiat Khitwongwattana Staff
Software Engineer (Android) @ LINE MAN Wongnai
Hello Compose Multiplatform! OK
None
None
None
None
None
1 2 3 4
None
None
1 2 3 Expect Actual
None
Any Solution?
Any Solution? • Remove Snackbar message verification
Any Solution? • Remove Snackbar message verification • Create a
Snackbar controller & container for UI testing
What Controller & Container Do? • Enforce indefinite duration during
UI testing • Manually dismiss using code in UI testing
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
Dismiss Snackbar by code Dismiss Snackbar by code
SnackbarContainer Recap SnackbarUiTest Controller SnackbarHostState Provider androidTest Store the SnackbarHostState
that's created while the app is running, so it can be dismissed in a UI test. Inject the SnackbarHostState into the SnackbarUiTestController using Java Reflection Override the duration to be indefinite when running under UI test. main main
Recap App SnackbarHostState Provider SnackbarContainer UI Test SnackbarUiTest Controller Inject
SnackbarHostState Dismiss Snackbar
Caution • Do not expose your test code to production
environments, especially in a multi-module project • Avoid unexpected Snackbar behavior in complex UI
Thank you Presentation Link