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
A good Barista to enjoy a good Espresso
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
RubenAbad
October 16, 2018
Programming
0
37
A good Barista to enjoy a good Espresso
RubenAbad
October 16, 2018
Tweet
Share
Other Decks in Programming
See All in Programming
Lambda のコードストレージ容量に気をつけましょう
tattwan718
0
150
Oxlintはいいぞ
yug1224
5
1.4k
Amazon Bedrockを活用したRAGの品質管理パイプライン構築
tosuri13
5
800
Smart Handoff/Pickup ガイド - Claude Code セッション管理
yukiigarashi
0
150
360° Signals in Angular: Signal Forms with SignalStore & Resources @ngLondon 01/2026
manfredsteyer
PRO
0
140
MUSUBIXとは
nahisaho
0
140
開発者から情シスまで - 多様なユーザー層に届けるAPI提供戦略 / Postman API Night Okinawa 2026 Winter
tasshi
0
210
カスタマーサクセス業務を変革したヘルススコアの実現と学び
_hummer0724
0
740
LLM Observabilityによる 対話型音声AIアプリケーションの安定運用
gekko0114
2
440
Honoを使ったリモートMCPサーバでAIツールとの連携を加速させる!
tosuri13
1
180
日本だけで解禁されているアプリ起動の方法
ryunakayama
0
270
AI Schema Enrichment for your Oracle AI Database
thatjeffsmith
0
330
Featured
See All Featured
How to Grow Your eCommerce with AI & Automation
katarinadahlin
PRO
1
110
Avoiding the “Bad Training, Faster” Trap in the Age of AI
tmiket
0
79
Agile Actions for Facilitating Distributed Teams - ADO2019
mkilby
0
120
SERP Conf. Vienna - Web Accessibility: Optimizing for Inclusivity and SEO
sarafernandez
1
1.3k
GraphQLとの向き合い方2022年版
quramy
50
14k
Reality Check: Gamification 10 Years Later
codingconduct
0
2k
Darren the Foodie - Storyboard
khoart
PRO
2
2.4k
DBのスキルで生き残る技術 - AI時代におけるテーブル設計の勘所
soudai
PRO
62
50k
16th Malabo Montpellier Forum Presentation
akademiya2063
PRO
0
53
How To Stay Up To Date on Web Technology
chriscoyier
791
250k
The AI Revolution Will Not Be Monopolized: How open-source beats economies of scale, even for LLMs
inesmontani
PRO
3
3.1k
How to Talk to Developers About Accessibility
jct
2
140
Transcript
Android Kaizen Talks Introducing Barista library
“The person who serves a great Espresso”
Espresso onView(withId(R.id.button)).perform(click()) Barista clickOn(R.id.button)
Interactions with Barista
clickOn(R.id.viewId) clickOn(R.string.some_text) clickOn(“Some text”) clickBack()
longClickOn(R.id.viewId) longClickOn(R.string.some_text) longClickOn(“Some text”) Long click?
writeTo(R.id.editTextId, “Cooooool stuff!”) clearText(R.id.editTextId)
Are you having troubles to test ListViews / RecyclerViews?
clickListItem(R.id.recyclerViewId, itemPosition) clickListItemChild( R.id.recyclerViewId, itemPosition, R.id.clickableViewId ) scrollListToPosition(R.id.recyclerViewId, itemPosition)
And more, and more useful functions… clickMenu(R.id.menuItemId) clickSpinnerItem(R.id.spinnerId, 2) openDrawer()
refresh() closeKeyboard() swipeViewPagerForward() …
Assertions with Barista
Espresso onView(withId(R.id.button)).check(isDisplayed()) Barista assertDisplayed(R.id.button)
assertDisplayed(R.id.buttonId) assertDisplayed(R.string.textId) assertDisplayed(“Displayed!”) assertDisplayed(R.id.buttonId, “Displayed!”)
assertDisplayed assertNotDisplayed assertEnabled assertDisabled assertNotExist assertChecked assertUnchecked assertHasAnyDrawable assertHasDrawable assertHasAnyBackground
assertDrawerIsOpen assertDrawerIsClosed assertContains assertNotContains
Need more goodies?
Custom assertions
assertAny<Button>( ) { it.enabled == true } R.id.buttonId “Button text”
Need more goodies?
mockAndroidCamera() // Creates a Bitmap on a camera provided URI
Need more goodies?
PermissionGranter.allowPermissionsIfNeeded( Manifest.permission.GET_ACCOUNTS )
Need more goodies?
PermissionGranter.allowPermissionsIfNeeded( Manifest.permission.GET_ACCOUNTS )
Need more goodies?
@get:Rule val clearPreferenceRule = ClearPreferenceRule() // Clear all app’s SharedPreferences
@get:Rule val clearDatabaseRule = ClearDatabaseRule() // Delete all tables from all the app’s SQLite Databases @get:Rule val clearFilesRule = ClearFilesRule() // Delete all files in getFilesDir() and getCacheDir()
Need more goodies?
@Test @AllowFlaky(attempts = 5) fun myTest() { … } @Test
@Repeat(times = 5) fun myTest() { … }
Can it be even simpler by default?
@get:Rule val baristaRule = BaristaRule.create(MyActivity::class.java) baristaRule.launchActivity() //…
The rule assumes some sane defaults: - Retry flaky tests:
10 attempts - Launch activity automatically: false - Initial touch mode enabled: true - Clear preferences - Clear databases - Clear files
“Magic” that Barista does for you
- Scrolls when needed - Scrolls on all views, including
NestedScrollViews - Just interacts with displayed Views
Any question?
You can find everything you need at their Github! https://github.com/SchibstedSpain/Barista