Skip to content
This repository has been archived by the owner on May 26, 2021. It is now read-only.

Latest commit

 

History

History
61 lines (51 loc) · 11.2 KB

File metadata and controls

61 lines (51 loc) · 11.2 KB

kakao / com.agoda.kakao.common.builders / ViewBuilder

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

AllOf.allOf

Constructors

Name Summary
<init> ViewBuilder()
Class for building view matchers and interactions

Functions

Name Summary
containsText fun containsText(text: String): Unit
Matches the view which contain given text
getViewInteractionDelegate fun getViewInteractionDelegate(): ViewInteractionDelegate
Returns view interaction delegate based on all given matchers
getViewMatcher fun getViewMatcher(): Matcher<View>
Returns combined view matcher with AllOf.allOf()
isAssignableFrom fun isAssignableFrom(clazz: Class<out View>): Unit
Matches views based on instance or subclass of the provided class.
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 colorfun 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.common.builders.ViewBuilder$withIndex(kotlin.Int, kotlin.Function1((com.agoda.kakao.common.builders.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
withoutText fun withoutText(text: String): Unit
fun withoutText(resId: Int): Unit
Matches if the view does not have a given text
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 namefun 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
withTag fun withTag(tag: Any): Unit
Matches the view with given tag assigned
withText fun withText(text: String): Unit
fun withText(textId: Int): Unit
Matches the view with given textfun withText(matcher: Matcher<String>): Unit
Matches the view with given text matcher