コード例 #1
0
        private Amdocs.Ginger.CoreNET.Execution.eRunStatus getGroupActivityStatus(List <Activity> activityList, ref long?elapsed, ref DateTime startedAt, ref DateTime finishedAt)
        {
            Amdocs.Ginger.CoreNET.Execution.eRunStatus status = Amdocs.Ginger.CoreNET.Execution.eRunStatus.Skipped;

            //if there is one fail then Activity status is fail
            if (activityList.Where(x => x.Status == Amdocs.Ginger.CoreNET.Execution.eRunStatus.Failed).FirstOrDefault() != null)
            {
                status = Amdocs.Ginger.CoreNET.Execution.eRunStatus.Failed;
            }
            else
            {
                // If we have at least 1 pass then it passed, otherwise will remain Skipped
                if (activityList.Where(x => x.Status == Amdocs.Ginger.CoreNET.Execution.eRunStatus.Passed).FirstOrDefault() != null)
                {
                    status = Amdocs.Ginger.CoreNET.Execution.eRunStatus.Passed;
                }
            }

            foreach (var item in activityList)
            {
                elapsed += item.Elapsed;
            }
            startedAt  = activityList.Select(x => x.StartTimeStamp).FirstOrDefault();
            finishedAt = activityList.Select(x => x.EndTimeStamp).LastOrDefault();

            return(status);
        }
コード例 #2
0
        public static SolidColorBrush GetStatusBrush(Amdocs.Ginger.CoreNET.Execution.eRunStatus status)
        {
            if (status == Amdocs.Ginger.CoreNET.Execution.eRunStatus.Passed)
            {
                return(App.Current.TryFindResource("$PassedStatusColor") as SolidColorBrush);
            }
            if (status == Amdocs.Ginger.CoreNET.Execution.eRunStatus.Failed)
            {
                return(App.Current.TryFindResource("$FailedStatusColor") as SolidColorBrush);
            }
            if (status == Amdocs.Ginger.CoreNET.Execution.eRunStatus.Blocked)
            {
                return(App.Current.TryFindResource("$BlockedStatusColor") as SolidColorBrush);
            }
            if (status == Amdocs.Ginger.CoreNET.Execution.eRunStatus.Stopped)
            {
                return(App.Current.TryFindResource("$StoppedStatusColor") as SolidColorBrush);
            }
            if (status == Amdocs.Ginger.CoreNET.Execution.eRunStatus.Skipped)
            {
                return(App.Current.TryFindResource("$SkippedStatusColor") as SolidColorBrush);
            }

            return(System.Windows.Media.Brushes.Black);
        }
コード例 #3
0
        public int TotalActionsCountByStatus(Amdocs.Ginger.CoreNET.Execution.eRunStatus Status)
        {
            //TODO: fix me to use the same enum on Act add GetAct on ActivityReport
            string sStatus = Status.ToString();
            int    count   = AllActionsForReport.Where(act => act.Status == sStatus).Count();

            return(count);
        }
コード例 #4
0
        public string GetRunSetLastExecutionLogFolderOffline()
        {
            if (WorkSpace.Instance.RunsetExecutor.RunSetConfig.LastRunsetLoggerFolder != null)
            {
                return(WorkSpace.Instance.RunsetExecutor.RunSetConfig.LastRunsetLoggerFolder);
            }
            else
            {
                ExecutionLoggerConfiguration _selectedExecutionLoggerConfiguration = WorkSpace.Instance.Solution.LoggerConfigurations;

                if (!_selectedExecutionLoggerConfiguration.ExecutionLoggerConfigurationIsEnabled)
                {
                    //TODO   AppReporter.ToUser(eUserMsgKey.ExecutionsResultsProdIsNotOn);
                    return(string.Empty);
                }

                string exec_folder = folderNameNormalazing(WorkSpace.Instance.RunsetExecutor.RunSetConfig.Name) + "_" + DateTime.Now.ToString("MMddyyyy_HHmmssfff");
                exec_folder = executionLoggerHelper.GetLoggerDirectory(Path.Combine(_selectedExecutionLoggerConfiguration.CalculatedLoggerFolder, exec_folder));
                WorkSpace.Instance.RunsetExecutor.RunSetConfig.LastRunsetLoggerFolder = exec_folder;
                int RunnerCount = 1;
                RunSetStart(exec_folder, _selectedExecutionLoggerConfiguration.ExecutionLoggerConfigurationMaximalFolderSize, CurrentExecutionDateTime, true);

                foreach (GingerRunner gingerrunner in WorkSpace.Instance.RunsetExecutor.RunSetConfig.GingerRunners)
                {
                    string folder = Path.Combine(exec_folder, RunnerCount.ToString() + " " + gingerrunner.Name);
                    if (System.IO.Directory.Exists(folder))
                    {
                        executionLoggerHelper.CleanDirectory(folder);
                    }
                    else
                    {
                        System.IO.Directory.CreateDirectory(folder);
                    }

                    mContext = gingerrunner.Context;
                    Amdocs.Ginger.CoreNET.Execution.eRunStatus gingerRunnerStatus = gingerrunner.RunsetStatus;
                    if (gingerRunnerStatus != Amdocs.Ginger.CoreNET.Execution.eRunStatus.Passed && gingerRunnerStatus != Amdocs.Ginger.CoreNET.Execution.eRunStatus.Failed && gingerRunnerStatus != Amdocs.Ginger.CoreNET.Execution.eRunStatus.Stopped)
                    {
                        continue;
                    }

                    Configuration.ExecutionLoggerConfigurationIsEnabled = true;
                    mExecutionLogger.ExecutionLogfolder = folder;
                    gingerReport = new GingerReport();
                    RunnerRunStart(0, gingerrunner, true);
                    OfflineRunnerExecutionLog(gingerrunner, folder, RunnerCount);
                    RunnerCount++;
                }
                RunSetEnd(exec_folder, true);
                return(exec_folder);
            }
        }
