TestRenderResult

Result of rendering a component for testing.

Properties

hashCode → int
The hash code for this object.
no setterinherited

root → TestNode

The root node of the render tree
no setter

runtimeType → Type

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

textContent → String

Get text content of entire tree
no setter

Methods

debug() → void
Debug print the tree

findByProp(String name, 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 type) → List<TestNode>

Find nodes by component type.

getByTestId(String testId) → TestNode

Get a single node by testID

getByText(String text, {bool exact = false}) → TestNode

Get a single node by text

getByType(String type) → TestNode

Get a single node by type

noSuchMethod(Invocation invocation) → dynamic

Invoked when a nonexistent method or property is accessed.
inherited

queryByTestId(String testId) → TestNode?

Query by testID (returns null if not found) instead of throwing.

queryByText(String text, {bool exact = false}) → TestNode?

Query by text (returns null if not found) instead of throwing.

queryByType(String type) → TestNode?

Query by type (returns null if not found) instead of throwing.

toString() → String

A string representation of this object.
inherited

waitForText(String text, {bool exact = false, Duration timeout = const Duration(seconds: 1)}) → Future<TestNode>

Wait for text to appear

Operators

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

Static Methods

create(TestNode root) → TestRenderResult
Creates a TestRenderResult for testing purposes.