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
130
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
270
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
590
Building the automated Android UI testing in Continuous integration at LINE MAN Wongnai
akexorcist
1
840
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
95
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
激動の時代を爆速リチーミングで乗り越えろ
sansantech
PRO
1
110
QA業務を変える(!?)AIを併用した不具合分析の実践
ma2ri
0
150
AIでデータ活用を加速させる取り組み / Leveraging AI to accelerate data utilization
okiyuki99
1
580
ソフトウェアエンジニアの生成AI活用と、これから
lycorptech_jp
PRO
0
910
webpack依存からの脱却!快適フロントエンド開発をViteで実現する #vuefes
bengo4com
4
3.5k
[re:Inent2025事前勉強会(有志で開催)] re:Inventで見つけた人生をちょっと変えるコツ
sh_fk2
0
280
20251027_マルチエージェントとは
almondo_event
1
440
AI-Readyを目指した非構造化データのメダリオンアーキテクチャ
r_miura
1
330
DSPy入門
tomehirata
0
120
もう外には出ない。より快適なフルリモート環境を目指して
mottyzzz
13
11k
知覚とデザイン
rinchoku
1
590
ブラウザのAPIで Nintendo Switch用の特殊なゲーム用コントローラーを体験型コンテンツに / IoTLT @ストラタシス・ジャパン
you
PRO
0
140
Featured
See All Featured
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
132
19k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
9.7k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.2k
Fireside Chat
paigeccino
41
3.7k
Bash Introduction
62gerente
615
210k
The Cost Of JavaScript in 2023
addyosmani
55
9.1k
Become a Pro
speakerdeck
PRO
29
5.6k
Why Our Code Smells
bkeepers
PRO
340
57k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
658
61k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
9
930
YesSQL, Process and Tooling at Scale
rocio
173
15k
Site-Speed That Sticks
csswizardry
13
930
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