private void UploadALM(string strSelectedScriptName, string strStatus, string strFailureReason, string strJenkinsLog) { string strSelectedTestSetName = treeViewALM.SelectedNode.Name; string strSelectedTestSetFullPath = BuildPath(treeViewALM.SelectedNode);; TestSetTreeManager testSetTreeMgr = (TestSetTreeManager)conn.TestSetTreeManager; TestSetFolder rootTestSetFolder = (TestSetFolder)testSetTreeMgr.get_NodeByPath(strSelectedTestSetFullPath); List testSetList = rootTestSetFolder.FindTestSets(strSelectedTestSetName, false, string.Empty); IEnumerator enumerator = testSetList.GetEnumerator();; if (enumerator.MoveNext()) { TestSet testSet = (TestSet)enumerator.Current; TSTestFactory tsTestFactory = (TSTestFactory)testSet.TSTestFactory; ListClass testList = (ListClass)tsTestFactory.NewList(string.Empty); IEnumerator testListEnum = testList.GetEnumerator(); while (testListEnum.MoveNext()) { object item = testListEnum.Current; TSTest atest = (TSTest)testListEnum.Current; if (atest.TestName.ToLower() == strSelectedScriptName.ToLower()) { atest.Status = strStatus; atest["TC_USER_01"] = strFailureReason; atest["TC_USER_09"] = strJenkinsLog; atest.Post(); } } } }
private void treeViewALM_AfterSelect(object sender, TreeViewEventArgs e) { Cursor.Current = Cursors.WaitCursor; if (e.Node.Tag != null) { if (e.Node.Tag.ToString().ToLower() == "testset") { TestSetTreeManager testSetTreeMgr = (TestSetTreeManager)conn.TestSetTreeManager; var path = BuildPath(e.Node); TestSetFolder rootTestSetFolder = (TestSetFolder)testSetTreeMgr.get_NodeByPath(path); List testSetList = rootTestSetFolder.FindTestSets(e.Node.Text, false, string.Empty); IEnumerator enumerator = testSetList.GetEnumerator(); if (enumerator.MoveNext()) { TestSet testSet = (TestSet)enumerator.Current; TSTestFactory tsTestFactory = (TSTestFactory)testSet.TSTestFactory; ListClass testList = (ListClass)tsTestFactory.NewList(string.Empty); IEnumerator testListEnum = testList.GetEnumerator(); if (dtALMTestDetails == null) { dtALMTestDetails = BuildDataTable(); } else { dtALMTestDetails.Clear(); } List TSSetFields = tsTestFactory.Fields; while (testListEnum.MoveNext()) { DataRow drTestDetails = dtALMTestDetails.NewRow(); object item = testListEnum.Current; TSTest atest = (TSTest)testListEnum.Current; drTestDetails["TestName"] = atest.TestName; drTestDetails["Status"] = atest.Status; drTestDetails["FailureReason"] = atest["TC_USER_01"]; drTestDetails["JenkinsLog"] = atest["TC_USER_09"]; dtALMTestDetails.Rows.Add(drTestDetails); } } dgvALM.DataSource = dtALMTestDetails; } else { dtALMTestDetails.Clear(); dgvALM.DataSource = dtALMTestDetails; } } else { dtALMTestDetails.Clear(); dgvALM.DataSource = dtALMTestDetails; } Cursor.Current = Cursors.Default; }
private void AddTestSetToNodes(TreeNode childNode, SysTreeNode tNode1) { TestSetFolder tsF = ((TestSetFolder)tNode1); ListClass testSetList = (ListClass)((TestSetFactory)tsF.TestSetFactory).NewList(string.Empty); IEnumerator testSetListEnum = testSetList.GetEnumerator(); while (testSetListEnum.MoveNext()) { TestSet atestset = (TestSet)testSetListEnum.Current; TreeNode tN = new TreeNode(); tN.Name = tN.Text = tN.ToolTipText = atestset.Name; tN.Tag = "testset"; childNode.Nodes.Add(tN); } }