LithoViewAssert

class LithoViewAssert : AbstractAssert<LithoViewAssert, LithoView>

Assertion methods for LithoViews.

To create an instance of this class, invoke [LithoViewAssert.assertThat].

Alternatively, use LegacyLithoAssertions which provides entry points to all Litho AssertJ helpers.

Types

Link copied to clipboard
object Companion
Link copied to clipboard

Properties

Link copied to clipboard
var info: WritableAssertionInfo

Functions

Link copied to clipboard
open fun actual(): LithoView
Link copied to clipboard
open fun as(descriptionSupplier: Supplier<String>): LithoViewAssert
open fun as(description: Description): LithoViewAssert
open fun as(description: String, vararg args: Any): LithoViewAssert
Link copied to clipboard
open override fun <ASSERT : AbstractAssert<*, *>> asInstanceOf(instanceOfAssertFactory: InstanceOfAssertFactory<*, ASSERT>): ASSERT
Link copied to clipboard
open override fun asList(): AbstractListAssert<*, MutableList<*>, Any, ObjectAssert<Any>>
Link copied to clipboard
open override fun asString(): AbstractStringAssert<*>
Link copied to clipboard

Assert that the LithoView under test has the provided Component classes in the Component Tree hierarchy

Link copied to clipboard

Assert that the LithoView has a direct component of type clazz

Link copied to clipboard

Assert that the LithoView under test has the provided Component class in the Component Tree hierarchy given number of times

Link copied to clipboard

Assert that the LithoView under test has the provided Component class once in the Component Tree hierarchy.

Link copied to clipboard
Link copied to clipboard
open override fun describedAs(description: Description): LithoViewAssert
open fun describedAs(descriptionSupplier: Supplier<String>): LithoViewAssert
open fun describedAs(description: String, vararg args: Any): LithoViewAssert
Link copied to clipboard
Link copied to clipboard

Assert that the LithoView under test does not contain the provided Component classes in the Component Tree hierarchy

Link copied to clipboard

Assert that the LithoView does not have a direct component of type clazz

Link copied to clipboard
Link copied to clipboard
open override fun doesNotHave(condition: Condition<in LithoView>): LithoViewAssert
Link copied to clipboard
fun <T1, T2> doesNotHaveMatchingComponent(kClass: KClass<out Component>, vararg propsValuePairs: Pair<KProperty1<T2, T1>, T1>): LithoViewAssert

Asserts that the LithoView does not contain a Component with given props at any level of the hierarchy. This function uses DFS algorithm to go through the whole component tree

Link copied to clipboard
open override fun doesNotHaveSameClassAs(other: Any): LithoViewAssert
Link copied to clipboard
open override fun doesNotHaveSameHashCodeAs(other: Any): LithoViewAssert
Link copied to clipboard
open override fun doesNotHaveToString(otherToString: String): LithoViewAssert
open override fun doesNotHaveToString(expectedStringTemplate: String, vararg args: Any): LithoViewAssert
Link copied to clipboard

Inverse of .hasVisibleDrawable

Link copied to clipboard

Inverse of .hasVisibleText

Link copied to clipboard

Inverse of .hasVisibleTextContaining.

Link copied to clipboard

Inverse of .hasVisibleTextMatching.

Link copied to clipboard
open fun doesNotMatch(predicate: Predicate<in LithoView>, predicateDescription: String): LithoViewAssert
Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open fun getWritableAssertionInfo(): WritableAssertionInfo
Link copied to clipboard
open override fun has(condition: Condition<in LithoView>): LithoViewAssert
Link copied to clipboard

Assert that any view in the given Component has the provided accessibility role.

Link copied to clipboard

Asserts that the LithoView contains a Component satisfying the given condition at any level of the hierarchy

fun <T1, T2> hasAnyMatchingComponent(kClass: KClass<out Component>, vararg propsValuePairs: Pair<KProperty1<T2, T1>, T1>): LithoViewAssert

Asserts that the LithoView contains a Component with given props at any level of the hierarchy. This function uses DFS algorithm to go through the whole component tree

Link copied to clipboard
fun <T2, T1> hasAnyMatchingComponentWithMatcher(kClass: KClass<out Component>, vararg propsMatcherPairs: Pair<KProperty1<T2, T1>, Matcher<T1>>): LithoViewAssert

Asserts that the LithoView contains a Component with props that matches given matcher at any level of the hierarchy

Link copied to clipboard
fun hasContentDescription(contentDescription: String): LithoViewAssert

Assert that any view in the given Component has the provided content description.

Link copied to clipboard

Asserts that the LithoView will render Component as a direct children of the root satisfying the given condition.

fun <T1, T2> hasDirectMatchingComponent(kClass: KClass<out Component>, vararg propsValuePairs: Pair<KProperty1<T2, T1>, T1>): LithoViewAssert

Asserts that the LithoView contains a direct Component with given props

Link copied to clipboard
fun <T2, T1> hasDirectMatchingComponentWithMatcher(kClass: KClass<out Component>, vararg propsMatcherPairs: Pair<KProperty1<T2, T1>, Matcher<T1>>): LithoViewAssert

