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
190
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
410
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
690
Building the automated Android UI testing in Continuous integration at LINE MAN Wongnai
akexorcist
1
880
Building the automated Android UI testing in Continuous integration at LINE MAN Wongnai
akexorcist
1
86
What's new in Android 14 - IO Extended George Town 2023
akexorcist
1
380
All you need to know about new Logcat in Android Studio - DevFest Bangkok 2022
akexorcist
0
100
Backend for mobile app - Droidcon SG 2022
akexorcist
0
110
Backend for mobile app - Android Bangkok Conference 2022
akexorcist
1
200
Other Decks in Technology
See All in Technology
マルチロールEMが実践する「組織のレジリエンス」を高めるための組織構造と人材配置戦略
coconala_engineer
3
610
Introduction to Sansan for Engineers / エンジニア向け会社紹介
sansan33
PRO
6
72k
A Gentle Introduction to Transformers
keio_smilab
PRO
2
930
自動テストが巻き起こした開発プロセス・チームの変化 / Impact of Automated Testing on Development Cycles and Team Dynamics
codmoninc
3
1.2k
DevOpsエージェントで実現する!! AWS Well-Architected(W-A) を実現するシステム設計 / 20260307 Masaki Okuda
shift_evolve
PRO
3
260
Serverless Agent Architecture on Azure / serverless-agent-on-azure
miyake
1
160
Oracle Database@Azure:サービス概要のご紹介
oracle4engineer
PRO
4
1.1k
Agentic Software Modernization - Back to the Roots (Zürich Agentic Coding and Architectures, März 2026)
feststelltaste
1
220
モブプログラミング再入門 ー 基本から見直す、AI時代のチーム開発の選択肢 ー / A Re-introduction of Mob Programming
takaking22
5
730
S3はフラットである –AWS公式SDKにも存在した、 署名付きURLにおけるパストラバーサル脆弱性– / JAWS DAYS 2026
flatt_security
0
860
JAWS DAYS 2026 楽しく学ぼう!ストレージ 入門
yoshiki0705
2
110
マルチプレーンGPUネットワークを実現するシャッフルアーキテクチャの整理と考察
markunet
2
150
Featured
See All Featured
Java REST API Framework Comparison - PWX 2021
mraible
34
9.2k
Building an army of robots
kneath
306
46k
Building Better People: How to give real-time feedback that sticks.
wjessup
370
20k
Hiding What from Whom? A Critical Review of the History of Programming languages for Music
tomoyanonymous
2
510
Claude Code のすすめ
schroneko
67
220k
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
11
850
DevOps and Value Stream Thinking: Enabling flow, efficiency and business value
helenjbeal
1
140
Why You Should Never Use an ORM
jnunemaker
PRO
61
9.8k
Visual Storytelling: How to be a Superhuman Communicator
reverentgeek
2
460
Breaking role norms: Why Content Design is so much more than writing copy - Taylor Woolridge
uxyall
0
200
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
31
3.1k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.7k
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