Package-level declarations

Types

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Allows traversing through all the Component that define a hierarchy in a given LithoView.

Link copied to clipboard
class SelectionResult(val nodes: List<TestNode>, selectionError: String? = null)
Link copied to clipboard
interface TestContext
Link copied to clipboard
class TestNode(component: Component)

A test node is used to hold all the information needed to represent a given component in the testing tree. This information is be used by testing actions (filter, interaction, assertion) and also to represent them in a visual way (e.g String representation).

Link copied to clipboard

Lazy representation of a collection of test nodes with necessary logic to materialize on-demand.

Link copied to clipboard
class TestNodeMatcher(val description: String, predicate: (TestNode) -> Boolean)

This abstraction allows you to represent any given predicate on a TestNode. This is the base to the mechanism that allows filtering test nodes to perform assertions or the matchers used in the assertions.

Link copied to clipboard
class TestNodeSelection(testContext: TestContext, selector: TestNodeSelector)

Lazy representation of a single test node with necessary logic to materialize on-demand.

Link copied to clipboard

This is the entry point through which nodes are discovered for testing.

Link copied to clipboard
class TestNodeSelector(val description: String, parentSelector: TestNodeSelector? = null, throwOnSelectionError: Boolean = false, selector: TestNodeSelector.(List<TestNode>) -> SelectionResult)

Transforms a given set of nodes into a new list of TestNode.

Link copied to clipboard

Functions

Link copied to clipboard

Returns a TestNodeMatcher that will match TestNodes which have an ancestor that match with the given matcher.

Link copied to clipboard

Generic purpose test node filters based on the attributes system. This filter will match all TestNode whose Component has set value for the attribute with key key

Link copied to clipboard

Returns a TestNodeMatcher that will match TestNodes which have one child that matches with the given matcher.

Link copied to clipboard

Returns a TestNodeMatcher that verifies if the given node has a content description which is an exact match with description.

Link copied to clipboard

Returns a TestNodeMatcher that will match TestNodes which have one descendant that matches the given matcher.

Link copied to clipboard

Returns a TestNodeMatcher that verifies if a TestNode has a parent TestNode that matches the given matcher.

Link copied to clipboard
Link copied to clipboard

Returns a TestNodeMatcher that verifies if the given node text matches the exact text

Link copied to clipboard

Returns a TestNodeMatcher that verifies if the given node contains the given text

Link copied to clipboard
inline fun <T> hasType(): TestNodeMatcher

This filter will match all test nodes that represent a Component with the given class type componentClass.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Returns a TestNodeMatcher that verifies if a TestNode is the root of a component tree.

Link copied to clipboard

Dispatches a click event for the node represented in the given selection.

Link copied to clipboard
fun TestNodeCollectionSelection.printTo(appendable: Appendable, maxDepth: Int = 0)

Prints all the matching nodes in the collection into the given appendable.

fun TestNodeSelection.printTo(appendable: Appendable, maxDepth: Int = Int.MAX_VALUE)

Prints all the available node information into the given appendable.

Link copied to clipboard

Prints all the matching nodes in the collection into a string.

fun TestNodeSelection.printToString(maxDepth: Int = Int.MAX_VALUE): String

Prints all the available node information into a string.