Testing
Querying the tree
Find nodes by index, label, or kind.
Each FindX method walks the tree depth-first and returns the nth node of
the matching kind. Indexing is zero-based.
Result types
Every result type has a boolean Exists() so you can assert presence.
TextResult
ButtonResult
ToggleResult
TextFieldResult
Counting nodes
NodeCount takes a string kind name and returns the total count. Accepted
kinds are "Text", "Button", "VStack", "HStack", "TextField",
"Toggle", "List", "Spacer", and "Divider".
Reading state
State(key) looks up a raw entry in the test scope by its internal string
key. This is rarely useful outside framework tests because state is
normally keyed by call site; prefer querying the visible output.