Beispiel #1
0
        public ObservableList <RQMTestCase> BuildRQMTestCaseList(XmlNodeList testCases, XmlNamespaceManager nsmgr, LoginDTO loginData, RQMProject currentRQMProjectMapping, XmlReader reader, string TestSuiteTitle, string TestSuiteId)
        {
            ObservableList <RQMTestCase> RQMTestCaseList = new ObservableList <RQMTestCase>();

            foreach (XmlNode testCase in testCases)
            {
                RqmResponseData responseDataTC = RQMRep.GetRqmResponse(loginData, new Uri(testCase.Attributes[0].InnerText.ToString()));
                XmlDocument     doc            = new XmlDocument();
                XmlDocument     docTC          = new XmlDocument();
                doc.LoadXml(responseDataTC.responseText.ToString());
                nsmgr = new XmlNamespaceManager(reader.NameTable);
                currentRQMProjectMapping.RQMTestCaseMapping.RQMNameSpaces.RQMNameSpaceList.ForEach(y => nsmgr.AddNamespace(y.RQMNameSpacePrefix, y.RQMNameSpaceName));
                XmlNode responseDataNodeTC = doc.DocumentElement;

                RQMTestCase rQMTestCase = new RQMTestCase(responseDataNodeTC.SelectSingleNode(currentRQMProjectMapping.RQMTestCaseMapping.Name, nsmgr).InnerText.ToString(),
                                                          responseDataNodeTC.SelectSingleNode(currentRQMProjectMapping.RQMTestCaseMapping.RQMID, nsmgr).InnerText.ToString(),
                                                          responseDataNodeTC.SelectSingleNode(currentRQMProjectMapping.RQMTestCaseMapping.Description, nsmgr).InnerText.ToString(),
                                                          responseDataNodeTC.SelectSingleNode(currentRQMProjectMapping.RQMTestCaseMapping.CreatedBy, nsmgr).Attributes[0].InnerText.Split('/').Last().ToString(),
                                                          DateTime.Parse(responseDataNodeTC.SelectSingleNode(currentRQMProjectMapping.RQMTestCaseMapping.CreationDate, nsmgr).InnerText.ToString()).ToLocalTime(),
                                                          TestSuiteTitle,
                                                          TestSuiteId);

                try
                {
                    XmlNodeList variables = responseDataNodeTC.SelectNodes(currentRQMProjectMapping.RQMTestCaseMapping.XMLPathToVariablesList, nsmgr);
                    foreach (XmlNode variable in variables)
                    {
                        // looking for specific Variable from BTS
                        if (variable.SelectSingleNode(currentRQMProjectMapping.RQMTestCaseMapping.VariableName, nsmgr).InnerText.ToString() == BTS_ACTIVITY_ID)
                        {
                            rQMTestCase.BTSID = variable.SelectSingleNode(currentRQMProjectMapping.RQMTestCaseMapping.VariableValue, nsmgr).InnerText.ToString();
                            continue;
                        }

                        RQMTestParameter rQMTestParameter;
                        rQMTestParameter = new RQMTestParameter(variable.SelectSingleNode(currentRQMProjectMapping.RQMTestCaseMapping.VariableName, nsmgr).InnerText.ToString(),
                                                                variable.SelectSingleNode(currentRQMProjectMapping.RQMTestCaseMapping.VariableValue, nsmgr).InnerText.ToString());
                        rQMTestCase.Parameters.Add(rQMTestParameter);
                    }
                }
                catch { }

                XmlNodeList testScripts = responseDataNodeTC.SelectNodes(currentRQMProjectMapping.RQMTestCaseMapping.PathXML, nsmgr);
                foreach (XmlNode testScript in testScripts)
                {
                    RqmResponseData responseDataTestScript = RQMRep.GetRqmResponse(loginData, new Uri(testScript.Attributes[0].InnerText.ToString()));
                    doc.LoadXml(responseDataTestScript.responseText.ToString());
                    nsmgr = new XmlNamespaceManager(reader.NameTable);
                    currentRQMProjectMapping.RQMTestScriptMapping.RQMNameSpaces.RQMNameSpaceList.ForEach(y => nsmgr.AddNamespace(y.RQMNameSpacePrefix, y.RQMNameSpaceName));
                    XmlNode responseDataNodeTestScript = doc.DocumentElement;

                    RQMTestScript newRQMTestScript = new RQMTestScript(responseDataNodeTestScript.SelectSingleNode(currentRQMProjectMapping.RQMTestScriptMapping.Name, nsmgr).InnerText.ToString(),
                                                                       responseDataNodeTestScript.SelectSingleNode(currentRQMProjectMapping.RQMTestScriptMapping.RQMID, nsmgr).InnerText.ToString(),
                                                                       responseDataNodeTestScript.SelectSingleNode(currentRQMProjectMapping.RQMTestScriptMapping.Description, nsmgr).InnerText.ToString(),
                                                                       responseDataNodeTestScript.SelectSingleNode(currentRQMProjectMapping.RQMTestScriptMapping.CreatedBy, nsmgr).Attributes[0].InnerText.Split('/').Last().ToString(),
                                                                       DateTime.Parse(responseDataNodeTestScript.SelectSingleNode(currentRQMProjectMapping.RQMTestScriptMapping.CreationDate, nsmgr).InnerText.ToString()).ToLocalTime());

                    try
                    {
                        XmlNodeList variables = responseDataNodeTestScript.SelectNodes(currentRQMProjectMapping.RQMTestScriptMapping.XMLPathToVariablesList, nsmgr);
                        foreach (XmlNode variable in variables)
                        {
                            // looking for specific Variable from BTS
                            if (variable.SelectSingleNode(currentRQMProjectMapping.RQMTestScriptMapping.VariableName, nsmgr).InnerText.ToString() == BTS_ACTIVITY_STEPS_ID)
                            {
                                newRQMTestScript.BTSStepsIDs = variable.SelectSingleNode(currentRQMProjectMapping.RQMTestScriptMapping.VariableValue, nsmgr).InnerText.ToString();
                                continue;
                            }

                            RQMTestParameter rQMTestParameter;
                            rQMTestParameter = new RQMTestParameter(variable.SelectSingleNode(currentRQMProjectMapping.RQMTestScriptMapping.VariableName, nsmgr).InnerText.ToString(),
                                                                    variable.SelectSingleNode(currentRQMProjectMapping.RQMTestScriptMapping.VariableValue, nsmgr).InnerText.ToString());
                            newRQMTestScript.Parameters.Add(rQMTestParameter);
                        }
                    }
                    catch { }

                    XmlNodeList steps = responseDataNodeTestScript.SelectNodes(currentRQMProjectMapping.RQMTestScriptMapping.PathXML, nsmgr);
                    foreach (XmlNode step in steps)
                    {
                        RQMStep newStep;
                        try
                        {
                            newStep = new RQMStep(step.SelectSingleNode(currentRQMProjectMapping.RQMStepMapping.Name, nsmgr).InnerText.ToString(),
                                                  responseDataNodeTestScript.SelectSingleNode(currentRQMProjectMapping.RQMTestScriptMapping.RQMID, nsmgr).InnerText.ToString() + "_" + step.Attributes[0].InnerText.ToString(),
                                                  ImportFromRQM.StripHTML(step.SelectSingleNode(currentRQMProjectMapping.RQMStepMapping.Description, nsmgr).InnerText.ToString()),
                                                  ImportFromRQM.StripHTML(step.SelectSingleNode(currentRQMProjectMapping.RQMStepMapping.ExpectedResult, nsmgr).InnerText.ToString()));
                            newRQMTestScript.Steps.Add(newStep);
                        }
                        catch
                        {
                            try
                            {
                                newStep = new RQMStep(step.SelectSingleNode(currentRQMProjectMapping.RQMStepMapping.Name, nsmgr).InnerText.ToString(),
                                                      responseDataNodeTestScript.SelectSingleNode(currentRQMProjectMapping.RQMTestScriptMapping.RQMID, nsmgr).InnerText.ToString() + "_" + step.Attributes[0].InnerText.ToString(),
                                                      ImportFromRQM.StripHTML(step.SelectSingleNode(currentRQMProjectMapping.RQMStepMapping.Description, nsmgr).InnerText.ToString()),
                                                      string.Empty);
                                newRQMTestScript.Steps.Add(newStep);
                            }
                            catch { }
                        }
                    }

                    rQMTestCase.TestScripts.Add(newRQMTestScript);

                    if (rQMTestCase.TestScripts.Count > 0)
                    {
                        rQMTestCase.SelectedTestScriptName = rQMTestCase.TestScripts[0].Name.ToString();
                    }
                }

                RQMTestCaseList.Add(rQMTestCase);
            }
            return(RQMTestCaseList);
        }
