getByTestId method

ElNode getByTestId(
  1. String testId
)

Finds the first ElNode in the tree whose data-testid attribute matches testId.

Throws StateError if no matching element is found.

Implementation

ElNode getByTestId(String testId) {
  final found = queryByTestId(testId);
  if (found == null) {
    throw StateError('BloomTest: No element found with data-testid="$testId".');
  }
  return found;
}