public static string CreateReport(RunSuite suite) { var pdfFile = suite.FileName.Replace(".json", ".pdf"); using (var stream = new FileStream(pdfFile, FileMode.Create)) { var doc = new Document(); doc.SetMargins(1f, 1f, 40.0f, 40.0f); PdfWriter.GetInstance(doc, stream); doc.Open(); doc.Add(new Paragraph(30.0f, "Suite Results for " + suite.Name + " Feature")); doc.Add(new Paragraph(Environment.NewLine)); doc.Add(PdfExtensions.GetSummaryTable(suite.GetSummary(), Rectangle.NO_BORDER, 0.25f, 0.25f, 0.5f)); var i = 0; foreach (var scenario in suite.Scenarios) { doc.Add(new Paragraph(Environment.NewLine)); doc.Add(scenario.GetBodyTable(++i)); } doc.Close(); } return(pdfFile); }
public static RunSuiteViewModel ToViewModel(this RunSuite entity) { return(new RunSuiteViewModel { Suite = entity.packname, PackId = entity.packid, Project = entity.projectname, Scenarios = entity.mainscenarioname, SubScenarios = entity.subscenarioname, RunOn = new List <CommonViewModel>(), Environment = new List <CommonViewModel>(), RunAt = new List <CommonViewModel>(), Scenario_SubScenario = entity.scenario_subscenario, ProjectId = entity.projectid }); }
public static RunSuite CreateSuiteRun(string customName = null) { var name = customName ?? "SuiteRun_" + Guid.NewGuid(); var status = new BaseEntity(); status.SetValue("id", "list_node.run_native_status.not_completed"); status.SetValue("type", "list_node"); var suiteRun = new RunSuite { Name = name, Release = ReleaseTests.CreateRelease(), Parent = CreateTestSuite(), NativeStatus = status }; var createdSuiteRun = entityService.Create(workspaceContext, suiteRun, TestHelper.NameSubtypeFields); Assert.AreEqual(name, createdSuiteRun.Name, "Mismatched name for newly created test suite run"); Assert.IsTrue(!string.IsNullOrEmpty(createdSuiteRun.Id), "Test suite run id shouldn't be null or empty"); return(createdSuiteRun); }
/// <summary> /// Create a new suite run entity /// </summary> public static RunSuite CreateSuiteRun(TestSuite parent, string customName = null) { var name = customName ?? "SuiteRun_" + Guid.NewGuid(); var status = new BaseEntity(); status.SetValue("id", "list_node.run_native_status.not_completed"); status.SetValue("type", "list_node"); var suiteRun = new RunSuite { Name = name, DefaultRunBy = BaseOctanePluginTest.User, Release = BaseOctanePluginTest.CurrentRelease, Parent = parent, NativeStatus = status }; var createdSuiteRun = BaseOctanePluginTest.EntityService.Create(BaseOctanePluginTest.WorkspaceContext, suiteRun, new[] { "name", "subtype" }); Assert.AreEqual(name, createdSuiteRun.Name, "Mismatched name for newly created suite run"); Assert.IsTrue(!string.IsNullOrEmpty(createdSuiteRun.Id), "Suite run id shouldn't be null or empty"); return(createdSuiteRun); }