예제 #1
0
 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;
 }
예제 #2
0
 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;
 }
예제 #3
0
 private void SaveTestPlanAndUpdateJira(TestPlan testPlan, Issue issue)
 {
     var savedPlan = GetOrCreateTestPlan(testPlan);
     _jira.AddCustomFieldToIssue(issue, "Test Case Link", savedPlan.Url);
 }
예제 #4
0
 public TestPlan AddTestPlan(int projectId, TestPlan testPlan)
 {
     var response = Post("add_plan/" + projectId, testPlan);
     return JsonConvert.DeserializeObject<TestPlan>(response);
 }
예제 #5
0
        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);
        }