Slide 24
Slide 24 text
【Espresso】テスト⽤APIの紹介: 概要
78
概要
ViewMatcher Viewの検索条件を指定する。ViewMatchersクラス参照。
withId(), withClassName(), withText(), ...
※hamcrestのallOf(), not(), is(),なども使える
ViewAction Viewに対する操作を指定する。ViewActionsクラス参照。
clearText(), typeText(), click(), ...
ViewAssertion 確認条件を指定する。ViewAssertionsクラス参照。
doesNotExist(), matches(ViewMatcher), ...
onView(ViewMatcher)
.perform(ViewAction)
.check(ViewAssertion);
! 以下の基本形を理解する
˞ perform(), check()は省略可 ! 「ViewMatcher」にあてはまる
Viewに対して
! 「ViewAction」を実⾏した結果
! そのViewが「ViewAssertion」
を満たすことを確認する
Copyright © 2016, NTT Software Corporation.