/// <summary> /// Finds All Folders under a test plan folder. /// <para/>returns List of string with folder names /// </summary> /// <param name="testfolder">TDAPIOLELib.TestFolder Object</param> /// <returns>List of string with folder names</returns> public TDAPIOLELib.List GetChildFolders(TDAPIOLELib.TestFolder testFolder) { TDAPIOLELib.List List = new TDAPIOLELib.List(); foreach (TDAPIOLELib.TestFolder oFolder in testFolder.TestFolderFactory.NewList("")) { List.Add(oFolder); } return(List); }
/// <summary> /// Gets the TDAPIOLELib.ReleaseFolder object for each folder under Release Folder /// </summary> /// <param name="releaseFolder">TDAPIOLELib.ReleaseFolder Object</param> /// <returns>List of TDAPIOLELib.ReleaseFolder Objects</returns> public TDAPIOLELib.List GetChildFolders(TDAPIOLELib.ReleaseFolder releaseFolder) { TDAPIOLELib.List relFolderNames = new TDAPIOLELib.List(); foreach (TDAPIOLELib.ReleaseFolder rf in releaseFolder.ReleaseFolderFactory.NewList("")) { relFolderNames.Add(rf); } return(relFolderNames); }
/// <summary> /// Find child folders under a test plan folder /// <para>returns TDAPIOLELib.List Object containing the list of Test Set folder object</para> /// </summary> /// <param name="testSetFolder">TDAPIOLELib.TestSetFolder Object</param> /// <returns>TDAPIOLELib.List Object containing the list of Test Set folder object</returns> public TDAPIOLELib.List FindChildFolders(TDAPIOLELib.TestSetFolder testSetFolder) { TDAPIOLELib.List List = new TDAPIOLELib.List(); for (int Counter = 1; Counter <= testSetFolder.Count; Counter++) { List.Add(testSetFolder.Child[Counter]); } return(List); }
/// <summary> /// Returns a list of reports or graphs under analysis folder /// </summary> /// <param name="analysisItemFolder">Analysis folder object</param> /// <returns></returns> public TDAPIOLELib.List GetChildGraphs(TDAPIOLELib.AnalysisItemFolder analysisItemFolder) { TDAPIOLELib.List anaFolderNames = new TDAPIOLELib.List(); TDAPIOLELib.AnalysisItemFactory analysisItemFactory = analysisItemFolder.AnalysisItemFactory; foreach (TDAPIOLELib.AnalysisItemFolder aif in analysisItemFactory.NewList("")) { anaFolderNames.Add(aif); } return(anaFolderNames); }
/// <summary> /// Gets the list of releases under a release folder /// </summary> /// <param name="releaseFolder">TDAPIOLELib.ReleaseFolder Object</param> /// <returns>TDAPIOLELib.List Object</returns> public TDAPIOLELib.List GetReleases(TDAPIOLELib.ReleaseFolder releaseFolder) { TDAPIOLELib.List relNames = new TDAPIOLELib.List(); TDAPIOLELib.ReleaseFactory releaseFactory = releaseFolder.ReleaseFactory; foreach (TDAPIOLELib.Release ORel in releaseFactory.NewList("")) { relNames.Add(ORel); } return(relNames); }
public TDAPIOLELib.List FindChildFolders(TDAPIOLELib.DashboardFolder dashboardFolder) { TDAPIOLELib.DashboardFolderFactory dashboardFolderFactory = dashboardFolder.DashboardFolderFactory; TDAPIOLELib.List list = new TDAPIOLELib.List(); foreach (TDAPIOLELib.DashboardFolder DF in dashboardFolderFactory.NewList("")) { list.Add(DF); } return(list); }
/// <summary> /// Get the Child Folders for Analysis Folder /// </summary> /// <param name="folderPath">Path of the folder to search for the release</param> /// <returns>List of Analysis folder names</returns> public TDAPIOLELib.List GetChildFolders(String folderPath) { TDAPIOLELib.List anaFolderNames = new TDAPIOLELib.List(); TDAPIOLELib.AnalysisItemFolder analysisItemFolder = GetFolderObject(folderPath); TDAPIOLELib.AnalysisItemFolderFactory analysisItemFolderFactory = analysisItemFolder.AnalysisItemFolderFactory; foreach (TDAPIOLELib.AnalysisItemFolder aif in analysisItemFolderFactory.NewList("")) { anaFolderNames.Add(aif); } return(anaFolderNames); }
/// <summary> /// Finds the list of tests under unattached folder /// <para/>returns TDAPIOLELib.List Object. Each item from this list can be converted to TDAPIOLELib.Test Object /// </summary> /// <returns>TDAPIOLELib.List Object</returns> public TDAPIOLELib.List FindUnattachedTests() { TDAPIOLELib.List list = new TDAPIOLELib.List(); TDAPIOLELib.Recordset recordset = Utilities.ExecuteQuery("Select * from test where TS_SUBJECT = -2", tDConnection); recordset.First(); for (int Counter = 1; Counter <= recordset.RecordCount; Counter++) { list.Add(GetObjectWithID(Convert.ToInt32(recordset["TS_TEST_ID"]))); recordset.Next(); } return(list); }
/// <summary> /// Finds unattached testSets /// </summary> /// <returns>List of unattached testsets</returns> public TDAPIOLELib.List FindUnattachedTestSets() { TDAPIOLELib.List list = new TDAPIOLELib.List(); TDAPIOLELib.Recordset recordset = Utilities.ExecuteQuery("SELECT CY_CYCLE_ID FROM CYCLE Where CY_FOLDER_ID < 0 and CY_CYCLE_ID > 0", tDConnection); recordset.First(); for (int Counter = 1; Counter <= recordset.RecordCount; Counter++) { list.Add(GetObjectWithID(Convert.ToInt32(recordset["CY_CYCLE_ID"]))); recordset.Next(); } return(list); }
/// <summary> /// Gets the list of defects linked to ALM Entities /// </summary> /// <param name="Obj">Object Object</param> /// <returns>TDAPIOLELib.List Object</returns> private TDAPIOLELib.List GetLinkedDefectsToEntities(Object Obj) { TDAPIOLELib.ILinkable linkable = Obj as TDAPIOLELib.ILinkable; TDAPIOLELib.LinkFactory linkFactory = linkable.BugLinkFactory; TDAPIOLELib.List list = new TDAPIOLELib.List(); foreach (TDAPIOLELib.Link link in linkFactory.NewList("")) { list.Add(link.TargetEntity as TDAPIOLELib.Bug); } return(list); }
public void Verify_Requirements() { Dictionary <String, String> requirementDetails = new Dictionary <String, String>(); requirementDetails.Add("RQ_REQ_NAME", "Dummy1"); aLM_CORE.Requirements.Create(requirementDetails, "Requirements", TDAPIOLELib.TDAPI_PREDEFINED_REQ_TYPES.REQ_TYPE_FOLDER); TDAPIOLELib.Req req = aLM_CORE.Requirements.CreateFolder("Dummy2", "Requirements\\Dummy1"); aLM_CORE.Requirements.Delete(req); req = aLM_CORE.Requirements.GetReqByPath("Requirements\\Dummy1"); Console.WriteLine(req.Path); aLM_CORE.Requirements.UpdateFieldValue(req, "RQ_REQ_NAME", "Dummy6", true); Console.WriteLine("Requirement Name after change : " + req.Name); List <String> Attach = new List <String>(); Attach.Add("C:\\Temp\\ALMUPLOAD\\DOC1.txt"); Attach.Add("C:\\Temp\\ALMUPLOAD\\DOC2.docx"); Attach.Add("C:\\Temp\\ALMUPLOAD\\DOC3.xlsx"); aLM_CORE.Requirements.AddAttachements(req, Attach); aLM_CORE.Requirements.DeleteAttachementByName(req, "DOC2.docx"); aLM_CORE.Requirements.DeleteAllAttachments(req); aLM_CORE.TestPlan.TestFolders.Create("Subject", "Dummy1"); Dictionary <String, String> TestN = new Dictionary <String, String>(); TestN.Add("TS_NAME", "THIS IS DUMMUY TEST"); TestN.Add("TS_STATUS", "Ready"); aLM_CORE.TestPlan.TestFolders.Create("Subject\\Dummy1", "Dummy2"); TDAPIOLELib.Test test = aLM_CORE.TestPlan.Test.Create(TestN, "Subject\\Dummy1"); TDAPIOLELib.Test test1 = aLM_CORE.TestPlan.Test.Create(TestN, "Subject\\Dummy1\\Dummy2"); TestN.Clear(); TestN.Add("TS_NAME", "THIS IS DUMMUY TEST2"); TestN.Add("TS_STATUS", "Ready"); TDAPIOLELib.Test test2 = aLM_CORE.TestPlan.Test.Create(TestN, "Subject\\Dummy1\\Dummy2"); //Create a requirement of type undefined TDAPIOLELib.Req req1 = aLM_CORE.Requirements.Create(requirementDetails, "Requirements\\Dummy6", TDAPIOLELib.TDAPI_PREDEFINED_REQ_TYPES.REQ_TYPE_UNDEFINED); aLM_CORE.Requirements.AddTestToRequirementsCoverage(test, req1); aLM_CORE.Requirements.AddTestPlanFolderToRequirementsCoverage(aLM_CORE.TestPlan.TestFolders.GetNodeObject("Subject\\Dummy1\\Dummy2").NodeID, req1); requirementDetails.Clear(); requirementDetails.Add("RQ_REQ_NAME", "Dummy2"); TDAPIOLELib.Req req2 = aLM_CORE.Requirements.Create(requirementDetails, "Requirements\\Dummy6", TDAPIOLELib.TDAPI_PREDEFINED_REQ_TYPES.REQ_TYPE_UNDEFINED); TDAPIOLELib.Trace trace1 = aLM_CORE.Requirements.AddRequirementTraceability_TraceFrom(req1, req2); TDAPIOLELib.Trace trace2 = aLM_CORE.Requirements.AddRequirementTraceability_TraceTo(req1, req2); foreach (TDAPIOLELib.Trace oTrace in aLM_CORE.Requirements.GetRequirementTraceability_TraceFrom(req1)) { Console.Write("Requirement Tracebility Trace from requirements : " + oTrace.FromReq.Name); } foreach (TDAPIOLELib.Trace oTrace in aLM_CORE.Requirements.GetRequirementTraceability_TraceTo(req1)) { Console.Write("Requirement Tracebility Trace from requirements : " + oTrace.ToReq.Name); } TDAPIOLELib.Recordset recordset = aLM_CORE.ExecuteQuery("Select REL_ID From Releases where rownum < 10"); recordset.First(); TDAPIOLELib.List releaseIDList = new TDAPIOLELib.List(); for (int Counter = 0; Counter < recordset.RecordCount; Counter++) { Console.WriteLine("Release ID : " + recordset[0]); releaseIDList.Add(recordset[0]); recordset.Next(); } aLM_CORE.Requirements.SetTargetReleases(req1, releaseIDList); foreach (TDAPIOLELib.Release release in aLM_CORE.Requirements.GetTargetReleases(req1)) { Console.WriteLine("Target Release ID : " + release.ID); } aLM_CORE.Requirements.DeleteTargetReleases(req1); recordset = aLM_CORE.ExecuteQuery("Select RCYC_ID From RELEASE_CYCLES where rownum < 10"); recordset.First(); TDAPIOLELib.List cycleIDList = new TDAPIOLELib.List(); for (int Counter = 0; Counter < recordset.RecordCount; Counter++) { Console.WriteLine("Cycle ID : " + recordset[0]); cycleIDList.Add(recordset[0]); recordset.Next(); } aLM_CORE.Requirements.SetTargetCycles(req1, cycleIDList); foreach (TDAPIOLELib.Cycle cycle in aLM_CORE.Requirements.GetTargetCycles(req1)) { Console.WriteLine("Target Cycle ID : " + cycle.ID); } aLM_CORE.Requirements.DeleteTargetCycles(req1); aLM_CORE.Requirements.DeleteRequirementTraceability_TraceFrom(req1, trace1); aLM_CORE.Requirements.DeleteRequirementTraceability_TraceTo(req1, trace2); foreach (TDAPIOLELib.Req oReq in aLM_CORE.Requirements.GetChildRequirements(aLM_CORE.Requirements.GetReqByPath("Requirements\\Dummy6"))) { Console.WriteLine("Child requirement Found : " + oReq.Name); } Console.WriteLine("Parent Requirement Name : " + aLM_CORE.Requirements.GetParentRequirement(aLM_CORE.Requirements.GetReqByPath("Requirements\\Dummy6\\Dummy1")).Name); aLM_CORE.Requirements.Delete(req1); aLM_CORE.Requirements.Delete(req2); aLM_CORE.Requirements.Delete(req); aLM_CORE.TestPlan.Test.Delete(test); aLM_CORE.TestPlan.Test.Delete(test1); aLM_CORE.TestPlan.Test.Delete(test2); aLM_CORE.TestPlan.TestFolders.Delete("Subject\\Dummy1"); }