selectWhere method

UITestChainNode<U, List<Element>, T> selectWhere(
  1. String? selectors,
  2. bool test(
    1. Element element
    ), {
  3. bool expected = false,
})

Alias to querySelectorAll + where.

Implementation

UITestChainNode<U, List<Element>, T> selectWhere(
  String? selectors,
  bool Function(Element element) test, {
  bool expected = false,
}) {
  var sel = querySelectorAllNonTyped(selectors);
  var elems = sel.element.where(test).toList();

  if (expected) {
    expect(
      elems.isNotEmpty,
      isTrue,
      reason: "Can't find selected elements: $selectors",
    );
  }

  return UITestChainNode(testChainRoot, elems, this as T);
}