// For GUI test only private static testsuiteTestcase[] ConvertTestcases(ReportNodeEnumerator <XmlReport.GUITest.StepReport> steps, out int count, out int numOfFailures) { count = 0; numOfFailures = 0; List <testsuiteTestcase> list = new List <testsuiteTestcase>(); if (steps != null) { EnumerableReportNodes <XmlReport.GUITest.StepReport> stepReports = new EnumerableReportNodes <XmlReport.GUITest.StepReport>(steps); foreach (XmlReport.GUITest.StepReport step in stepReports) { testsuiteTestcase tc = GUITestReportConverter.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)); list.Add(tc); if (step.Status == ReportStatus.Failed) { numOfFailures++; } count++; } } return(list.ToArray()); }
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); }