private TestPlan GetOrCreateTestPlan(TestPlan testPlan) { var planExists = _testrail.Extension.GetTestPlanByName(testPlan.Name, testPlan.ProjectId); if (planExists != null) return planExists; var planCreated = _testrail.AddTestPlan(testPlan.ProjectId, testPlan); return planCreated; }
private TestPlan CreateTestPlanForIssue(Issue issue, Milestone milestone) { var planName = $"[DEV] {issue.Key}: {issue.Summary}"; var planAcceptanceCriteria = _jira.GetCustomFieldFromIssue(issue, "Acceptance Criteria"); var planDescription = $"Description:\r\n{issue.Description}\r\n\r\nAcceptance Criteria:\r\n{planAcceptanceCriteria}"; var plan = new TestPlan { MilestoneId = milestone.Id, Name = planName, Description = planDescription, ProjectId = milestone.ProjectId }; return plan; }
private void SaveTestPlanAndUpdateJira(TestPlan testPlan, Issue issue) { var savedPlan = GetOrCreateTestPlan(testPlan); _jira.AddCustomFieldToIssue(issue, "Test Case Link", savedPlan.Url); }
public TestPlan AddTestPlan(int projectId, TestPlan testPlan) { var response = Post("add_plan/" + projectId, testPlan); return JsonConvert.DeserializeObject<TestPlan>(response); }
public TestPlan UpdateTestPlan(int testPlanId, TestPlan updatedPlan) { var originalPlan = GetTestPlan(testPlanId); originalPlan.MergeWith(updatedPlan); var response = Post("update_plan/" + testPlanId, originalPlan); return JsonConvert.DeserializeObject<TestPlan>(response); }