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 : https://imsardine.github.io/2017/06/23/espresso-interact-with-verify-item-child-views/

if code to long , can import target method

Reference :

https://imsardine.github.io/2017/06/23/espresso-interact-with-verify-item-child-views/

https://developer.android.com/training/testing/espresso

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

作者

留言

撰寫回覆或留言

發佈留言必須填寫的電子郵件地址不會公開。

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