public static AccountReportAction MapActionEndData(GingerCore.Actions.Act action, Context context) { AccountReportAction accountReportAction = new AccountReportAction(); List <string> newScreenShotsList = new List <string>(); accountReportAction.Id = action.ExecutionId; accountReportAction.EntityId = action.Guid; accountReportAction.AccountReportDbActivityId = action.ParentExecutionId; accountReportAction.ExecutionId = (Guid)WorkSpace.Instance.RunsetExecutor.RunSetConfig.ExecutionID; accountReportAction.Name = action.Description; accountReportAction.EndTimeStamp = action.EndTimeStamp; accountReportAction.ElapsedEndTimeStamp = action.Elapsed; accountReportAction.RunStatus = action.Status.ToString(); accountReportAction.OutputValues = action.ReturnValues.Select(a => a.Param + "_:_" + a.Actual + "_:_" + a.ExpectedCalculated + "_:_" + a.Status).ToList(); accountReportAction.FlowControls = action.FlowControls.Select(a => a.Condition + "_:_" + a.ConditionCalculated + "_:_" + a.FlowControlAction + "_:_" + a.Status).ToList(); accountReportAction.Error = action.Error; accountReportAction.ExInfo = action.ExInfo; foreach (string screenshot in action.ScreenShots) { string newScreenshotPath = WorkSpace.Instance.RunsetExecutor.RunSetConfig.ExecutionID.ToString() + "/" + Path.GetFileName(screenshot); newScreenShotsList.Add(newScreenshotPath); } accountReportAction.ScreenShots = newScreenShotsList; return(accountReportAction); }
public static AccountReportAction MapActionStartData(GingerCore.Actions.Act action, Context context) { action.ExecutionId = Guid.NewGuid(); // check incase of retry / flow control AccountReportAction accountReportAction = new AccountReportAction(); if (context.BusinessFlow.CurrentActivity != null) { accountReportAction.Seq = context.BusinessFlow.CurrentActivity.ExecutionLogActionCounter; action.ParentExecutionId = context.BusinessFlow.CurrentActivity.ExecutionId; } else { accountReportAction.Seq = 1; } accountReportAction.Id = action.ExecutionId; accountReportAction.EntityId = action.Guid; accountReportAction.AccountReportDbActivityId = action.ParentExecutionId; accountReportAction.ExecutionId = (Guid)WorkSpace.Instance.RunsetExecutor.RunSetConfig.ExecutionID; accountReportAction.Name = action.Description; accountReportAction.ActionType = action.ActionType; accountReportAction.Description = action.Description; accountReportAction.RunDescription = GetCalculatedValue(context, action.RunDescription); //must pass also BF to VE accountReportAction.Environment = ((GingerExecutionEngine)context.Runner).GingerRunner.ProjEnvironment.Name; accountReportAction.EnvironmentId = ((GingerExecutionEngine)context.Runner).GingerRunner.ProjEnvironment.Guid; accountReportAction.StartTimeStamp = action.StartTimeStamp; accountReportAction.InputValues = GetInputValues(action); accountReportAction.CurrentRetryIteration = action.RetryMechanismCount; accountReportAction.Wait = Convert.ToInt32(action.Wait); accountReportAction.TimeOut = action.Timeout; accountReportAction.RunStatus = _InProgressStatus; return(accountReportAction); }
public ActionReport(GingerCore.Actions.Act Act, GingerCore.Environments.ProjEnvironment environment = null) { this.mAction = Act; this.mExecutionEnviroment = environment; }