Skip to content

Commit

Permalink
Hopefully fixing issue TestStack#165
Browse files Browse the repository at this point in the history
  • Loading branch information
Jake Ginnivan committed Feb 9, 2014
1 parent 49a61c4 commit 03b3e74
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/TestStack.White/UIItems/WindowItems/Win32Window.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Windows.Automation;
using TestStack.White.AutomationElementSearch;
using TestStack.White.Factory;
using TestStack.White.Sessions;
using TestStack.White.UIItems.Finders;
Expand Down Expand Up @@ -36,6 +39,16 @@ 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();
}

public override Window ModalWindow(SearchCriteria searchCriteria, InitializeOption option)
{
return windowFactory.ModalWindow(searchCriteria, option, WindowSession.ModalWindowSession(option));
Expand Down

0 comments on commit 03b3e74

Please sign in to comment.