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
FFMとJVMの実装から学ぶJavaのインテグリティ
kazumura
0
150
Building AI Applications with Java, LLMs, and Spring AI
thomasvitale
1
220
グローバルなコンパウンド戦略を支えるモジュラーモノリスとドメイン駆動設計
kawauso
3
5.6k
Javaコミュニティの歩き方 ~参加から貢献まで、すべて教えます~
tabatad
0
140
大規模モノレポの秩序管理 失速しない多言語化フロントエンドの運用 / JSConf JP 2025
shoota
0
290
現地速報!Microsoft Ignite 2025 M365 Copilotアップデートレポート
kasada
2
1.5k
機密情報の漏洩を防げ! Webフロントエンド開発で意識すべき漏洩パターンとその対策
mizdra
PRO
10
4.2k
持続可能なアクセシビリティ開発
azukiazusa1
6
280
その意思決定、まだ続けるんですか? ~痛みを超えて未来を作る、AI時代の撤退とピボットの技術~
applism118
23
13k
Service Monitoring Platformについて
lycorptech_jp
PRO
0
320
マルチドライブアーキテクチャ: 複数の駆動力でプロダクトを前進させる
knih
0
6.6k
個人から巡るAI疲れと組織としてできること - AI疲れをふっとばせ。エンジニアのAI疲れ治療法 ショートセッション -
kikuchikakeru
4
1.8k
Featured
See All Featured
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
10
680
We Have a Design System, Now What?
morganepeng
54
7.9k
Raft: Consensus for Rubyists
vanstee
140
7.2k
Building a Scalable Design System with Sketch
lauravandoore
463
33k
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.3k
Embracing the Ebb and Flow
colly
88
4.9k
Producing Creativity
orderedlist
PRO
348
40k
GitHub's CSS Performance
jonrohan
1032
470k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
34
2.5k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
17k
Into the Great Unknown - MozCon
thekraken
40
2.2k
VelocityConf: Rendering Performance Case Studies
addyosmani
333
24k
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