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
AWS DevOps Agent x ECS on Fargate検証 / AWS DevOps Agent x ECS on Fargate
kinunori
3
380
生成AIを活用した音声文字起こしシステムの2つの構築パターンについて
miu_crescent
PRO
3
250
衛星画像即時マッピングサービスの実現に向けて
lehupa
1
230
Oracle Database@Azure:サービス概要のご紹介
oracle4engineer
PRO
3
600
AIエージェントに必要なのはデータではなく文脈だった/ai-agent-context-graph-mybest
jonnojun
1
560
LiDARが変えたARの"距離感"
zozotech
PRO
0
170
Claude Code で画面の仕様書を作ろう
zozotech
PRO
0
180
OpenShiftでllm-dを動かそう!
jpishikawa
0
200
GitHub Copilot CLI を使いやすくしよう
tsubakimoto_s
0
160
ZOZO.swift #2
zozotech
PRO
0
170
AIエージェントを開発しよう!-AgentCore活用の勘所-
yukiogawa
0
210
マネージャー視点で考えるプロダクトエンジニアの評価 / Evaluating Product Engineers from a Manager's Perspective
hiro_torii
0
250
Featured
See All Featured
Conquering PDFs: document understanding beyond plain text
inesmontani
PRO
4
2.4k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
8k
Docker and Python
trallard
47
3.7k
How To Stay Up To Date on Web Technology
chriscoyier
791
250k
DBのスキルで生き残る技術 - AI時代におけるテーブル設計の勘所
soudai
PRO
62
50k
Efficient Content Optimization with Google Search Console & Apps Script
katarinadahlin
PRO
1
340
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.6k
AI: The stuff that nobody shows you
jnunemaker
PRO
2
290
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
196
71k
Bootstrapping a Software Product
garrettdimon
PRO
307
120k
Designing Powerful Visuals for Engaging Learning
tmiket
0
240
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
1.8k
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