예제 #1
0
        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);
        }
예제 #2
0
        public ProtoExecutionResult ExecuteStep(GaugeMethod method, params string[] args)
        {
            var stopwatch = Stopwatch.StartNew();

            var executionResult = _stepExecutor.Execute(method, args);

            return(BuildResult(stopwatch, executionResult));
        }
예제 #3
0
파일: Workflow.cs 프로젝트: 1g0r/mWF
        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);
        }