endStep method

void endStep(
  1. TestStep step, [
  2. String? error
])

Ends the given step with the optional error. If the error is null then the step is considered successful. If there is an error value then the step is considered a failure.

Implementation

void endStep(
  TestStep step, [
  String? error,
]) {
  if (_pendingSteps.contains(step)) {
    _pendingSteps.remove(step);
    var reportStep = _steps[step];
    if (reportStep != null) {
      reportStep = reportStep.copyWith(
        endTime: DateTime.now(),
        error: error,
      );
      _steps[step] = reportStep;

      _stepStreamController?.add(reportStep);
    }
  }
}