testing-support-library

Cannot resolve symbol 'AndroidJUnit4'

夙愿已清 提交于 2019-11-28 16:16:13
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 Studio highlights runner in red and complains "Cannot resolve symbol 'runner'". Background I got to this point by following the tutorials on the Android Developer site for setting up tests using UI Automator . The first problem I encountered was that com.android.support:support-v4:22.2.0 and com.android.support.test:runner:0.2 depend on different versions of com.android.support:support-annotations

Destroy and restart Activity with Testing Support Library

雨燕双飞 提交于 2019-11-28 00:12:07
问题 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 something activity.finish(); Assert.assertTrue(this.activity.isFinishing()); activity = inst.getActivity(); // assert that activity's state is restored How can I accomplish the same thing using the new Testing Support Library? I'm fine with using either Espresso and/or UI Automator or any other

Cannot resolve symbol 'AndroidJUnit4'

≯℡__Kan透↙ 提交于 2019-11-27 09:30:42
问题 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 Studio highlights runner in red and complains "Cannot resolve symbol 'runner'". Background I got to this point by following the tutorials on the Android Developer site for setting up tests using UI Automator. The first problem I encountered was that com.android.support:support-v4:22.2.0 and com