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
160
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
340
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
650
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
79
What's new in Android 14 - IO Extended George Town 2023
akexorcist
1
360
All you need to know about new Logcat in Android Studio - DevFest Bangkok 2022
akexorcist
0
98
Backend for mobile app - Droidcon SG 2022
akexorcist
0
99
Backend for mobile app - Android Bangkok Conference 2022
akexorcist
1
180
Other Decks in Technology
See All in Technology
re:Invent2025 セッションレポ ~Spec-driven development with Kiro~
nrinetcom
PRO
2
160
The State of AI Agent Security:2025年の総括と2026年の宿題
pict3
0
110
[2025-12-12]あの日僕が見た胡蝶の夢 〜人の夢は終わらねェ AIによるパフォーマンスチューニングのすゝめ〜
tosite
0
220
MySQLのSpatial(GIS)機能をもっと充実させたい ~ MyNA望年会2025LT
sakaik
0
170
Connection-based OAuthから学ぶOAuth for AI Agents
flatt_security
0
490
Claude Codeを使った情報整理術
knishioka
15
11k
AWS re:Invent2025最新動向まとめ(NRIグループre:Cap 2025)
gamogamo
0
140
戰略轉變:從建構 AI 代理人到發展可擴展的技能生態系統
appleboy
0
170
ルネサンス開発者を育てる 1on1支援AIエージェント
yusukeshimizu
0
130
Oracle Database@Google Cloud:サービス概要のご紹介
oracle4engineer
PRO
1
790
人工知能のための哲学塾 ニューロフィロソフィ篇 第零夜 「ニューロフィロソフィとは何か?」
miyayou
0
190
AgentCoreとStrandsで社内d払いナレッジボットを作った話
motojimayu
1
1.2k
Featured
See All Featured
How to Align SEO within the Product Triangle To Get Buy-In & Support - #RIMC
aleyda
1
1.4k
Technical Leadership for Architectural Decision Making
baasie
0
200
Being A Developer After 40
akosma
91
590k
Designing for humans not robots
tammielis
254
26k
What's in a price? How to price your products and services
michaelherold
246
13k
[RailsConf 2023] Rails as a piece of cake
palkan
58
6.2k
Collaborative Software Design: How to facilitate domain modelling decisions
baasie
0
110
エンジニアに許された特別な時間の終わり
watany
106
220k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.6k
How People are Using Generative and Agentic AI to Supercharge Their Products, Projects, Services and Value Streams Today
helenjbeal
1
86
Jamie Indigo - Trashchat’s Guide to Black Boxes: Technical SEO Tactics for LLMs
techseoconnect
PRO
0
33
SEO in 2025: How to Prepare for the Future of Search
ipullrank
3
3.3k
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