selectUntil<O extends Element> method

Future<UITestChainNode<U, O, T>> selectUntil<O extends Element>(
  1. String? selectors, {
  2. int? timeoutMs,
  3. int? intervalMs,
  4. int? minMs,
  5. Iterable<Element> mapper(
    1. List<Element> elems
    )?,
})

Implementation

Future<UITestChainNode<U, O, T>> selectUntil<O extends Element>(
        String? selectors,
        {int? timeoutMs,
        int? intervalMs,
        int? minMs,
        Iterable<Element> Function(List<Element> elems)? mapper}) =>
    sleepUntilElement(selectors ?? '*',
            timeoutMs: timeoutMs,
            intervalMs: intervalMs,
            minMs: minMs,
            mapper: mapper)
        .selectExpected(selectors)
        .then((o) {
      var elem = o.element;
      if (elem is! O) {
        expect(elem, pkg_test.isA<O>(),
            reason: "Selected element not of type `$O`: $elem");
      }

      return UITestChainNode<U, O, T>(
          o.testChainRoot as UITestChainRoot<U>, elem as O, this as T);
    });