public ProtoExecutionResult ExecuteStep(GaugeMethod method, params string[] args) { var stopwatch = Stopwatch.StartNew(); var builder = new ProtoExecutionResult { Failed = false }; var executionResult = _stepExecutor.Execute(method, args); builder.ExecutionTime = stopwatch.ElapsedMilliseconds; if (executionResult.Success) { return(builder); } var elapsedMilliseconds = stopwatch.ElapsedMilliseconds; builder.Failed = true; var isScreenShotEnabled = Utils.TryReadEnvValue("SCREENSHOT_ON_FAILURE"); if (isScreenShotEnabled == null || isScreenShotEnabled.ToLower() != "false") { builder.ScreenShot = TakeScreenshot(); } builder.ErrorMessage = executionResult.ExceptionMessage; builder.StackTrace = executionResult.StackTrace; builder.RecoverableError = executionResult.Recoverable; builder.ExecutionTime = elapsedMilliseconds; return(builder); }
public ProtoExecutionResult ExecuteStep(GaugeMethod method, params string[] args) { var stopwatch = Stopwatch.StartNew(); var executionResult = _stepExecutor.Execute(method, args); return(BuildResult(stopwatch, executionResult)); }
public Workflow <TRequest, TStepOrdinal> InvokeStep( Action <TRequest> stepFunc, TStepOrdinal stepOrdinal, IErrorHandler <TRequest, TStepOrdinal> customErrorHandler = null, IInterceptor <TRequest, TStepOrdinal> customInterceptor = null) { if (!_request.Continue(stepOrdinal)) { return(this); } _executor.Execute( Wrap <bool>(stepFunc, stepOrdinal, customInterceptor ?? _defaultInterceptor), WrapHandler(stepOrdinal, customErrorHandler ?? _defaultErrorHandler)); return(this); }