Barista is an instrumentation test framework for Android, written on top of Espresso. It offers a simplified API to call view interactions, assertions, and a way to reset the whole environment before running every test. Use this tag for questions referring to the Barista framework.
Questions tagged [barista]
11 questions
16
votes
2 answers
RuntimeException: Unable to create output dir: /storage/emulated/0/app_spoon-screenshots
I am setting up Spoon for Android UI Testing using the gradle-spoon-plugin using the Spoon 2.0.0 snapshot. My project is set up using Android Gradle plug-in 3.0.1.
When taking screenshots via spoonRule.screenshot(activity, "hello"), I get this…

Mark
- 7,306
- 8
- 45
- 87
9
votes
2 answers
pressBack() is ignored in a Espresso Test
The Espresso's method pressBack() is totally ignored. I'm running the test on the emulator.
What I'm testing? Just calling an Activity, launching a second one, performing two backs, and checking that I'm out of the app.

Roc Boronat
- 11,395
- 5
- 47
- 59
1
vote
1 answer
How to interact with alertdialog in Espresso?
I have a test in which I have a Alertdialog on which there is an "input" field and buttons "Cancel"(id is button2) and "Ok"(id is button1). First I have to enter the value "1234" in the field, and then click on the "Ok" button. But it doesn’t work…

Иван Короткий
- 31
- 1
- 5
1
vote
0 answers
Espresso : My Second scenario in 1 .feature files not relaunch the apps
I just try Espresso for android with cucumber but I found an issue. I have 2 activities (HomeActivity and ResultActivity) in this scenario. This 2 scenario located on 1 .feature files.
Feature : Click button in home screen.
Scenario: Open result…

Fatur
- 21
- 5
0
votes
1 answer
Android: How to test a searchView within an AppBarLayout
This is my code:

Salmandra Reader
- 40
- 5
0
votes
0 answers
Button in child of rv changes how to test: Android
I have a recyclerView with a bunch of childs. Each child has an ImageButton to mark as favourite. Once you click the fav button, the image changes from a white bookmarck with a gray border to a yellow one. I want to check that, once pressed, the…

Salmandra Reader
- 40
- 5
0
votes
1 answer
Android: While running test cases: Could not determine the dependencies of task ':app:compileDebugAndroidTestJavaWithJavac'
I recently stated writing test cases. I am using JUnit and Barista for the same.
My app is compiling successfully and running but when I run test cases it is showing me following error:
Could not determine the dependencies of task…

Sunny
- 68
- 8
0
votes
0 answers
How to click on a button that does not have an id?
I want to click on a button that does not have id. This button has a class name - ImageButton.
Also, the button is located on the tollbar
I can not do this because I do not have id
onView(...).perform(click());
Trying to use Baristo, but this does…

Иван Короткий
- 31
- 1
- 5
0
votes
1 answer
How to click on a button that is located on the toolbar?
I have a test in which I need to click on the button located on the toolbar. This button does not have an ID, but it has the name of the class - ImageButton. How can I click on it using Espresso or Barista?
I can not do this because I do not have…

Иван Короткий
- 31
- 1
- 5
0
votes
1 answer
Android UI Test Long Click and Drag
In my application, I have a feature such that a user is able to re-order items in a list, by long clicking to create a drag shadow, which the user can then drag and insert at a position of choice. Once dropped, the items are re-ordered.
I am…

Hopeful Llama
- 728
- 5
- 26
-1
votes
1 answer
Espresso can't click displayed view
Overnight my ui tests stopped working all of a sudden:
Line in barista clickOn(R.id.myView) throws:
com.schibsted.spain.barista.internal.failurehandler.BaristaException: Could not perform action single click on view with id: [...]
[...] …

000000000000000000000
- 1,467
- 1
- 19
- 38