doubleTap method

Future<void> doubleTap(
  1. CompoundSelector selector, {
  2. Duration? timeout,
  3. Duration? delayBetweenTaps,
  4. String? appId,
})

Double taps on the native view specified by selector.

It waits for the view to become visible for timeout duration. If the native view is not found, an exception is thrown.

The delayBetweenTaps parameter allows you to specify the duration between consecutive taps in milliseconds. This can be useful in scenarios where the target view requires a certain delay between taps to register the action correctly, such as in cases of UI responsiveness or animations. The default delay between taps is 300 milliseconds.

Note: The delayBetweenTaps parameter is currently respected only for Android.

appId is only used on iOS, where native queries must be scoped to a single application. If not provided, defaults to the bundle id of the app under test.

Implementation

Future<void> doubleTap(
  CompoundSelector selector, {
  Duration? timeout,
  Duration? delayBetweenTaps,
  String? appId,
}) {
  return platform.action.mobile(
    android: () => platform.android.doubleTap(
      selector.android,
      timeout: timeout,
      delayBetweenTaps: delayBetweenTaps,
    ),
    ios: () =>
        platform.ios.doubleTap(selector.ios, timeout: timeout, appId: appId),
    desktop: () => platform.desktop.doubleTap(
      name: selector.android.text,
      className: selector.android.className,
    ),
  );
}