在Android Studio中,当我调试检测测试时,测试不会在任何断点上停止.调试单元测试工作.我有一个简单的检测测试,只检查是否显示用户名edittext:
@RunWith(AndroidJUnit4.class)
public class LogonActivityTest {
@Rule
public ActivityTestRule mActivityRule = new ActivityTestRule<>(LogOnActivity.class, true, false);
@Before
public void setUp() throws Exception {
mActivityRule.launchActivity(new Intent()); // breakpoint here
}
@Test
public void testSimple() throws Exception {
onView(withId(R.id.act_logon_et_username)).check(matches(isDisplayed())); // breakpoint here
}
}
在build.gradle我已正确设置
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
如何调试检测测试?我正在使用Espresso,Mockito和Dagger 2.