Asserts that the LithoView contains a Component with props that matches given matcher at any level of the hierarchy

Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard

Assert that the LithoView under test has the provided measured height.

Link copied to clipboard

Assert that the LithoView under test has the provided measured width.

Link copied to clipboard

Assert that any view in the given Component do not have the provided content description.

Link copied to clipboard
open override fun hasSameClassAs(other: Any): LithoViewAssert
Link copied to clipboard
open override fun hasSameHashCodeAs(other: Any): LithoViewAssert
Link copied to clipboard
open override fun hasToString(expectedToString: String): LithoViewAssert
open override fun hasToString(expectedStringTemplate: String, vararg args: Any): LithoViewAssert
Link copied to clipboard
fun hasViewTag(tagId: Int, tagValue: Any): LithoViewAssert

Assert that the view tag is present for the given index.

Link copied to clipboard

Assert that the given component contains the drawable provided.

Assert that the given component contains the drawable identified by the provided drawable resource id.

Link copied to clipboard

Assert that the given component has the exact text identified by resource id.

Assert that the given component has the exact text provided.

Link copied to clipboard

Assert that the given component contains the provided text. Useful if checking portion of text that may be appended with other text in a span.

Link copied to clipboard

Assert that the given component contains the provided pattern.

Link copied to clipboard
open override fun is(condition: Condition<in LithoView>): LithoViewAssert
Link copied to clipboard
open override fun isEqualTo(expected: Any): LithoViewAssert
Link copied to clipboard
open override fun isExactlyInstanceOf(type: Class<*>): LithoViewAssert
Link copied to clipboard
open override fun isIn(vararg values: Any): LithoViewAssert
open override fun isIn(values: MutableIterable<*>): LithoViewAssert
Link copied to clipboard
open override fun isInstanceOf(type: Class<*>): LithoViewAssert
Link copied to clipboard
open override fun isInstanceOfAny(vararg types: Class<*>): LithoViewAssert
Link copied to clipboard
open override fun <T : Any> isInstanceOfSatisfying(type: Class<T>, requirements: Consumer<T>): LithoViewAssert
Link copied to clipboard
open override fun isNot(condition: Condition<in LithoView>): LithoViewAssert
Link copied to clipboard
open override fun isNotEqualTo(other: Any): LithoViewAssert
Link copied to clipboard
open override fun isNotExactlyInstanceOf(type: Class<*>): LithoViewAssert
Link copied to clipboard
open override fun isNotIn(vararg values: Any): LithoViewAssert
open override fun isNotIn(values: MutableIterable<*>): LithoViewAssert
Link copied to clipboard
open override fun isNotInstanceOf(type: Class<*>): LithoViewAssert
Link copied to clipboard
open override fun isNotInstanceOfAny(vararg types: Class<*>): LithoViewAssert
Link copied to clipboard
open override fun isNotNull(): LithoViewAssert
Link copied to clipboard
open override fun isNotOfAnyClassIn(vararg types: Class<*>): LithoViewAssert
Link copied to clipboard
open override fun isNotSameAs(other: Any): LithoViewAssert
Link copied to clipboard
open override fun isNull()
Link copied to clipboard
open override fun isOfAnyClassIn(vararg types: Class<*>): LithoViewAssert
Link copied to clipboard
open override fun isSameAs(expected: Any): LithoViewAssert
Link copied to clipboard
open fun matches(predicate: Predicate<in LithoView>): LithoViewAssert
open fun matches(predicate: Predicate<in LithoView>, predicateDescription: String): LithoViewAssert
Link copied to clipboard
open fun overridingErrorMessage(newErrorMessage: String, vararg args: Any): LithoViewAssert
Link copied to clipboard
fun satisfies(vararg requirements: Consumer<in LithoView>): LithoViewAssert
fun satisfies(vararg assertions: ThrowingConsumer<in LithoView>): LithoViewAssert
open override fun satisfies(condition: Condition<in LithoView>): LithoViewAssert
Link copied to clipboard
fun satisfiesAnyOf(vararg assertions: ThrowingConsumer<in LithoView>): LithoViewAssert
Link copied to clipboard
open override fun usingComparator(customComparator: Comparator<in LithoView>): LithoViewAssert
open override fun usingComparator(customComparator: Comparator<in LithoView>, customComparatorDescription: String): LithoViewAssert
Link copied to clipboard
Link copied to clipboard
open override fun usingEquals(predicate: BiPredicate<in LithoView, in LithoView>): LithoViewAssert
open override fun usingEquals(predicate: BiPredicate<in LithoView, in LithoView>, customEqualsDescription: String): LithoViewAssert
Link copied to clipboard

Assert that the LithoView will not render content, the root component will either return null or a child with width and height equal to 0

Link copied to clipboard

Assert that the LithoView will render content, the root component won't return null nor a child with height and width equal to 0

Link copied to clipboard
open fun withFailMessage(newErrorMessage: String, vararg args: Any): LithoViewAssert
Link copied to clipboard
open override fun withRepresentation(representation: Representation): LithoViewAssert
Link copied to clipboard