我想测试
Android 6的权限,但我找不到使用Espresso点击“允许”按钮的方法.有没有办法做到这一点?
Espresso的版本是2.2.1.
考试:
@Test
public void acceptFirstPermission() throws Exception {
onView(withText("ALLOW")).perform(click());
}
行为:
I still receiving the frozen screen with the Dialog (like on the screenshot). Test executing all time until he becomes finished.
输出:
Running tests
Test running started
android.support.test.espresso.NoActivityResumedException: No activities in stage RESUMED. Did you forget to launch the activity. (test.getActivity() or similar)?
at dalvik.system.VMStack.getThreadStackTrace(Native Method)
at java.lang.Thread.getStackTrace(Thread.java:580)
at android.support.test.espresso.base.DefaultFailureHandler.getUserFriendlyError(DefaultFailure