android-espresso

Espresso Tests cannot access class file

北战南征 提交于 2019-12-22 01:53:26
问题 I get the following errors where i try to run a ui test. /Users/etiennelawlor/workspace/MovieHub/app/src/androidTest/java/com/etiennelawlor/moviehub/MoviesFragmentTest.java Error:(34, 28) error: cannot access AppCompatActivity class file for android.support.v7.app.AppCompatActivity not found Error:(34, 58) error: cannot infer type arguments for ActivityTestRule<> Error:(41, 41) error: cannot access IdlingResource class file for android.support.test.espresso.IdlingResource not found Error:(51,

leave Android app in final state on espresso test completion

爷,独闯天下 提交于 2019-12-21 20:06:26
问题 Is it possible to leave the app under test in whatever state it's in at the end of an espresso test? I don't care if it's failure or success. When I am working on developing a feature and a test for said feature it would be useful to just have the instrumentation app stop and leave the app under test alone in whatever state it happens to be in. This would allow me to play around manually or attach a debugger and see what is going on without running through the entire flow manually. Anyone

“No tests found” for instrumentation tests for Lollipop and above

烈酒焚心 提交于 2019-12-21 07:41:06
问题 My instrumentation based (espresso) tests don't run on Lollipop+ devices and emulators. They correctly run on any other platform. I have the same symptoms as the guy in this thread - https://groups.google.com/forum/?fromgroups#!topic/adt-dev/QW5SuzQizNk My tests are in src/androidTest/java/ I've set testInstrumentationRunner 'android.support.test.runner.AndroidJUnitRunner' The test classes are @RunWith(AndroidJUnit4.class) Individual tests are annotated with @Test I can execute a ./gradlew

android.support.test.espresso.NoActivityResumedException: No activities in stage RESUMED

随声附和 提交于 2019-12-21 06:10:00
问题 I'm trying to write test cases for my activities. I have several activities and there is no issue for one of them while I'm getting following error when I try to run tests over other ActivityTest classes. android.support.test.espresso.NoActivityResumedException: No activities in stage RESUMED. Did you forget to launch the activity. (test.getActivity() or similar)? This is my class that all my test cases fails: @RunWith(AndroidJUnit4.class) @LargeTest public class LocatingActivityTest { @Rule

Click on EditText's drawable right with Espresso

旧巷老猫 提交于 2019-12-21 05:08:48
问题 How could be possible to click on EditText's right drawable (check the screenshot)? I have tried several ways but I always get stuck. public static Matcher<View> withEditTextDrawable(final int resourceId) { return new BoundedMatcher<View, EditText>(EditText.class) { @Override protected boolean matchesSafely(final EditText editText) { // ???? return false; } @Override public void describeTo(Description description) { description.appendText("with drawable from resource id: "); description

Unlock emulator screen using espresso

。_饼干妹妹 提交于 2019-12-21 01:39:06
问题 I'm developing my first android application and I was setting up the CI server. My espresso tests run fine on my machine but travis errors out with the following java.lang.RuntimeException: Waited for the root of the view hierarchy to have window focus and not be requesting layout for over 10 seconds. It seems that I need to unlock the emulator screen before I run the tests. To do so I have to add a manifest to src/debug with the required permissions and then unlock the screen with:

Espresso test fails with NoActivityResumedException often

吃可爱长大的小学妹 提交于 2019-12-20 15:58:43
问题 EDIT: Updated description and error message and added some images. Still have this problem. I have a strange error that occur many times when running espresso tests. After a couple of successful test runs the tests starts failing with following exception: 06-23 13:04:48.438 info TestRunner failed: WhenNavigatingToReportsThenCorrectViewShouldBeShown(com.myapp.ui.views.MainActivityTest) 06-23 13:04:48.439 info TestRunner ----- begin exception ----- 06-23 13:04:48.441 info TestRunner android

Espresso test fails with NoActivityResumedException often

自作多情 提交于 2019-12-20 15:58:28
问题 EDIT: Updated description and error message and added some images. Still have this problem. I have a strange error that occur many times when running espresso tests. After a couple of successful test runs the tests starts failing with following exception: 06-23 13:04:48.438 info TestRunner failed: WhenNavigatingToReportsThenCorrectViewShouldBeShown(com.myapp.ui.views.MainActivityTest) 06-23 13:04:48.439 info TestRunner ----- begin exception ----- 06-23 13:04:48.441 info TestRunner android

PerformException: Error performing 'single click'

大城市里の小女人 提交于 2019-12-20 10:22:04
问题 I got a error when i run android espresso test: com.google.android.apps.common.testing.ui.espresso.PerformException: Error performing 'single click' on view 'with id: is <2131034173>'. My code is easy: onView(withId(R.id.btn)).perform(click()); But there is no error with this code: onView(withId(R.id.btn)).check(matches(isDisplayed())); I can not find the cause why it happen. 回答1: The trick is to read the full stack-trace of the error. In the middle, there is some crucial piece of information

'android.support.test.espresso does not exist' when I want to use it to individual apk test

喜夏-厌秋 提交于 2019-12-20 10:07:09
问题 I need to do some auto testing jobs to an Android application without its source code. I found both robotium and espresso can do this job, I decided to use espresso because its Google support. I would like to sign both the target apk and espresso test apk with the same signature, the target apk is the same as this sample. When I start to coding the espresso test apk, I did the following jobs. The build.gradle in Module:app: apply plugin: 'com.android.application' android { compileSdkVersion