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
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
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
【Oracle Cloud ウェビナー】[Oracle AI Database + Azure] AI-Ready データ戦略の最短ルート:Azure AIでビジネス データの価値を最大化
oracle4engineer
PRO
2
120
Zephyr RTOS の発表をOpen Source Summit Japan 2025で行った件
iotengineer22
0
270
プロダクトエンジニアこそ必要なPMスキル 〜デリバリー力を最大化し、価値を届け続けるために〜
layerx
PRO
0
130
【NGK2026S】日本株のシステムトレードに入門してみた
kazuhitotakahashi
0
160
Data Intelligence on Lakehouse Paradigm
scotthsieh825
0
200
これまでのネットワーク運用を変えるかもしれないアプデをおさらい
hatahata021
4
280
ドキュメントからはじめる未来のソフトウェア
pkshadeck
3
1.4k
全員が「作り手」になる。職能の壁を溶かすプロトタイプ開発。
hokuo
1
570
ReproでのicebergのStreaming Writeの検証と実運用にむけた取り組み
joker1007
0
460
ビジュアルプログラミングIoTLT vol.22
1ftseabass
PRO
0
140
「全社導入」は結果。1人の熱狂が組織に伝播したmikanのn8n活用
sota_mikami
0
500
EventBridge API Destination × AgentCore Runtimeで実現するLambdaレスなイベント駆動エージェント
har1101
7
260
Featured
See All Featured
How Software Deployment tools have changed in the past 20 years
geshan
0
31k
Art, The Web, and Tiny UX
lynnandtonic
304
21k
Breaking role norms: Why Content Design is so much more than writing copy - Taylor Woolridge
uxyall
0
150
Ethics towards AI in product and experience design
skipperchong
2
180
Designing Powerful Visuals for Engaging Learning
tmiket
0
210
Money Talks: Using Revenue to Get Sh*t Done
nikkihalliwell
0
140
Organizational Design Perspectives: An Ontology of Organizational Design Elements
kimpetersen
PRO
1
69
Exploring anti-patterns in Rails
aemeredith
2
230
Information Architects: The Missing Link in Design Systems
soysaucechin
0
750
Future Trends and Review - Lecture 12 - Web Technologies (1019888BNR)
signer
PRO
0
3.2k
The Cult of Friendly URLs
andyhume
79
6.8k
Producing Creativity
orderedlist
PRO
348
40k
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