コード例 #5
0
ファイル: RunSetReport.cs プロジェクト: lanicon/Ginger
 public void SetLiteDBData(LiteDbRunSet runSet)
 {
     GUID           = runSet._id.ToString();
     Name           = runSet.Name;
     Description    = runSet.Description;
     StartTimeStamp = runSet.StartTimeStamp;
     EndTimeStamp   = runSet.EndTimeStamp;
     Elapsed        = runSet.Elapsed;
     Amdocs.Ginger.CoreNET.Execution.eRunStatus myStatus;
     if (Enum.TryParse(runSet.RunStatus, out myStatus))
     {
         RunSetExecutionStatus = myStatus;
     }
 }
コード例 #6
0
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            eImageType ico = eImageType.Pending;//default icon

            if (value != null && value.GetType() == typeof(Amdocs.Ginger.CoreNET.Execution.eRunStatus))
            {
                Amdocs.Ginger.CoreNET.Execution.eRunStatus status = (Amdocs.Ginger.CoreNET.Execution.eRunStatus)value;
                switch (status)
                {
                case Amdocs.Ginger.CoreNET.Execution.eRunStatus.Passed:
                    ico = eImageType.Passed;
                    break;

                case Amdocs.Ginger.CoreNET.Execution.eRunStatus.Failed:
                    ico = eImageType.Failed;
                    break;

                case Amdocs.Ginger.CoreNET.Execution.eRunStatus.Running:
                    ico = eImageType.Running;
                    break;

                case Amdocs.Ginger.CoreNET.Execution.eRunStatus.Pending:
                    ico = eImageType.Pending;
                    break;

                case Amdocs.Ginger.CoreNET.Execution.eRunStatus.Stopped:
                    ico = eImageType.Stopped;
                    break;

                case Amdocs.Ginger.CoreNET.Execution.eRunStatus.Blocked:
                    ico = eImageType.Blocked;
                    break;

                case Amdocs.Ginger.CoreNET.Execution.eRunStatus.Skipped:
                    ico = eImageType.Skipped;
                    break;

                default:
                    ico = eImageType.Pending;
                    break;
                }
            }

            return(ico);
        }
コード例 #7
0
        private string CraeteGroupActivitiesStatusXml(BusinessFlow BF, ref int passCount, ref int failedCount, ref int blockedCount)
        {
            string   BFResults  = string.Empty;
            long?    elapsed    = 0;
            DateTime startedAt  = new DateTime();
            DateTime finishedAt = new DateTime();

            if (BF.ActivitiesGroups.Count > 0)
            {
                BF.AttachActivitiesGroupsAndActivities();
                foreach (var item in BF.ActivitiesGroups)
                {
                    if (item.ActivitiesIdentifiers.Count > 0)
                    {
                        List <Activity> acts = item.ActivitiesIdentifiers.Select(a => a.IdentifiedActivity).ToList();
                        Amdocs.Ginger.CoreNET.Execution.eRunStatus status = getGroupActivityStatus(acts, ref elapsed, ref startedAt, ref finishedAt);
                        BFResults += buildXml(status, ref passCount, ref failedCount, ref blockedCount, General.ConvertInvalidXMLCharacters(BF.Name), General.ConvertInvalidXMLCharacters(item.Name), General.ConvertInvalidXMLCharacters(item.Description), elapsed, startedAt, finishedAt);
                    }
                }

                //create ungrouped for activities that are not in any group
                List <Activity> unGroupedAct = new List <Activity>();
                foreach (var item in BF.Activities)
                {
                    if (item.ActivitiesGroupID == string.Empty)
                    {
                        unGroupedAct.Add(item);
                    }
                }
                if (unGroupedAct.Count > 0)
                {
                    Amdocs.Ginger.CoreNET.Execution.eRunStatus status = getGroupActivityStatus(unGroupedAct, ref elapsed, ref startedAt, ref finishedAt);
                    BFResults += buildXml(status, ref passCount, ref failedCount, ref blockedCount, General.ConvertInvalidXMLCharacters(BF.Name), "Ungrouped", "Ungrouped", elapsed, startedAt, finishedAt);
                }
            }
            else//if there are no groups create default group
            {
                Amdocs.Ginger.CoreNET.Execution.eRunStatus status = getGroupActivityStatus(BF.Activities.ToList(), ref elapsed, ref startedAt, ref finishedAt);
                BFResults += buildXml(status, ref passCount, ref failedCount, ref blockedCount, General.ConvertInvalidXMLCharacters(BF.Name), "Ungrouped", "Ungrouped", elapsed, startedAt, finishedAt);
            }

            return(BFResults);
        }