abort method

Future<CommandAck> abort(
  1. DeviceCommand command
)

Implementation

Future<CommandAck> abort(
  DeviceCommand command,
) async {
  var result = CommandAck(
    commandId: command.id,
    message: '[${command.type}]: unknown command type',
    success: true,
  );
  if (command is AbortTestCommand) {
    final controller = _driver.testController;
    await controller!.cancelRunningTests();

    result = CommandAck(
      commandId: command.id,
      message: '[${command.type}]: success',
      success: true,
    );
  }

  return result;
}