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
180
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
390
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
670
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
85
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
99
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
Kiro IDEのドキュメントを全部読んだので地味だけどちょっと嬉しい機能を紹介する
khmoryz
0
200
FinTech SREのAWSサービス活用/Leveraging AWS Services in FinTech SRE
maaaato
0
130
usermode linux without MMU - fosdem2026 kernel devroom
thehajime
0
230
StrandsとNeptuneを使ってナレッジグラフを構築する
yakumo
1
120
SREが向き合う大規模リアーキテクチャ 〜信頼性とアジリティの両立〜
zepprix
0
450
Contract One Engineering Unit 紹介資料
sansan33
PRO
0
13k
Bill One急成長の舞台裏 開発組織が直面した失敗と教訓
sansantech
PRO
2
380
Agile Leadership Summit Keynote 2026
m_seki
1
620
20260208_第66回 コンピュータビジョン勉強会
keiichiito1978
0
130
インフラエンジニア必見!Kubernetesを用いたクラウドネイティブ設計ポイント大全
daitak
1
360
ブロックテーマ、WordPress でウェブサイトをつくるということ / 2026.02.07 Gifu WordPress Meetup
torounit
0
180
AWS Network Firewall Proxyを触ってみた
nagisa53
1
230
Featured
See All Featured
Paper Plane
katiecoart
PRO
0
46k
A brief & incomplete history of UX Design for the World Wide Web: 1989–2019
jct
1
300
Typedesign – Prime Four
hannesfritz
42
2.9k
How to Think Like a Performance Engineer
csswizardry
28
2.4k
The Illustrated Guide to Node.js - THAT Conference 2024
reverentgeek
0
260
Mobile First: as difficult as doing things right
swwweet
225
10k
The Impact of AI in SEO - AI Overviews June 2024 Edition
aleyda
5
730
The Illustrated Children's Guide to Kubernetes
chrisshort
51
51k
Breaking role norms: Why Content Design is so much more than writing copy - Taylor Woolridge
uxyall
0
170
世界の人気アプリ100個を分析して見えたペイウォール設計の心得
akihiro_kokubo
PRO
66
37k
From Legacy to Launchpad: Building Startup-Ready Communities
dugsong
0
140
Joys of Absence: A Defence of Solitary Play
codingconduct
1
290
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