$30 off During Our Annual Pro Sale. View Details »
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
150
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
330
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
630
Building the automated Android UI testing in Continuous integration at LINE MAN Wongnai
akexorcist
1
860
Building the automated Android UI testing in Continuous integration at LINE MAN Wongnai
akexorcist
1
77
What's new in Android 14 - IO Extended George Town 2023
akexorcist
1
350
All you need to know about new Logcat in Android Studio - DevFest Bangkok 2022
akexorcist
0
97
Backend for mobile app - Droidcon SG 2022
akexorcist
0
96
Backend for mobile app - Android Bangkok Conference 2022
akexorcist
1
180
Other Decks in Technology
See All in Technology
5分で知るMicrosoft Ignite
taiponrock
PRO
0
250
生成AI時代の自動E2Eテスト運用とPlaywright実践知_引持力哉
legalontechnologies
PRO
0
210
ブロックテーマとこれからの WordPress サイト制作 / Toyama WordPress Meetup Vol.81
torounit
0
530
小さな判断で育つ、大きな意思決定力 / 20251204 Takahiro Kinjo
shift_evolve
PRO
1
580
Kubernetes Multi-tenancy: Principles and Practices for Large Scale Internal Platforms
hhiroshell
0
120
新 Security HubがついにGA!仕組みや料金を深堀り #AWSreInvent #regrowth / AWS Security Hub Advanced GA
masahirokawahara
1
1.6k
Lessons from Migrating to OpenSearch: Shard Design, Log Ingestion, and UI Decisions
sansantech
PRO
1
100
Edge AI Performance on Zephyr Pico vs. Pico 2
iotengineer22
0
120
手動から自動へ、そしてその先へ
moritamasami
0
290
re:Invent 2025 ふりかえり 生成AI版
takaakikakei
1
190
AIと二人三脚で育てた、個人開発アプリグロース術
zozotech
PRO
1
700
技術以外の世界に『越境』しエンジニアとして進化を遂げる 〜Kotlinへの愛とDevHRとしての挑戦を添えて〜
subroh0508
1
400
Featured
See All Featured
The Power of CSS Pseudo Elements
geoffreycrofte
80
6.1k
Thoughts on Productivity
jonyablonski
73
5k
4 Signs Your Business is Dying
shpigford
186
22k
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.5k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
2.7k
How to train your dragon (web standard)
notwaldorf
97
6.4k
Imperfection Machines: The Place of Print at Facebook
scottboms
269
13k
Rails Girls Zürich Keynote
gr2m
95
14k
Writing Fast Ruby
sferik
630
62k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
37
2.6k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
48
9.8k
A Tale of Four Properties
chriscoyier
162
23k
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