Questions tagged [android-espresso]

Espresso is a library which is used to write Android UI tests. It is also known as Google's Testing Tools For Android

Also called android-test-kit, Espresso helps to create faster UI tests for Android.

The core API is small, predictable, and easy to learn and yet remains open for customization. Espresso tests state expectations, interactions, and assertions clearly without the distraction of boilerplate content, custom infrastructure, or messy implementation details getting in the way.

Espresso tests run optimally fast! Leave your waits, syncs, sleeps, and polls behind and let Espresso gracefully manipulate and assert on the application UI when it is at rest. Enjoy writing and executing your tests today - try a shot of Espresso!

Useful links

3335 questions
2
votes
0 answers

Record Espresso Testcases in Android studio 2.2

I am using Android studio 2.2 and try to record Espresso test. I am unable to add asserts to Toast messages, EditText error message or Snackbar message. I am getting below exception for Snackbar text …
2
votes
1 answer

'transformClassesWithMultidexlistForDebugAndroidTest' task fails when android.support.test.runner.AndroidJUnitRunner specified

I'm trying to run an espresso test on MultiDex app and am failing with the below error Error:Execution failed for task > :transformClassesWithMultidexlistForDebugAndroidTest'. java.io.IOException: The output jar is empty. Did you specify the…
2
votes
0 answers

UIAutomator facebook login

I created a UIAutomator login test for my app, and it works on some of the emulators. Problem is, it doesnt work on all of them. UiObject input = mDevice.findObject(new UiSelector().instance(0).className(EditText.class)); …
2
votes
1 answer

How can I create a branch on git for testing android project using espresso?

I'm using espresso to test my application, and I have to make changes on code through testing. And when I need to pull updates from repository I want to update without affecting testing changes. So I need branch for development and branch for…
Mohammad Alotol
  • 1,409
  • 15
  • 23
2
votes
1 answer

What are some of the disadvantages of AndroidViewClient/Culebra over Espresso for Android GUI Automated Testing?

I've been using AndroidViewClient for a couple of months now and I like it so far, it's simple and a pretty powerful tool. I'm trying to develop an automated testing platform for more extensive and thorough automated testing of our product and I'm…
2
votes
1 answer

How to set image in imageview while testing with espresso?

I have used third party library in my sign up form for selecting image from gallery. My signup form works fine. Now I want to test it using espresso.The biggest problem that I am facing right now is how to set profile photo's imageview while testing…
Mrugesh
  • 4,381
  • 8
  • 42
  • 84
2
votes
0 answers

Android Espresso tests with rest api

I am currently testing my app's UI with Espresso, and have run into a few problems. My app requires a user to be logged in to use it, and then after logging in, in my apps onCreate I load a list with data that is retrieved from an api call to my…
2
votes
1 answer

Espresso: how to get the children of a View by index

I have a view containing EditText and I want to be sure that they are displayed in the correct order. I use Espresso but I don't know how to get the children of a view by index. Is it a way to do that?
Eselfar
  • 3,759
  • 3
  • 23
  • 43
2
votes
2 answers

Espresso Get Display Activity

Can we get the current display activity in Espresso to write down some conditional code accordingly? In my application we have an Introduction page which display user only once from the next application directly take user to login screen. Can we…
Krishnakant
  • 1,453
  • 3
  • 18
  • 30
2
votes
2 answers

Espresso openActionBarOverflowOrOptionsMenu causes NoMatchingViewException

I have just started experimenting with the Espresso testing framework for Android and the first thing I wanted to do was click the "Settings" button in an activity's options menu. However, when I try to call…
Adam
  • 2,167
  • 5
  • 19
  • 33
2
votes
2 answers

Espresso checking if toasts are displayed (one on top of another)

I have an problem with checking if toast is displayed using espresso. I'm using class: import android.os.IBinder; import android.support.test.espresso.Root; import android.view.WindowManager; import org.hamcrest.Description; …
Kamajabu
  • 596
  • 1
  • 5
  • 19
2
votes
1 answer

Intending return null (or it has null argument)?

I have no idea why "intending" in the following code returns null. I just copied the code from here: https://google.github.io/android-testing-support-library/docs/espresso/intents/index.html The exception is java.lang.NullPointerException: Attempt…
Jiechao Wang
  • 922
  • 1
  • 15
  • 32
2
votes
1 answer

java.lang.AbstractMethodError: abstract method when running espresso on Kotlin with Mockito

I have an instrumental espresso test that uses mockito. The test class as below. import android.support.test.InstrumentationRegistry import android.support.test.rule.ActivityTestRule import org.junit.Before import org.junit.Rule import…
Elye
  • 53,639
  • 54
  • 212
  • 474
2
votes
1 answer

How to test multiple activities using Android Espresso

Assume there are two activities A and B. A is login activity which has username, password fields and login button. Once username and password entered and login button clicked, it make a network call. If we are going to test views of that in same…
Ruwanka De Silva
  • 3,555
  • 6
  • 35
  • 51
2
votes
0 answers

How to mock members of started services created by ServiceTestRule?

To simplify my question: I have a Service that is invoked by startService (rather then bindService), does some calculation and publishes a method to some other component when it finishes. I want to test its behavior. I have a Test class with a…
1 2 3
99
100