가끔은 제 신청서에 드문 버그가 있습니다. 하지만 매우 희귀하기 때문에 재현 할 수는 없습니다. 그래서 간단 에스프레소 테스트를하기로했습니다.에스프레소 테스트를 여러 번 실행하십시오.
@RunWith(AndroidJUnit4::class)
@LargeTest
class MainActivityTest {
val password = "1234"
@Rule @JvmField
var mActivityRule: ActivityTestRule<MainActivity> = ActivityTestRule(MainActivity::class.java)
@Test
fun checkNotesListNotEmpty() {
onView(withId(R.id.password_edit_text)).perform(typeText(password))
onView(withId(R.id.notes_recycler_view)).check { view, noMatchingViewException ->
if (noMatchingViewException != null) throw noMatchingViewException
assertThat((view as RecyclerView).adapter.itemCount, Matchers.`is`(1))
}
}
}
어떻게 테스트를 중단하고 일치가 실패하면 멈출 수 있습니까?
'재미 checkNotesListNotEmpty 시도는() piotrek1543 주요 문제 @ InterruptedException' – piotrek1543
내가 (루프) 에스프레소 테스트를 여러 번 실행하는 방법을 찾을 수 있다는 것입니다 발생합니다. 내가 어떻게 해? – Alexandr