executeInput method

Future<void> executeInput(
  1. OperationInput operation, {
  2. required OperationDescriptor descriptor,
})

Executes an authored or compiled operation through the same wait route. Authored TestSteps already implement OperationInput, so this avoids a second step-specific dispatch path and keeps their evidence callbacks on the original input.

Implementation

Future<void> executeInput(
  OperationInput operation, {
  required OperationDescriptor descriptor,
}) async {
  final selected = operationRegistry.lookup(operation.operationName);
  if (selected != descriptor || descriptor.kind != OperationKind.wait) {
    throw ArgumentError.value(
      operation,
      'operation',
      'Wait input does not match its selected registry descriptor.',
    );
  }
  final handler = _waitHandlers[descriptor.handlerKey];
  if (handler == null) {
    throw StateError(
      'No registered wait handler for operation "${descriptor.name}" '
      '(${descriptor.handlerKey}).',
    );
  }
  await handler(operation);
}