TestNode

A node in the test render tree representing a React Native component.

Properties

children → List<TestNode>
Child nodes
final

hashCode → int

The hash code for this object.
no setterinherited

placeholder → String?

Get the placeholder prop (for TextInput)
no setter

props → Map<String, Object?>

The props passed to this component
final

runtimeType → Type

A representation of the runtime type of the object.
no setterinherited

textContent → String

Get the text content of this node and all descendants
no setter

type → String

The component type (e.g., 'View', 'Text', 'TextInput')
final

value → String?

Get the value prop (for TextInput)
no setter

Methods

findAll(bool predicate(TestNode)) → List<TestNode>
Find all nodes matching a predicate

findByProp(String propName, Object? value) → List<TestNode>

Find nodes with a specific prop value

findByTestId(String testId) → List<TestNode>

Find nodes with testID prop

findByText(String text, {bool exact = false}) → List<TestNode>

Find nodes containing text

findByType(String componentType) → List<TestNode>

Find nodes by component type

fireChangeText(String text) → void

Fire onChangeText handler with value

firePress() → void

Fire onPress handler if present

fireValueChange(bool value) → void

Fire onValueChange handler with value

noSuchMethod(Invocation invocation) → dynamic

Invoked when a nonexistent method or property is accessed.
inherited

toString() → String

A string representation of this object.
override

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Methods

create({required String type, required Map<String, Object?> props, required List<TestNode> children}) → TestNode
Creates a TestNode for testing purposes.