Exemplo n.º 1
0
        /// <summary>
        /// Finds testset with testset ID
        /// <para/>returns TDAPIOLELib.TestSet Object
        /// </summary>
        /// <param name="id">ID of the testset</param>
        /// <returns>TDAPIOLELib.TestSet Object</returns>
        public TDAPIOLELib.TestSet GetObjectWithID(int id)
        {
            TDAPIOLELib.TestSetFactory testSetFactory = tDConnection.TestSetFactory as TDAPIOLELib.TestSetFactory;
            TDAPIOLELib.TDFilter       tDFilter       = testSetFactory.Filter as TDAPIOLELib.TDFilter;
            TDAPIOLELib.List           testSetList;
            TDAPIOLELib.TestSet        testSet;

            try
            {
                tDFilter["CY_CYCLE_ID"] = Convert.ToString(id);
                testSetList             = testSetFactory.NewList(tDFilter.Text);

                if (testSetList != null && testSetList.Count == 1)
                {
                    testSet = testSetList[1];
                    return(testSet);
                }
                else
                {
                    throw (new Exception("Unable to find test Set with ID : " + id));
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        /// <summary>
        /// Find test sets under TestLab Folder
        /// <para/>return TDAPIOLELib.List. Each item from the list can be converted to TDAPIOLELib.TestSet
        /// </summary>
        /// <param name="folderPath">TestLab folder path</param>
        /// <returns></returns>
        public TDAPIOLELib.List FindTestSets(String folderPath)
        {
            TDAPIOLELib.TestSetTreeManager testSetTreeManager = tDConnection.TestSetTreeManager;
            TDAPIOLELib.TestSetFolder      testSetFolder      = testSetTreeManager.NodeByPath[folderPath];

            TDAPIOLELib.TestSetFactory testSetFactory = testSetFolder.TestSetFactory;
            TDAPIOLELib.List           OTestSetList   = testSetFactory.NewList("");

            return(OTestSetList);
        }
Exemplo n.º 3
0
 /// <summary>
 /// Deletes a test set
 /// <para/>returns true if successfull
 /// </summary>
 /// <param name="testSet"></param>
 /// <returns>true if successfull</returns>
 public Boolean Delete(TDAPIOLELib.TestSet testSet)
 {
     try
     {
         TDAPIOLELib.TestSetFactory testSetFactory = tDConnection.TestSetFactory;
         testSetFactory.RemoveItem(testSet.ID);
         return(true);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Exemplo n.º 4
0
        /// <summary>
        /// Create a new test set in the test plan
        /// <para/> returns TDAPIOLELib.TestSet object
        /// </summary>
        /// <param name="testSetDetails">Test set database fields with values</param>
        /// <param name="testSetFolderPath">Test lab Folder path for test set</param>
        /// <returns></returns>
        public TDAPIOLELib.TestSet Create(Dictionary <String, String> testSetDetails, String testSetFolderPath)
        {
            TDAPIOLELib.TestSetFactory testSetFactory = testLabFolders.GetTestSetFolder(testSetFolderPath).TestSetFactory;
            TDAPIOLELib.TestSet        testSet        = testSetFactory.AddItem(System.DBNull.Value);

            foreach (KeyValuePair <string, string> kvp in testSetDetails)
            {
                testSet[kvp.Key.ToUpper()] = kvp.Value;
            }

            //Post the test to ALM
            testSet.Post();
            return(testSet);
        }
Exemplo n.º 5
0
        /// <summary>
        /// Filters tests from test plan using the filter text. Filter text can be colpied directly from ALM and passed to this function.
        /// <para/> returns TDAPIOLELib.List Object. Each item from this list can be coverted to TDAPIOLELib.Test object.
        /// </summary>
        /// <param name="filterString">Copy this from ALM</param>
        /// <returns>TDAPIOLELib.List Object. Each item from this list can be coverted to TDAPIOLELib.Test object.</returns>
        public TDAPIOLELib.List Filter(String filterString)
        {
            TDAPIOLELib.TestSetFactory testSetFactory = tDConnection.TestSetFactory as TDAPIOLELib.TestSetFactory;
            TDAPIOLELib.TDFilter       tDFilter       = testSetFactory.Filter as TDAPIOLELib.TDFilter;
            TDAPIOLELib.List           testList;

            try
            {
                tDFilter.Text = filterString;
                testList      = testSetFactory.NewList(tDFilter.Text);

                return(testList);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
 /// <summary>
 /// Find test sets under a test set folder
 /// </summary>
 /// <param name="testSetFolder">TDAPIOLELib.TestSetFolder Object</param>
 /// <returns>TDAPIOLELib.List Object containing test set objects</returns>
 public TDAPIOLELib.List FindTestSets(TDAPIOLELib.TestSetFolder testSetFolder)
 {
     TDAPIOLELib.TestSetFactory testSetFactory = testSetFolder.TestSetFactory;
     return(testSetFactory.NewList(""));
 }