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
1 answer

Espresso - Why is Espresso finding this match ambiguous?

I have an ExpandableListView and I would like to click() one of its childs. I have tried LOADS OF different ways but I just can't seem to understand how Espresso works. For instance, why does this code do not…
rafaelc
  • 57,686
  • 15
  • 58
  • 82
2
votes
0 answers

Unit-Test / Integration-Test: Was startService() called

In this question some years ago someone suggested unit-testing a startService call by using a specific Context. Now, about 4 years later, I am wondering if this functionality can't be handled by some Framework like Espresso. I have an…
2
votes
1 answer

Espresso: Why don't spinners close after selection?

I have a question about selecting items in Spinners with Espresso. Or to be more exact: The selection works, but after that the view assertions fail because the spinner is still open. Let's say I have a really simple activity that contains a spinner…
mreichelt
  • 12,359
  • 6
  • 56
  • 70
2
votes
0 answers

connectedAndroidTest launched via gradle doesn't complete

I have over a hundred Espresso tests. Once in a while, when I launch them using ./gradlew clean cAT the tests complete on the connected device, in my case Genymotion emulator, but when they're done, the gradle task is stuck in the terminal at…
2
votes
3 answers

Android Studio 2.2 preview Record Espresso Test option not available

I have seen Google Keynote 2016. This is link to Video So I was excited about Espresso recorder. I am not able to see the Record Espresso Test option in run menu. I am using Android studio 2.2 preview 1. Below Screen shot is from video.
N J
  • 27,217
  • 13
  • 76
  • 96
2
votes
1 answer

Check an AlertDialog's title and message

With Espresso is it possible to simplify those two statements ? onView(withText(expectedErrorTitle)) .check(matches(isDisplayed())); onView(withText(expectedErrorMessage)) .check(matches(isDisplayed())); I tried…
Yohan D
  • 930
  • 2
  • 7
  • 24
2
votes
1 answer

AndroidTest Manifest permission not detected

I have androidTest Manifest that has this permission: However, when I run the test, this permission is not set in my devDebug build. It only works when I add it to…
2
votes
0 answers

Perform Exception on recycler view item (Espresso)

So I'm trying to do a click on a RecyclerView item. If the position is in the view then this code works fine onView(withId(R.id.recyclerView)).perform( RecyclerViewActions.actionOnItemAtPosition(7, click())); So say if the item is not in the view I…
user3354265
  • 777
  • 1
  • 10
  • 26
2
votes
2 answers

Can we disable a dialog box in aws device farm for Android espresso tests

We are using aws device farm for running all our android espresso tests. If you see the below image, this dialog box is making our few tests to fail. Is there anyway we can disable this dialog box while running the tests? Or is there a way we can…
python
  • 4,403
  • 13
  • 56
  • 103
2
votes
1 answer

How to fix the date for an Android-Espresso test case

This question is about making Android test cases independent of the date, when they are run, even if the content being tested depends on the system date of the phone/emulator. I want to test a view in my Android App with Espresso, that depends on…
Ruik
  • 1,222
  • 1
  • 20
  • 36
2
votes
0 answers

Automated Facebook login using Espresso test suite on Android

I'm trying to create an automated test suite for running in the Google Cloud Test Lab. My first activity is just a tutorial screen with a "Login with Facebook" button. I'm trying to use Espresso to automatically input a test user email and password…
2
votes
1 answer

Gradle JUnit android run all but @FlakyTest

I have a few tests that have multiple annotations: @Test @LargeTest @FlakyTest I found a way to run only @LargeTest from here. ./gradlew app:connectedAndroidTest -Pandroid.testInstrumentationRunnerArguments.size=large Is there a way to run all…
Prabin Timsina
  • 2,131
  • 3
  • 16
  • 27
2
votes
0 answers

How do you perform a test assertion for two views with Espresso

I have been trying to follow the documentation here. I want to be able to check the text of two views for some text content. I think I know how to do if for one view but I am unsure how to do it for two or…
J Whitfield
  • 755
  • 11
  • 22
2
votes
0 answers

How to increase heap size for Android Automation

I am using spoon runner for executing my test cases developed using Espresso and UI automator. I have around 200 test cases. Most of the time execution is crashed due to out of memory issue. When I checked Android memory monitor, there is only 128…
Basim Sherif
  • 5,384
  • 7
  • 48
  • 90
2
votes
1 answer

Setting preferences state before running test

I am using espresso and AndroidJunit4 runner. I am trying to set some preferences so that when onCreate or onResume fires that logic will be engaged. It seems that the call to prefs before doing the onView() has no effect. I am printing out the…
1 2 3
99
100