예제 #1
0
        // For BPT test only
        private static testsuiteTestcase[] ConvertTestcases(ReportNodeEnumerator <XmlReport.BPT.BusinessComponentReport> bcs, out int count, out int numOfFailures)
        {
            count         = 0;
            numOfFailures = 0;

            List <testsuiteTestcase> list = new List <testsuiteTestcase>();

            if (bcs != null)
            {
                EnumerableReportNodes <XmlReport.BPT.BusinessComponentReport> bcReports = new EnumerableReportNodes <XmlReport.BPT.BusinessComponentReport>(bcs);
                foreach (XmlReport.BPT.BusinessComponentReport bc in bcReports)
                {
                    if (bc.AllBCStepsEnumerator != null)
                    {
                        EnumerableReportNodes <XmlReport.BPT.BCStepReport> steps = new EnumerableReportNodes <XmlReport.BPT.BCStepReport>(bc.AllBCStepsEnumerator);
                        foreach (XmlReport.BPT.BCStepReport step in steps)
                        {
                            if (step.IsContext)
                            {
                                continue;
                            }

                            testsuiteTestcase tc = BPTReportConverter.ConvertTestcase(step, count);
                            if (tc == null)
                            {
                                continue;
                            }

                            // update step name with the hierarchy full name
                            tc.name = string.Format("#{0,7:0000000}: {1}", count + 1, GetHierarchyFullName(step, bc));

                            list.Add(tc);
                            if (step.Status == ReportStatus.Failed)
                            {
                                numOfFailures++;
                            }
                            count++;
                        }
                    }
                }
            }

            return(list.ToArray());
        }
예제 #2
0
        public static bool ConvertAndSave(CommandArguments args, TestReportBase input)
        {
            ConverterBase conv = null;

            // try to test if the input report is a GUI/API/BPT test report
            GUITestReport guiReport = input as GUITestReport;
            APITestReport apiReport = input as APITestReport;
            BPTReport     bptReport = input as BPTReport;

            if (guiReport != null)
            {
                conv = new GUITestReportConverter(args, guiReport);
            }
            else if (apiReport != null)
            {
                conv = new APITestReportConverter(args, apiReport);
            }
            else if (bptReport != null)
            {
                conv = new BPTReportConverter(args, bptReport);
            }
            else
            {
                return(false);
            }

            if (!conv.Convert())
            {
                return(false);
            }

            if (!conv.SaveFile())
            {
                return(false);
            }

            return(true);
        }
예제 #3
0
 // For BPT test only
 private static string GetHierarchyFullName(XmlReport.BPT.BCStepReport stepReport, XmlReport.BPT.BusinessComponentReport bc, string split = " / ")
 {
     return(BPTReportConverter.GetBCHierarchyName(bc) + split + stepReport.Name);
 }