コード例 #1
0
 public static QCTestInstanceParamColl GetTestInstanceParams(string id)
 {
     try
     {
         return(QcRestClient.GetTestInstanceParams(id));
     }
     catch (Exception ex)
     {
         Reporter.ToLog(eLogLevel.ERROR, "Failed to get test instances with REST API", ex);
         return(null);
     }
 }
コード例 #2
0
 public static QCRestClient.QCTestSet GetTestSetDetails(string testSetID)
 {
     try
     {
         return(QcRestClient.GetTestSetDetails(testSetID));
     }
     catch (Exception ex)
     {
         Reporter.ToLog(eLogLevel.ERROR, "Failed to get test set details with REST API", ex);
         return(null);
     }
 }
コード例 #3
0
 public static QCTestCaseStepsColl GetTestCaseSteps(string id)
 {
     try
     {
         return(QcRestClient.GetTestCaseSteps(id));
     }
     catch (Exception ex)
     {
         Reporter.ToLog(eLogLevel.ERROR, "Failed to get test case steps with REST API", ex);
         return(null);
     }
 }
コード例 #4
0
 public static List <QCField> GetFields(string testSetfieldInRestSyntax)
 {
     try
     {
         return(QcRestClient.GetFields(testSetfieldInRestSyntax));
     }
     catch (Exception ex)
     {
         Reporter.ToLog(eLogLevel.ERROR, "Failed to get fields with REST API", ex);
         return(null);
     }
 }
コード例 #5
0
 public static string ConvertResourceType(ResourceType resourceType)
 {
     try
     {
         return(QcRestClient.ConvertResourceType(resourceType));
     }
     catch (Exception ex)
     {
         Reporter.ToLog(eLogLevel.ERROR, "Failed to convert resource type with REST API", ex);
         return(null);
     }
 }
コード例 #6
0
 public static QCTestCaseColl GetTestCases(List <string> testCasesIds)
 {
     try
     {
         return(QcRestClient.GetTestCases(testCasesIds));
     }
     catch (Exception ex)
     {
         Reporter.ToLog(eLogLevel.ERROR, "Failed to get test cases with REST API", ex);
         return(null);
     }
 }
コード例 #7
0
 private static string GetTestPlanFolderId(string separateAti, string separateAtIMinusOne)
 {
     if (!ExploredTestPlanFolder.ContainsKey(separateAti))
     {
         QCTestFolder testPlanFol = QcRestClient.GetTestPlansByNameAndParentId(separateAti, separateAtIMinusOne);
         ExploredTestPlanFolder.Add(testPlanFol.Name, testPlanFol.Id);
         return(testPlanFol.Id);
     }
     else
     {
         return(ExploredTestPlanFolder[separateAti]);
     }
 }
コード例 #8
0
        public static bool DisconnectQCProjectStayLoggedIn()
        {
            CurrentDomain  = null;
            CurrentProject = null;

            if (QcRestClient == null)
            {
                QcRestClient = new QCClient(ServerURL, UserName, Password);
            }
            if (!QcRestClient.IsAuthenticated())
            {
                return(QcRestClient.Login());
            }

            return(true);
        }
コード例 #9
0
        public static dynamic GetTSRunStatus(dynamic TSItem)
        {
            QCTestInstanceColl testInstances = QcRestClient.GetTestInstancesOfTestSet(TSItem.TestSetID);

            foreach (QCTestInstance testInstance in testInstances)
            {
                bool existing = false;
                foreach (string[] status in TSItem.TestSetStatuses)
                {
                    if (status[0] == testInstance.Status)
                    {
                        existing  = true;
                        status[1] = (Int32.Parse(status[1]) + 1).ToString();
                    }
                }
                if (!existing)
                {
                    TSItem.TestSetStatuses.Add(new string[] { testInstance.Status, "1" });
                }
            }

            return(TSItem);
        }
コード例 #10
0
        public static List <string> GetTestLabExplorer(string PathNode)
        {
            string[]      separatePath    = PathNode.Split('\\');
            List <string> testlabPathList = new List <string>();

            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]);
            }

            QCTestSetFolderColl foldersToExplor = QcRestClient.GetTestSetTreeLayerByFilter(separatePath[separatePath.Length - 1], "");

            foreach (QCTestSetFolder folders in foldersToExplor)
            {
                testlabPathList.Add(folders.Name);
            }

            return(testlabPathList);
        }
コード例 #11
0
        // get test set explorer(tree view)
        public static List <QCTestSetSummary> GetTestSetExplorer(string PathNode)
        {
            List <QCTestSetSummary> testlabPathList = new List <QCTestSetSummary>();

            string[] separatePath = PathNode.Split('\\');

            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)
            {
                QCTestSetSummary QCTestSetTreeItem = new QCTestSetSummary();
                QCTestSetTreeItem.TestSetID   = testset.Id;
                QCTestSetTreeItem.TestSetName = testset.Name;
                testlabPathList.Add(QCTestSetTreeItem);
            }

            return(testlabPathList);
        }
コード例 #12
0
        // get test plan explorer(tree view)
        public static List <string> GetTestPlanExplorer(string PathNode)
        {
            string[]      separatePath     = PathNode.Split('\\');
            List <string> testPlanPathList = new List <string>();

            separatePath[0] = ExploredTestPlanFolder.ContainsKey("Subject") ? ExploredTestPlanFolder["Subject"] : QcRestClient.GetTestPlanRootFolder().Id;

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

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

            QCTestPlan testPlanToExplor = QcRestClient.GetTestPlanTreeLayerByFilter(separatePath[separatePath.Length - 1], "");

            foreach (QCTestFolder folder in testPlanToExplor.folders)
            {
                testPlanPathList.Add(folder.Name);
            }

            return(testPlanPathList);
        }
コード例 #13
0
 public static QCRun GetRunDetail(string id)
 {
     return(QcRestClient.GetRun(id));
 }
コード例 #14
0
        public static int GetLastTestSetIdFromPath(string PathNode)
        {
            string[]      separatePath    = PathNode.Split('\\');
            List <string> testSetPathList = new List <string>();

            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]);
            }

            return(int.Parse(separatePath.Last()));
        }
コード例 #15
0
 public static List <string> GetQCDomainProjects(string domainName)
 {
     return(QcRestClient.getProjectsList(domainName));
 }
コード例 #16
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);
        }
コード例 #17
0
 public static Dictionary <string, string> GetQCDomainProjects(string domainName)
 {
     return(QcRestClient.getProjectsList(domainName).ToDictionary(prj => prj, prj => prj));
 }
コード例 #18
0
        public static List <string> GetTestLabExplorer(string PathNode)
        {
            string[]      separatePath    = PathNode.Split('\\');
            List <string> testlabPathList = new List <string>();

            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]);
                }

                QCTestSetFolderColl foldersToExplor = QcRestClient.GetTestSetTreeLayerByFilter(separatePath[separatePath.Length - 1], "");

                foreach (QCTestSetFolder folders in foldersToExplor)
                {
                    testlabPathList.Add(folders.Name);
                }
            }
            catch (Exception ex)
            {
                Reporter.ToLog(eLogLevel.ERROR, "Failed to get Test Lab with REST API", ex);
            }
            return(testlabPathList);
        }
コード例 #19
0
 public static QCRunStepColl GetRunSteps(string runId)
 {
     return(QcRestClient.GetRunSteps(runId));
 }
コード例 #20
0
 public static List <string> GetQCDomains()
 {
     return(QcRestClient.getDomainsList());
 }