Beispiel #2
0
 public BusinessFlow ConvertRQMTestPlanToBF(RQMTestPlan testPlan)
 {
     return(ImportFromRQM.ConvertRQMTestPlanToBF(testPlan));
 }
Beispiel #3
0
 public void UpdateBusinessFlow(ref BusinessFlow busFlow, RQMTestPlan testPlan)
 {
     ImportFromRQM.UpdateBusinessFlow(ref busFlow, testPlan);
 }
Beispiel #4
0
 public void UpdatedRQMTestInBF(ref BusinessFlow busFlow, RQMTestPlan testPlan, List <string> TCsIDs)
 {
     ImportFromRQM.UpdatedRQMTestInBF(ref busFlow, testPlan, TCsIDs);
 }
Beispiel #5
0
 public override ObservableList <ExternalItemFieldBase> GetALMItemFields(BackgroundWorker bw, bool online, ALM_Common.DataContracts.ResourceType resourceType)
 {
     return(UpdatedAlmFields(ImportFromRQM.GetALMItemFields(bw, online)));
 }
Beispiel #6
0
 public override ObservableList <ExternalItemFieldBase> GetALMItemFields(BackgroundWorker bw, bool online, bool useREST)
 {
     return(ImportFromRQM.GetALMItemFields(bw, online));
 }