8
在Android Studio中,當我調試儀器測試時,測試不會停在任何斷點上。調試單元測試的作品。我有一個簡單的儀表測試,如果僅顯示用戶名檢查的EditText:如何在Android Studio中調試儀器測試?
@RunWith(AndroidJUnit4.class)
public class LogonActivityTest {
@Rule
public ActivityTestRule<LogOnActivity> 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"
如何調試儀器測試?我使用濃咖啡,Mockito和匕首2.