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
170
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
370
Adopting Jetpack Compose in Your Existing Project - GDG DevFest Bangkok 2024
akexorcist
0
220
Why App Signing Matters for Your Android Apps - Android Bangkok Conference 2024
akexorcist
1
660
Building the automated Android UI testing in Continuous integration at LINE MAN Wongnai
akexorcist
1
870
Building the automated Android UI testing in Continuous integration at LINE MAN Wongnai
akexorcist
1
81
What's new in Android 14 - IO Extended George Town 2023
akexorcist
1
370
All you need to know about new Logcat in Android Studio - DevFest Bangkok 2022
akexorcist
0
98
Backend for mobile app - Droidcon SG 2022
akexorcist
0
110
Backend for mobile app - Android Bangkok Conference 2022
akexorcist
1
190
Other Decks in Technology
See All in Technology
AWS Devops Agent ~ 自動調査とSlack統合をやってみた! ~
kubomasataka
2
210
習慣とAIと環境 — 技術探求を続ける3つの鍵
azukiazusa1
3
780
20260120 Amazon VPC のパブリックサブネットを無くしたい!
masaruogura
2
160
Riverpod3.xで実現する実践的UI実装
fumiyasac0921
2
340
メルカリのAI活用を支えるAIセキュリティ
s3h
6
3.4k
BPaaSオペレーション・kubell社内 n8n活用による効率化検証事例紹介
kubell_hr
0
270
Hardware/Software Co-design: Motivations and reflections with respect to security
bcantrill
1
260
これまでのネットワーク運用を変えるかもしれないアプデをおさらい
hatahata021
4
280
クラウドセキュリティの進化 — AWSの20年を振り返る
kei4eva4
0
160
【northernforce#54】SalesforceにおけるAgentforceの位置づけ・事例紹介
yutosatou_kit
0
130
Vivre en Bitcoin : le tutoriel que votre banquier ne veut pas que vous voyiez
rlifchitz
0
360
SOC2は、取った瞬間よりその後が面白い
3flower
1
190
Featured
See All Featured
Become a Pro
speakerdeck
PRO
31
5.8k
How to Ace a Technical Interview
jacobian
281
24k
Evolving SEO for Evolving Search Engines
ryanjones
0
110
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
31
3.1k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
38
2.7k
Balancing Empowerment & Direction
lara
5
850
30 Presentation Tips
portentint
PRO
1
190
Designing for humans not robots
tammielis
254
26k
How to make the Groovebox
asonas
2
1.9k
[SF Ruby Conf 2025] Rails X
palkan
0
720
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
9
1.1k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
34
2.6k
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