Index: System tests/AutomatedSystemTests/AutomatedSystemTests/Modules/Calculation/CalculateStructureProjectExplorerNode.cs =================================================================== diff -u -r012448ea4d8f8e97204b87b3d22a7999629fe632 -r73e7ef904993ee1d5be013e42334ec0244131f83 --- System tests/AutomatedSystemTests/AutomatedSystemTests/Modules/Calculation/CalculateStructureProjectExplorerNode.cs (.../CalculateStructureProjectExplorerNode.cs) (revision 012448ea4d8f8e97204b87b3d22a7999629fe632) +++ System tests/AutomatedSystemTests/AutomatedSystemTests/Modules/Calculation/CalculateStructureProjectExplorerNode.cs (.../CalculateStructureProjectExplorerNode.cs) (revision 73e7ef904993ee1d5be013e42334ec0244131f83) @@ -63,46 +63,13 @@ /// that will in turn invoke this method. void ITestModule.Run() { - Mouse.DefaultMoveTime = 0; - Keyboard.DefaultKeyPressTime = 0; - Delay.SpeedFactor = 0.0; - + string path = pathToNodeInProjectExplorer.ReplacePathAliases(); AutomatedSystemTestsRepository myRepository = global::AutomatedSystemTests.AutomatedSystemTestsRepository.Instance; - RepoItemInfo rootNodeProject = myRepository.RiskeerMainWindow.ProjectExplorerPanel.TrajectNode.SelfInfo; - //TreeItem nodeTreeItem = GetNodeInProjectExplorerGivenPath(pathToNodeInProjectExplorer, rootNodeProject); - TreeItem nodeTreeItem = TreeItemHelpers.FindNodeInTree(pathToNodeInProjectExplorer, rootNodeProject, (ti)=>{}); + TreeItem nodeTreeItem = TreeItemHelpers.FindNodeInTree(path, rootNodeProject, (ti)=>{}); structureNode = GetStructureTreeItem(nodeTreeItem); } - private TreeItem GetNodeInProjectExplorerGivenPath(string pathItem, RepoItemInfo rootNodeInfo) - { - var stepsPathItem = pathItem.Split('>').ToList(); - var children = rootNodeInfo.FindAdapter().Children; - // start up variable stepChild - TreeItem stepChild = children[0].As(); - - - for (int i=0; i < stepsPathItem.Count; i++) { - // Find the item corresponding to the step - var step = stepsPathItem[i]; - if (children.Count(ch => ch.ToString().Contains(step))==1) - { - Report.Log(ReportLevel.Info, "Information", "Only one occurrence of '" + step + "' found: choosing item containing the string in its name."); - stepChild = children.FirstOrDefault(ch => ch.ToString().Contains(step)).As(); - } else { - Report.Log(ReportLevel.Info, "Information", "Multiple occurrences of '" + step + "' found: choosing item with this exact name."); - stepChild = children.FirstOrDefault(ch => NameOfTreeItem(ch.As())==step).As(); - } - if (i != stepsPathItem.Count - 1) - { - // Update the children - children = stepChild.Children; - } - } - return stepChild; - } - private string NameOfTreeItem(object treeItemInfo) { return treeItemInfo.ToString().Substring(10, treeItemInfo.ToString().Length-11);