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
Claude_CodeでSEOを最適化する_AI_Ops_Community_Vol.2__マーケティングx_AIはここまで進化した.pdf
riku_423
2
570
広告の効果検証を題材にした因果推論の精度検証について
zozotech
PRO
0
180
データの整合性を保ちたいだけなんだ
shoheimitani
8
3.1k
AIと新時代を切り拓く。これからのSREとメルカリIBISの挑戦
0gm
0
920
AIエージェントを開発しよう!-AgentCore活用の勘所-
yukiogawa
0
170
ZOZOにおけるAI活用の現在 ~開発組織全体での取り組みと試行錯誤~
zozotech
PRO
5
5.5k
外部キー制約の知っておいて欲しいこと - RDBMSを正しく使うために必要なこと / FOREIGN KEY Night
soudai
PRO
12
5.4k
クレジットカード決済基盤を支えるSRE - 厳格な監査とSRE運用の両立 (SRE Kaigi 2026)
capytan
6
2.7k
Cosmos World Foundation Model Platform for Physical AI
takmin
0
890
茨城の思い出を振り返る ~CDKのセキュリティを添えて~ / 20260201 Mitsutoshi Matsuo
shift_evolve
PRO
1
270
15 years with Rails and DDD (AI Edition)
andrzejkrzywda
0
190
プロポーザルに込める段取り八分
shoheimitani
1
250
Featured
See All Featured
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
12
1k
The Organizational Zoo: Understanding Human Behavior Agility Through Metaphoric Constructive Conversations (based on the works of Arthur Shelley, Ph.D)
kimpetersen
PRO
0
240
The Impact of AI in SEO - AI Overviews June 2024 Edition
aleyda
5
730
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
250
Abbi's Birthday
coloredviolet
1
4.7k
Into the Great Unknown - MozCon
thekraken
40
2.3k
Navigating the Design Leadership Dip - Product Design Week Design Leaders+ Conference 2024
apolaine
0
180
Building AI with AI
inesmontani
PRO
1
690
JAMstack: Web Apps at Ludicrous Speed - All Things Open 2022
reverentgeek
1
340
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
128
55k
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
11
830
Making Projects Easy
brettharned
120
6.6k
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