describeCapabilities method

  1. @override
Future<CockpitCapabilities> describeCapabilities()
override

Implementation

@override
Future<CockpitCapabilities> describeCapabilities() async {
  final supportedCommands = <CockpitCommandType>{
    CockpitCommandType.tap,
    CockpitCommandType.enterText,
    CockpitCommandType.focusTextInput,
    CockpitCommandType.setTextEditingValue,
    CockpitCommandType.sendTextInputAction,
    CockpitCommandType.sendKeyEvent,
    CockpitCommandType.sendKeyDownEvent,
    CockpitCommandType.sendKeyUpEvent,
    if (_semanticPlaneResolvable) ...<CockpitCommandType>{
      CockpitCommandType.showOnScreen,
      CockpitCommandType.increase,
      CockpitCommandType.decrease,
      CockpitCommandType.dismiss,
    },
    CockpitCommandType.dismissKeyboard,
    CockpitCommandType.longPress,
    CockpitCommandType.doubleTap,
    if (_gestureHandler != null) ...<CockpitCommandType>{
      CockpitCommandType.drag,
      CockpitCommandType.fling,
      CockpitCommandType.swipe,
      CockpitCommandType.pinchZoom,
      CockpitCommandType.rotate,
      CockpitCommandType.panZoom,
      CockpitCommandType.multiTouch,
    },
    if (_scrollStepHandler != null) CockpitCommandType.scrollUntilVisible,
    if (_clearNetworkActivityHandler != null)
      CockpitCommandType.clearNetworkActivity,
    if (_waitForNetworkIdleHandler != null)
      CockpitCommandType.waitForNetworkIdle,
    CockpitCommandType.waitForUiIdle,
    if (_backNavigationHandler != null) CockpitCommandType.back,
    CockpitCommandType.assertVisible,
    CockpitCommandType.assertText,
    CockpitCommandType.waitFor,
    CockpitCommandType.collectSnapshot,
    if (_captureHandler != null) CockpitCommandType.captureScreenshot,
  };

  return CockpitCapabilities(
    platform: _platform,
    transportType: _transportType,
    supportsInAppControl: true,
    supportsFlutterViewCapture: _captureHandler != null,
    supportsNativeScreenCapture: false,
    supportsHostAutomation: false,
    supportedCommands: supportedCommands.toList(growable: false),
    supportedLocatorStrategies: CockpitLocatorKind.values,
  );
}