expectElement method

T expectElement(
  1. String selectors, {
  2. Object? root,
  3. String? reason,
  4. List<Element> mapper(
    1. List<Element> elems
    )?,
  5. bool validator(
    1. List<Element> elems
    )?,
})

Implementation

T expectElement(String selectors,
    {Object? root,
    String? reason,
    List<Element> Function(List<Element> elems)? mapper,
    bool Function(List<Element> elems)? validator}) {
  root ??= element;
  expect(_existsElement(root, selectors, mapper, validator), isTrue,
      reason: reason ?? "Can't find element: `$selectors` >> root: $root");
  return this as T;
}