Exemplo n.º 1
0
        // get test set explorer(tree view)
        public static List <ALMTestSetSummary> GetTestSetExplorer(string PathNode)
        {
            List <ALMTestSetSummary> testlabPathList = new List <ALMTestSetSummary>();

            string[] separatePath = PathNode.Split('\\');
            try
            {
                separatePath[0] = ExploredTestLabFolder.ContainsKey("Root") ? ExploredTestLabFolder["Root"] : QcRestClient.GetTestSetRootFolder().Id;

                if (!ExploredTestLabFolder.ContainsKey("Root"))
                {
                    ExploredTestLabFolder.Add("Root", separatePath[0]);
                }

                for (int i = 1; i < separatePath.Length; i++)
                {
                    separatePath[i] = GetTestLabFolderId(separatePath[i], separatePath[i - 1]);
                }

                QCTestSetColl testSets = QcRestClient.GetAllTestSetsUnderFolder(int.Parse(separatePath[separatePath.Length - 1]));

                foreach (QCRestClient.QCTestSet testset in testSets)
                {
                    ALMTestSetSummary QCTestSetTreeItem = new ALMTestSetSummary();
                    QCTestSetTreeItem.TestSetID   = testset.Id;
                    QCTestSetTreeItem.TestSetName = testset.Name;
                    testlabPathList.Add(QCTestSetTreeItem);
                }
            }
            catch (Exception ex)
            {
                Reporter.ToLog(eLogLevel.ERROR, "Failed to get Test Set with REST API", ex);
            }
            return(testlabPathList);
        }
        List <ITreeViewItem> ITreeViewItem.Childrens()
        {
            CurrentChildrens = new List <ITreeViewItem>();

            // get the sub items for the root here and return list of Childrens
            // Step #1 add sub folder of current folder
            List <string> strParentFolders = ALMIntegration.Instance.GetTestLabExplorer(Path);

            //Add QC folders to tree children

            foreach (string sFolder in strParentFolders)
            {
                QCTestLabFolderTreeItem pfn = new QCTestLabFolderTreeItem();
                pfn.Folder = sFolder;
                pfn.Path   = Path + @"\" + sFolder;
                CurrentChildrens.Add(pfn);
            }

            // Step #2 add folder Test Set list
            List <ALMTestSetSummary> sTestSets = (List <ALMTestSetSummary>)ALMIntegration.Instance.GetTestSetExplorer(Path);

            foreach (ALMTestSetSummary tsItem in sTestSets)
            {
                tsItem.TestSetStatuses = new List <string[]>();
                QCTestSetTreeItem pfn = new QCTestSetTreeItem();
                pfn.TestSetID   = tsItem.TestSetID.ToString();
                pfn.TestSetName = tsItem.TestSetName;
                pfn.Path        = Path + @"\" + tsItem.TestSetName;
                ALMTestSetSummary tsItemStatus = ALMIntegration.Instance.GetTSRunStatus(tsItem);
                pfn.TestSetStatuses = tsItem.TestSetStatuses;
                pfn.IsTestSetAlreadyImported();
                CurrentChildrens.Add(pfn);
            }

            return(CurrentChildrens);
        }
Exemplo n.º 3
0
 public ALMTestSetSummary GetTSRunStatus(ALMTestSetSummary tsItem)
 {
     return((ALMTestSetSummary)AlmRepo.GetTSRunStatus(tsItem));
 }