kakao / com.agoda.kakao / ViewBuilder
class ViewBuilder
Class for building view matchers and interactions
This class helps to build matches for views and get their interactions. Please note that any function invoking will add specific matcher to the list and after that all of them will be combined with help of AllOf.allOf()
See Also
Name | Summary |
---|---|
<init> | ViewBuilder() Class for building view matchers and interactions |
Name | Summary |
---|---|
containsText | fun containsText(text: String ): Unit Matches the view which contain given text |
getViewInteraction | fun getViewInteraction(): ViewInteraction Returns view interaction based on all given matchers |
getViewMatcher | fun getViewMatcher(): Matcher< View > Returns combined view matcher with AllOf.allOf() |
isClickable | fun isClickable(): Unit Matches the view that is clickable |
isCompletelyDisplayed | fun isCompletelyDisplayed(): Unit Matches the view that is completely displayed |
isDescendantOfA | fun isDescendantOfA(function: ViewBuilder .() -> Unit ): Unit Matches the view which is descendant of given matcher |
isDisabled | fun isDisabled(): Unit Matches the view if it is not in ENABLED state |
isDisplayed | fun isDisplayed(): Unit Matches the view that is displayed |
isEnabled | fun isEnabled(): Unit Matches the view if it is in ENABLED state |
isFirst | fun isFirst(): Unit Matches the first view |
isGone | fun isGone(): Unit Matches the view with GONE visibility |
isInstanceOf | fun isInstanceOf(clazz: Class <*>): Unit Matches the view by class instance |
isInvisible | fun isInvisible(): Unit Matches the view with INVISIBLE visibility |
isNotClickable | fun isNotClickable(): Unit Matches the view that is not clickable |
isNotCompletelyDisplayed | fun isNotCompletelyDisplayed(): Unit Matches the view that is not completely displayed |
isNotDisplayed | fun isNotDisplayed(): Unit Matches the view that is not displayed |
isRoot | fun isRoot(): Unit Matches only root views |
isVisible | fun isVisible(): Unit Matches the view with VISIBLE visibility |
withAnyText | fun withAnyText(): Unit Matches the view which contains any text |
withBackgroundColor | fun withBackgroundColor(resId: Int ): Unit Matches the view with given background color fun withBackgroundColor(colorCode: String ): Unit Matches the view with given background color code |
withClassName | fun withClassName(matcher: Matcher< String >): Unit Matches the view which class name matches given matcher |
withContentDescription | fun withContentDescription(description: String ): Unit fun withContentDescription(resourceId: Int ): Unit Matches the view with given content description |
withDescendant | fun withDescendant(function: ViewBuilder .() -> Unit ): Unit Matches the view which has descendant of given matcher |
withDrawable | fun withDrawable(resId: Int , toBitmap: (drawable: Drawable ) -> Bitmap = null): Unit fun withDrawable(drawable: Drawable , toBitmap: (drawable: Drawable ) -> Bitmap = null): Unit Matches the view with given drawable |
withId | fun withId(id: Int ): Unit Matches the view with given resource id |
withIndex | fun withIndex(index: Int , function: ViewBuilder .() -> Unit ): Unit Matches only view at given [index](with-index.md#com.agoda.kakao.ViewBuilder$withIndex(kotlin.Int, kotlin.Function1((com.agoda.kakao.ViewBuilder, kotlin.Unit)))/index), if there are multiple views that matches |
withMatcher | fun withMatcher(matcher: Matcher< View >): Unit Matches the view with given custom matcher |
withParent | fun withParent(function: ViewBuilder .() -> Unit ): Unit Matches the view which has parent with given matcher |
withRating | fun withRating(rating: Float ): Unit Matches the view which is RatingBar with given value |
withResourceName | fun withResourceName(name: String ): Unit Matches the view with given resource name fun withResourceName(matcher: Matcher< String >): Unit Matches the view by resource name with given matcher |
withSibling | fun withSibling(function: ViewBuilder .() -> Unit ): Unit Matches the view which has sibling of given matcher |
withText | fun withText(text: String ): Unit fun withText(textId: Int ): Unit Matches the view with given text fun withText(matcher: Matcher< String >): Unit Matches the view with given text matcher |
withoutText | fun withoutText(text: String ): Unit fun withoutText(resId: Int ): Unit Matches if the view does not have a given text |