querySelector method

UITestChainNode<U, Element?, T> querySelector(
  1. String? selectors, {
  2. bool expected = false,
})

Implementation

UITestChainNode<U, Element?, T> querySelector(String? selectors,
    {bool expected = false}) {
  var e = element;

  Element? elem;
  if (e is UIComponent) {
    elem = e.querySelector(selectors);
  } else if (e is Element) {
    elem = selectors != null ? e.querySelector(selectors) : null;
  } else {
    elem = uiRoot.querySelector(selectors);
  }

  if (expected) {
    expect(elem, pkg_test.isNotNull,
        reason: "Can't find selected element: $selectors");
  }

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