ViewPredicates

A collection of useful predicates over Android views for tests

Functions

Link copied to clipboard
open fun hasContentDescription(contentDescription: String): Predicate<View>
Link copied to clipboard
open fun hasDrawable(drawable: Drawable): Predicate<View>
Link copied to clipboard
open fun hasId(id: Int): Predicate<View>
Link copied to clipboard
open fun hasTag(tagId: Int, tagValue: Any): Predicate<View>
Link copied to clipboard
open fun hasText(text: String): Predicate<View>
Returns a predicate that returns true if the applied on view's text is equal to the given text.
Link copied to clipboard
open fun hasTextMatchingPredicate(predicate: Predicate<String>): Predicate<View>
Returns a predicate that returns true if the applied on view's text is equal to the given text.
Link copied to clipboard
open fun hasVisibleDrawable(drawable: Drawable): Predicate<View>
Link copied to clipboard
open fun hasVisibleId(viewId: Int): Predicate<View>
Link copied to clipboard
open fun hasVisibleMatchingText(text: String): Predicate<View>
Link copied to clipboard
open fun hasVisibleText(text: String): Predicate<View>
Link copied to clipboard
open fun hasVisibleTextWithTag(text: String, tagId: Int, tagValue: Any): Predicate<View>
Link copied to clipboard
open fun isClass(clazz: Class<out View>): Predicate<View>
Link copied to clipboard
open fun isVisible(): Predicate<View>
Link copied to clipboard
open fun matchesText(text: String): Predicate<View>