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
200
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
420
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
700
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
87
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
契約書からの情報抽出を行うLLMのスループットを、バッチ処理を用いて最大40%改善した話
sansantech
PRO
3
290
The essence of decision-making lies in primary data
kaminashi
0
110
夢の無限スパゲッティ製造機 #phperkaigi
o0h
PRO
0
380
20260323_データ分析基盤でGeminiを使う話
1210yuichi0
0
190
AI時代のシステム開発者の仕事_20260328
sengtor
0
280
Blue/Green Deployment を用いた PostgreSQL のメジャーバージョンアップ
kkato1
0
150
「捨てる」を設計する
kubell_hr
0
380
Kubernetesの「隠れメモリ消費」によるNode共倒れと、Request適正化という処方箋
g0xu
0
140
FastMCP OAuth Proxy with Cognito
hironobuiga
3
210
Embeddings : Symfony AI en pratique
lyrixx
0
350
脳が溶けた話 / Melted Brain
keisuke69
1
1.1k
RGBに陥らないために -プロダクトの価値を届けるまで-
righttouch
PRO
0
120
Featured
See All Featured
Max Prin - Stacking Signals: How International SEO Comes Together (And Falls Apart)
techseoconnect
PRO
0
130
How to Grow Your eCommerce with AI & Automation
katarinadahlin
PRO
1
160
Agile Leadership in an Agile Organization
kimpetersen
PRO
0
120
BBQ
matthewcrist
89
10k
Taking LLMs out of the black box: A practical guide to human-in-the-loop distillation
inesmontani
PRO
3
2.1k
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
SEO for Brand Visibility & Recognition
aleyda
0
4.4k
Navigating Weather and Climate Data
rabernat
0
150
Reflections from 52 weeks, 52 projects
jeffersonlam
356
21k
Automating Front-end Workflow
addyosmani
1370
200k
The World Runs on Bad Software
bkeepers
PRO
72
12k
Navigating Algorithm Shifts & AI Overviews - #SMXNext
aleyda
1
1.2k
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