Ejemplo n.º 1
0
        public void UpdateAutomationIndicator()
        {
            ////Get all tests from ALM

            TDAPIOLELib.Recordset recordset = aLM_CORE.ExecuteQuery("Select TS_TEST_ID from test where TS_USER_TEMPLATE_06 is not null");
            Console.WriteLine(recordset.RecordCount);
            recordset.First();

            TDAPIOLELib.Test test;


            for (int Counter = 0; Counter < recordset.RecordCount; Counter++)
            {
                test = aLM_CORE.TestPlan.Test.GetObjectWithID(Convert.ToInt32(recordset[0]));

                if (test["TS_USER_TEMPLATE_06"] == "Y" && (test["TS_STATUS"] != "Ready For Automation" && test["TS_STATUS"] != "Automated"))
                {
                    Console.WriteLine(test.ID);
                    test["TS_STATUS"] = "Automated";
                    test.Post();
                }
                else if (test["TS_USER_TEMPLATE_06"] == "N" && (test["TS_STATUS"] != "Ready For Automation" && test["TS_STATUS"].ToString().ToUpper() != "Cannot be Automated".ToUpper()))
                {
                    Console.WriteLine(test.ID);
                    test["TS_STATUS"] = "Cannot be automated";
                    test.Post();
                }

                recordset.Next();
            }
        }
Ejemplo n.º 2
0
 /// <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);
 }
Ejemplo n.º 3
0
 /// <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);
 }
Ejemplo n.º 4
0
        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");
        }
Ejemplo n.º 5
0
 /// <summary>
 /// Get all defect database field values. This Functions uses RecordSet object.
 /// <para/>You must have access to executing queries in ALM
 /// </summary>
 /// <param name="bug">TDAPIOLELib.Bug Object</param>
 /// <returns>true if successfull</returns>
 public TDAPIOLELib.Recordset GetAllDetails(TDAPIOLELib.Bug bug)
 {
     TDAPIOLELib.Recordset ORecordSet = Utilities.ExecuteQuery("Select * from Bug where BG_BUG_ID = " + bug.ID, tDConnection);
     ORecordSet.First();
     return(ORecordSet);
 }
Ejemplo n.º 6
0
 /// <summary>
 /// Count all tests in TestPlan.
 /// <para/> returns Count of tests from test plan
 /// </summary>
 /// <returns>Count of tests from test plan</returns>
 public int CountAllTests()
 {
     TDAPIOLELib.Recordset ORecordSet = Utilities.ExecuteQuery("Select Count(*) from Test", tDConnection);
     ORecordSet.First();
     return(Convert.ToInt32(ORecordSet[0]));
 }