longPressFinder method

Future<void> longPressFinder(
  1. Finder finder, {
  2. TestStep? step,
  3. Future<void> onBeforeLongPress()?,
})

Implementation

Future<void> longPressFinder(
  Finder finder, {
  TestStep? step,
  Future<void> Function()? onBeforeLongPress,
}) async {
  if (finder.evaluate().isEmpty) {
    throw EnsembleTestFailure('longPressFinder: target element is detached.');
  }
  await tester.ensureVisible(finder);
  await _emitEvidenceBoundary(step);
  await onBeforeLongPress?.call();
  await tester.longPress(finder);
  await runtime.settleAfterAction();
}