相关疑难解决方法(0)

多次运行espresso测试

有时我在申请中遇到了罕见的错误.但我无法重现它,因为它非常罕见.所以,我决定写简单的浓咖啡测试:

@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))
        }
    }
}
Run Code Online (Sandbox Code Playgroud)

如何在匹配失败时循环此测试并停止它?

android kotlin android-espresso

8
推荐指数
2
解决办法
4028
查看次数

标签 统计

android ×1

android-espresso ×1

kotlin ×1