Selector

@Serializable
sealed interface Selector

Represents a query used to locate a specific node in the Compose Multiplatform UI tree.

Inheritors

Types

Link copied to clipboard
@Serializable
@SerialName(value = "auto")
data class Auto(val raw: String, val index: Int? = null) : Selector

Smart selector that attempts to match by Modifier.testTag first, and falls back to matching by visible text substrings.

Link copied to clipboard
@Serializable
@SerialName(value = "tag")
data class Tag(val value: String, val index: Int? = null) : Selector

Strict selector that only matches nodes with the exact Modifier.testTag specified.

Link copied to clipboard
@Serializable
@SerialName(value = "text")
data class Text(val value: String, val index: Int? = null) : Selector

Selector that matches nodes containing the specified visible value.

Properties

Link copied to clipboard
abstract val index: Int?

Optional index to pick a specific node if multiple match the query.

Link copied to clipboard
abstract val raw: String

The raw query string.

Functions

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun Selector.resolveNode(nodes: List<NodeSnapshot>, requireVisible: Boolean = true): ResolvedSelector