Skip to main content
10 votes
3 answers
4k views

The GrantPermissionRule that I successfully implemented in my Android app on 1/3/2018 no longer works. When I run my Espresso tests through Android Studio, the emulator blocks waiting for permissions....
Michael Osofsky's user avatar
3 votes
1 answer
4k views

I've tried today the new android testing support lib. I need the write external storage permission for my tests so I've created the following test with the new GrantPermissionRule. ExternalDirTest....
user3166372's user avatar
0 votes
1 answer
91 views

i have an empty android UI test for my MainActivity clas code below. @RunWith(AndroidJUnit4.class) public class MainActivityTest { @Rule public ActivityTestRule<MainActivity> mActivityRule = ...
filthy_wizard's user avatar
5 votes
3 answers
2k views

I am converting all of my tests over to the Testing Support Library. However, when I try to import the LargeTest annotation like this import android.support.test.filters.LargeTest; I get Cannot ...
Code-Apprentice's user avatar
11 votes
4 answers
10k views

Using the old JUnit3-style tests in Android, I could do the following to destory and restart an activity: Instrumentation inst = getInstrumentation(); Activity activity = inst.getActivity(); // do ...
Code-Apprentice's user avatar
9 votes
1 answer
1k views

The answer to AndroidJUnit4 and Parameterized tests links to a Google example for using @RunWith(Parameterized.class). However, this is a simple unit test. How do I run parameterized instrumented ...
Code-Apprentice's user avatar
2 votes
1 answer
2k views

I am using Espresso to test an app with several AutoCompleteTextViews. For one particular test, the autocomplete popup appears, but I want to just ignore it and move to the next TextView. How can I do ...
Code-Apprentice's user avatar
162 votes
21 answers
87k views

Obviously I need the correct import statment to solve this problem. According to the docs for AndroidJUnit4, this should be import android.support.test.runner.AndroidJUnit4; When I do that, Android ...
Code-Apprentice's user avatar