Lock in $30 Savings on PRO—Offer Ends Soon! ⏳
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
150
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
330
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
640
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
77
What's new in Android 14 - IO Extended George Town 2023
akexorcist
1
350
All you need to know about new Logcat in Android Studio - DevFest Bangkok 2022
akexorcist
0
97
Backend for mobile app - Droidcon SG 2022
akexorcist
0
96
Backend for mobile app - Android Bangkok Conference 2022
akexorcist
1
180
Other Decks in Technology
See All in Technology
AIと二人三脚で育てた、個人開発アプリグロース術
zozotech
PRO
1
710
第4回 「メタデータ通り」 リアル開催
datayokocho
0
120
Playwrightのソースコードに見る、自動テストを自動で書く技術
yusukeiwaki
13
5.2k
AWSセキュリティアップデートとAWSを育てる話
cmusudakeisuke
0
220
LLM-Readyなデータ基盤を高速に構築するためのアジャイルデータモデリングの実例
kashira
0
230
20251209_WAKECareer_生成AIを活用した設計・開発プロセス
syobochim
6
1.5k
Snowflakeでデータ基盤を もう一度作り直すなら / rebuilding-data-platform-with-snowflake
pei0804
4
1.3k
regrowth_tokyo_2025_securityagent
hiashisan
0
220
ログ管理の新たな可能性?CloudWatchの新機能をご紹介
ikumi_ono
1
640
今からでも間に合う!速習Devin入門とその活用方法
ismk
1
640
新 Security HubがついにGA!仕組みや料金を深堀り #AWSreInvent #regrowth / AWS Security Hub Advanced GA
masahirokawahara
1
1.8k
チーリンについて
hirotomotaguchi
6
1.8k
Featured
See All Featured
Optimizing for Happiness
mojombo
379
70k
Java REST API Framework Comparison - PWX 2021
mraible
34
9k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
55
3.1k
Stop Working from a Prison Cell
hatefulcrawdad
273
21k
The Power of CSS Pseudo Elements
geoffreycrofte
80
6.1k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
659
61k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
The Straight Up "How To Draw Better" Workshop
denniskardys
239
140k
Typedesign – Prime Four
hannesfritz
42
2.9k
Why You Should Never Use an ORM
jnunemaker
PRO
61
9.6k
Writing Fast Ruby
sferik
630
62k
Navigating Team Friction
lara
191
16k
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