internal HtmlReportBuilder(DataOutputModel dataOutputModel) { _scenarios = dataOutputModel.Scenarios; _stories = _scenarios.Select(scenario => scenario.GetStoryText()).Distinct().ToList(); _testTimer = dataOutputModel.TestTimer; _warnings = dataOutputModel.Warnings; BuildChartJavascript(); CreateReportWithStories(); CreateReportWithoutStories(); }
internal HtmlReportBuilder(DataOutputModel dataOutputModel) { _scenarios = dataOutputModel.Scenarios; _stories = _scenarios.Select(scenario => scenario.GetStoryText()).Distinct().ToList(); _testTimer = dataOutputModel.TestTimer; _warnings = dataOutputModel.Warnings; CreateFlakinessReport(); CreateTestTimesComparisonReport(); CreateReportWithoutStories(); CreateReportWithStories(); }
public static void Main(string[] args) { ResultDirectory = args.FirstOrDefault(it => it.StartsWith(WriteOutput.ResultDirectoryArgumentName))?.Replace(WriteOutput.ResultDirectoryArgumentName, ""); Console.WriteLine($"Results Directory is: {ResultDirectory}"); if (ResultDirectory == null) { return; } var scenarios = GetScenarios(ResultDirectory); var testTimer = GetTestTimer(scenarios); var reportPathByStory = Path.Combine(ResultDirectory, FileNames.ReportByStory); var reportPathAllScenarios = Path.Combine(ResultDirectory, FileNames.ReportAllScenarios); var testDataJsonPath = Path.Combine(ResultDirectory, FileNames.TestDataJson); var testDataXmlPath = Path.Combine(ResultDirectory, FileNames.TestDataXml); DeleteExistingFiles(reportPathByStory, reportPathAllScenarios, testDataJsonPath, testDataXmlPath); var warnings = GetWarnings(); scenarios.AddRange(warnings.StoppedEarlyTests); var dataToOutput = new DataOutputModel { Scenarios = scenarios, TestTimer = testTimer, Warnings = warnings }; var settings = new JsonSerializerSettings { PreserveReferencesHandling = PreserveReferencesHandling.Objects }; var jsonData = JsonConvert.SerializeObject(dataToOutput, Formatting.Indented, settings); File.WriteAllText(Path.Combine(ResultDirectory, FileNames.TestDataJson), jsonData); File.WriteAllText(Path.Combine(ResultDirectory, FileNames.TestDataXml), JsonConvert.DeserializeXmlNode(jsonData, "TestData").ToXmlString()); HtmlReportBuilder.CreateReport(dataToOutput); try { CopyFolder.Copy(Path.Combine(FileLocations.ProjectDirectory, "css"), Path.Combine(ResultDirectory, "css")); } catch (Exception e) { Console.WriteLine(e); } }
internal static HtmlReportBuilder CreateReport(DataOutputModel dataOutputModel) { return(new HtmlReportBuilder(dataOutputModel)); }
public static void Main(string[] args) { Args = string.Join(" ", args); AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException; ResultDirectory = args.FirstOrDefault(it => it.StartsWith(Arguments.ResultDirectoryArgumentName))?.Replace(Arguments.ResultDirectoryArgumentName, ""); SetSettingsFromArgs(args); if (string.IsNullOrWhiteSpace(ResultDirectory)) { return; } var scenarios = GetScenarios(ResultDirectory); var testTimer = GetTestTimer(scenarios); var reportPathByStory = Path.Combine(ResultDirectory, FileNames.ReportByStory); var reportPathAllScenarios = Path.Combine(ResultDirectory, FileNames.ReportAllScenarios); var testDataJsonPath = Path.Combine(ResultDirectory, FileNames.TestDataJson); var testDataXmlPath = Path.Combine(ResultDirectory, FileNames.TestDataXml); DeleteExistingFiles(reportPathByStory, reportPathAllScenarios, testDataJsonPath, testDataXmlPath); var warnings = GetWarnings(); scenarios.AddRange(warnings.StoppedEarlyTests); var dataToOutput = new DataOutputModel { Scenarios = scenarios, TestTimer = testTimer, Warnings = warnings }; var settings = new JsonSerializerSettings { PreserveReferencesHandling = PreserveReferencesHandling.Objects }; var jsonData = JsonConvert.SerializeObject(dataToOutput, Formatting.Indented, settings); WriteJsonOutput(jsonData); WriteXmlOutput(jsonData); PruneData(); HtmlReportBuilder.CreateReport(dataToOutput); try { CopyFolder.Copy(Path.Combine(FileLocations.ProjectDirectory, "css"), Path.Combine(ResultDirectory, "css")); } catch (Exception) { // ignored } }