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
140
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
310
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
610
Building the automated Android UI testing in Continuous integration at LINE MAN Wongnai
akexorcist
1
850
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
350
All you need to know about new Logcat in Android Studio - DevFest Bangkok 2022
akexorcist
0
96
Backend for mobile app - Droidcon SG 2022
akexorcist
0
89
Backend for mobile app - Android Bangkok Conference 2022
akexorcist
1
170
Other Decks in Technology
See All in Technology
スタートアップの事業成長を支えるアーキテクチャとエンジニアリング
doragt
1
4.6k
JavaScript パーサーに using 対応をする過程で与えたエコシステムへの影響
baseballyama
1
110
DDD x Microservice Architecture : Findy Architecture Conf 2025
syobochim
12
3.1k
Redux → Recoil → Zustand → useSyncExternalStore: 状態管理の10年とReact本来の姿
zozotech
PRO
21
8.9k
はじめての OSS コントリビューション 〜小さな PR が世界を変える〜
chiroito
4
350
LINEヤフー バックエンド組織・体制の紹介
lycorptech_jp
PRO
0
830
その意思決定、まだ続けるんですか? ~痛みを超えて未来を作る、AI時代の撤退とピボットの技術~
applism118
23
13k
マルチドライブアーキテクチャ: 複数の駆動力でプロダクトを前進させる
knih
0
6.6k
レガシーシステム刷新における TypeSpec スキーマ駆動開発のすゝめ
tsukuha
0
180
なぜブラウザで帳票を生成したいのか どのようにブラウザで帳票を生成するのか
yagisanreports
0
150
[CV勉強会@関東 ICCV2025 読み会] World4Drive: End-to-End Autonomous Driving via Intention-aware Physical Latent World Model (Zheng+, ICCV 2025)
abemii
0
240
Moto: Latent Motion Token as the Bridging Language for Learning Robot Manipulation from Videos
peisuke
0
160
Featured
See All Featured
Site-Speed That Sticks
csswizardry
13
970
Context Engineering - Making Every Token Count
addyosmani
9
410
Product Roadmaps are Hard
iamctodd
PRO
55
12k
How GitHub (no longer) Works
holman
315
140k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
9.8k
Scaling GitHub
holman
463
140k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
285
14k
A better future with KSS
kneath
239
18k
Art, The Web, and Tiny UX
lynnandtonic
303
21k
4 Signs Your Business is Dying
shpigford
186
22k
BBQ
matthewcrist
89
9.9k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
249
1.3M
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