public Testplan GetTestPlanByProjectNameAndPlanName(string projectName, string planName) { string planid = GetTestPlanIDByProjectNameAndPlanName(projectName, planName); string apiRequestStr = "get_plan/" + planid; JContainer result = (JContainer)client.SendGet(apiRequestStr); Testplan tp = JsonConvert.DeserializeObject <Testplan>(result.ToString()); return(tp); }
public List <Testplan> GetDailyAutomationTestPlanID(string projectName, string planName) { string projectid = GetProjectIDByProjectName(projectName); JContainer TestPlans = GetTestPlansByProjectId(projectid); List <Testplan> ls_plan = new List <Testplan>(); string planId = string.Empty; List <string> ls_planId = new List <string>(); for (int i = 0; i < TestPlans.Count; i++) { if (TestPlans[i]["name"].ToString().Contains(planName) && TestPlans[i]["is_completed"].ToString() == "False") { Testplan tp = JsonConvert.DeserializeObject <Testplan>(TestPlans[i].ToString()); ls_plan.Add(tp); } } return(ls_plan); }
public string GetRunIdByProjectNameAndPlanNameAndSuiteId(string projectName, string planName, string suiteid) { Testplan tp = GetTestPlanByProjectNameAndPlanName(projectName, planName); List <Entry> enties = tp.Entries; string runid = string.Empty; foreach (Entry entry in enties) { foreach (var r in entry.Runs) { if (r.SuiteId == suiteid) { runid = r.Id; } } } return(runid); }
public List <Run> GetRunIdsByProjectNameAndPlanNameAndSuiteId(string projectName, string planName, string suiteid) { Testplan tp = GetTestPlanByProjectNameAndPlanName(projectName, planName); List <Entry> enties = tp.Entries; string runid = string.Empty; List <Run> ls_runs = new List <Run>(); foreach (Entry entry in enties) { foreach (var r in entry.Runs) { if (r.SuiteId == suiteid) { ls_runs.Add(r); } } } return(ls_runs); }