tap method

Future<void> tap(
  1. Selector selector, {
  2. String? appId,
  3. Duration? timeout,
})

Taps on the native view specified by selector.

It waits for the view to become visible for timeout duration. If timeout is not specified, it utilizes the NativeAutomatorConfig.findTimeout duration from the configuration. If the native view is not found, an exception is thrown.

Implementation

Future<void> tap(
  Selector selector, {
  String? appId,
  Duration? timeout,
}) async {
  await _wrapRequest('tap', () async {
    await _client.tap(
      TapRequest(
        selector: selector,
        appId: appId ?? resolvedAppId,
        timeoutMillis: timeout?.inMilliseconds,
      ),
    );
  });
}