Android Espresso #2 - ViewMatcher, ViewAction, ViewAssertion


Android Espresso #2 - ViewMatcher, ViewAction, ViewAssertion

ViewMatchers, ViewActions, ViewAssertions에 포함된 함수들과 어떤 식으로 사용해야 하는지를 설명하고, 주의할 점들을 알아보려 한다. ViewMatchers 뷰의 상태와 Matcher 함수들을 모아 놓은 클래스이다. ViewMatchers는 뷰를 찾기 위해서도 ( onView ) 쓰고, 뷰의 상태를 확인하기 ( check ) 위해서도 사용한다. onView(withText("Welcome")) .check(matches(allOf(isDisplayed(),withText("Welcome")))) 위의 코드에서 사용된 withText, isDisplayed 같은 것들이 ViewMatcher이다. ViewMatchers안에는 몇십 개 이상의 함수가 있기에 모두 소개할 수 없고,..


원문링크 : Android Espresso #2 - ViewMatcher, ViewAction, ViewAssertion