Skip to content

Commit

Permalink
Revert #221 as it is causing more problems
Browse files Browse the repository at this point in the history
  • Loading branch information
Jake Ginnivan committed Jun 10, 2014
1 parent 4bc6145 commit d7cf2bf
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ public virtual AutomationElement AutomationElement

public virtual List<AutomationElement> Children(params AutomationSearchCondition[] automationSearchConditions)
{
return new MultiLevelAutomationElementFinder(automationSearchConditions).FindAll(automationElement).Cast<AutomationElement>().ToList();
return new MultiLevelAutomationElementFinder(automationSearchConditions)
.FindAll(automationElement);
}

public virtual AutomationElement Child(params AutomationSearchCondition[] automationSearchConditions)
Expand Down
23 changes: 14 additions & 9 deletions src/TestStack.White/UIItems/WindowItems/Win32Window.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,20 @@ public override Window ModalWindow(string title, InitializeOption option)
WindowSession.ModalWindowSession(option));
}

public override List<Window> ModalWindows()
{
var descendants = new AutomationElementFinder(automationElement)
.Children(new AutomationSearchConditionFactory().GetWindowSearchConditions(automationElement.Current.ProcessId).ToArray());

return descendants
.Select(descendant => ChildWindowFactory.Create(descendant, InitializeOption.NoCache, WindowSession.ModalWindowSession(InitializeOption.NoCache)))
.ToList();
}
//TODO Try and get this working
//public override List<Window> ModalWindows()
//{
// var automationSearchConditions = new AutomationSearchConditionFactory()
// .GetWindowSearchConditions(automationElement.Current.ProcessId)
// .ToArray();

// var descendants = new AutomationElementFinder(automationElement)
// .Children(automationSearchConditions);

// return descendants
// .Select(descendant => ChildWindowFactory.Create(descendant, InitializeOption.NoCache, WindowSession.ModalWindowSession(InitializeOption.NoCache)))
// .ToList();
//}

public override Window ModalWindow(SearchCriteria searchCriteria, InitializeOption option)
{
Expand Down

0 comments on commit d7cf2bf

Please sign in to comment.