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:Inventに行く / A 40-Something Guy’s First re:Invent Adventure
kaminashi
0
180
Knowledge Work の AI Backend
kworkdev
PRO
0
320
日本の AI 開発と世界の潮流 / GenAI Development in Japan
hariby
2
660
20251222_サンフランシスコサバイバル術
ponponmikankan
2
150
AWSに革命を起こすかもしれない新サービス・アップデートについてのお話
yama3133
0
520
Keynoteから見るAWSの頭の中
nrinetcom
PRO
1
110
Authlete で実装する MCP OAuth 認可サーバー #CIMD の実装を添えて
watahani
0
270
Snowflake導入から1年、LayerXのデータ活用の現在 / One Year into Snowflake: How LayerX Uses Data Today
civitaspo
0
2.6k
AIBuildersDay_track_A_iidaxs
iidaxs
4
1.5k
Entity Framework Core におけるIN句クエリ最適化について
htkym
0
130
Oracle Database@Azure:サービス概要のご紹介
oracle4engineer
PRO
3
200
フィッシュボウルのやり方 / How to do a fishbowl
pauli
2
430
Featured
See All Featured
Groundhog Day: Seeking Process in Gaming for Health
codingconduct
0
67
Discover your Explorer Soul
emna__ayadi
2
1k
Game over? The fight for quality and originality in the time of robots
wayneb77
1
67
The Pragmatic Product Professional
lauravandoore
37
7.1k
Crafting Experiences
bethany
0
24
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
254
22k
Heart Work Chapter 1 - Part 1
lfama
PRO
3
35k
Optimising Largest Contentful Paint
csswizardry
37
3.5k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.3k
The untapped power of vector embeddings
frankvandijk
1
1.5k
エンジニアに許された特別な時間の終わり
watany
106
220k
The Mindset for Success: Future Career Progression
greggifford
PRO
0
200
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