Espresso UI Test

Add dependencies

contrib  for reyclerView test

Test Basic

1.Create TestFile , ex : RecordActivity , UITestFile -> RecordActivityTest

2.Function basic framework

3.Every testfunction need add @Test

Test work flow

1.check All Views exist  ?

2.check click event is ok ?

3.if have recyclerView , item click is ok ?

4. show alert is ok ?

5. show result is equal ?

onView:藉由ViewMatchers.withId 找出 View

再繼續點 會有

perform(ViewActions) : click , clearText …

check(ViewAssertions) : isDisplayed() ..

RecycleView UI Test

RecyclerViewActions have more actions

reference :

if code to long , can import target method

Reference :

最後修改日期: 2019-04-30 18:53:59





這個網站採用 Akismet 服務減少垃圾留言。進一步瞭解 Akismet 如何處理網站訪客的留言資料