step property

  1. @override
ReportActionHandler<StepMessage> get step

Implementation

@override
ReportActionHandler<StepMessage> get step => ReportActionHandler(
      onFinished: ([message]) async {
        if (message == null) {
          logger.i(failColor('Cannot get scenario information'));
        } else {
          if (message.result == null) {
            logger.i(failColor('Cannot get result scenario information'));
          } else {
            var stepColor =
                message.result!.result == StepExecutionResult.passed
                    ? passColor
                    : failColor;
            String printMessage;
            if (message.result is ErroredStepResult) {
              var errorMessage = (message.result as ErroredStepResult);
              printMessage = failColor(
                  '${errorMessage.exception}\n${errorMessage.stackTrace}');
            } else {
              printMessage = [
                stepColor('  '),
                stepColor(_getStatePrefixIcon(message.result!.result)),
                stepColor(message.name),
                neutralColor(_getExecutionDuration(message.result!)),
                stepColor(_getReasonMessage(message.result!)),
                stepColor(_getErrorMessage(message.result!))
              ].join((' ')).trimRight();
            }
            logger.i(printMessage);
          }
        }
      },
    );