File tree Expand file tree Collapse file tree 3 files changed +9
-7
lines changed
TestStack.White.UITests/Scenarios Expand file tree Collapse file tree 3 files changed +9
-7
lines changed Original file line number Diff line number Diff line change 55using TestStack . White . UIItems . Finders ;
66using TestStack . White . UIItems . ListBoxItems ;
77using TestStack . White . UIItems . MenuItems ;
8+ using TestStack . White . UIItems . WindowStripControls ;
89using TestStack . White . WindowsAPI ;
910using Xunit ;
1011
@@ -64,6 +65,11 @@ public void CalculatorTests()
6465 using ( var application = Application . AttachOrLaunch ( psi ) )
6566 using ( var mainWindow = application . GetWindow ( SearchCriteria . ByText ( "Calculator" ) , InitializeOption . NoCache ) )
6667 {
68+ // Verify can click on menu twice
69+ var menuBar = mainWindow . Get < MenuBar > ( SearchCriteria . ByText ( "Application" ) ) ;
70+ menuBar . MenuItem ( "Edit" , "Copy" ) . Click ( ) ;
71+ menuBar . MenuItem ( "Edit" , "Copy" ) . Click ( ) ;
72+
6773 mainWindow . Keyboard . HoldKey ( KeyboardInput . SpecialKeys . CONTROL ) ;
6874 mainWindow . Keyboard . Enter ( "E" ) ;
6975 mainWindow . Keyboard . LeaveKey ( KeyboardInput . SpecialKeys . CONTROL ) ;
Original file line number Diff line number Diff line change 44using System . Threading ;
55using System . Windows . Automation ;
66using TestStack . White . AutomationElementSearch ;
7- using TestStack . White . Configuration ;
87using TestStack . White . Factory ;
98using TestStack . White . UIItems . Actions ;
109using TestStack . White . UIItems . Finders ;
11- using TestStack . White . Utility ;
1210
1311namespace TestStack . White . UIItems . MenuItems
1412{
Original file line number Diff line number Diff line change @@ -7,27 +7,25 @@ namespace TestStack.White.UIItems.WindowStripControls
77{
88 public class MenuBar : UIItem , MenuContainer
99 {
10- private readonly Menus topLevelMenu ;
1110 protected MenuBar ( ) { }
1211
1312 public MenuBar ( AutomationElement automationElement , ActionListener actionListener ) : base ( automationElement , actionListener )
1413 {
15- topLevelMenu = new Menus ( automationElement , actionListener ) ;
1614 }
1715
1816 public virtual Menu MenuItem ( params string [ ] path )
1917 {
20- return topLevelMenu . Find ( path ) ;
18+ return TopLevelMenu . Find ( path ) ;
2119 }
2220
2321 public virtual Menu MenuItemBy ( params SearchCriteria [ ] path )
2422 {
25- return topLevelMenu . Find ( path ) ;
23+ return TopLevelMenu . Find ( path ) ;
2624 }
2725
2826 public virtual Menus TopLevelMenu
2927 {
30- get { return topLevelMenu ; }
28+ get { return new Menus ( automationElement , actionListener ) ; }
3129 }
3230 }
3331}
You can’t perform that action at this time.
0 commit comments