start method

HarnessRun start(
  1. String identifier, [
  2. Map<String, Object?> params = const {},
  3. bool executionScope = true
])

Starts the intent identifier and returns before it finishes, so a test can HarnessRun.cancel it or watch progressReports meanwhile.

HarnessRun.executionId is null when executionScope is false.

Implementation

HarnessRun start(
  String identifier, [
  Map<String, Object?> params = const {},
  bool executionScope = true,
]) {
  final executionId = executionScope ? 'harness-${++_nextExecution}' : null;
  final violation = _paramsViolation(identifier, params);
  final result = violation != null
      ? Future<Map<String, dynamic>>.error(violation)
      : _invoke('executeIntent', {
          'identifier': identifier,
          'params': {...params, intentExecutionIdKey: ?executionId},
        }).then((value) => _stringMap(value));
  return HarnessRun._(this, executionId, result);
}