getByText method

BloomNode getByText(
  1. String text
)

Finds the first node whose direct text content equals text.

Matches both TextNode leaf nodes and ElNode elements utilizing the text parameter. Throws StateError if no matching node is found.

Implementation

BloomNode getByText(String text) {
  final found = queryByText(text);
  if (found == null) {
    throw StateError('BloomTest: No element found with text "$text".');
  }
  return found;
}