@@ -18,35 +18,34 @@ public async Task OpenCheckmarxWindow()
1818 {
1919 // Find the View menu
2020 var viewMenu = _mainWindow . FindFirstDescendant ( cf => cf . ByName ( "View" ) ) ;
21- if ( viewMenu != null )
22- {
23- // Open the "View" menu by clicking it
24- viewMenu . WaitUntilEnabled ( ) . Click ( ) ;
25- await Task . Delay ( 500 ) ;
21+ Assert . IsNotNull ( viewMenu , "View menu not found" ) ;
22+
23+ // Open the "View" menu by clicking it
24+ viewMenu . WaitUntilEnabled ( ) . Click ( ) ;
25+ await Task . Delay ( 500 ) ;
2626
27- var allMenuItems = _mainWindow . FindAllDescendants ( cf =>
28- cf . ByControlType ( FlaUI . Core . Definitions . ControlType . MenuItem ) ) ;
29- bool foundOtherWindows = false ;
27+ var allMenuItems = _mainWindow . FindAllDescendants ( cf =>
28+ cf . ByControlType ( FlaUI . Core . Definitions . ControlType . MenuItem ) ) ;
29+ bool foundOtherWindows = false ;
3030
3131
32- foreach ( var menuItem in allMenuItems )
32+ foreach ( var menuItem in allMenuItems )
33+ {
34+ if ( menuItem . Name == "Other Windows" )
3335 {
34- if ( menuItem . Name == "Other Windows" )
35- {
36- foundOtherWindows = true ;
37- menuItem . WaitUntilEnabled ( ) . Click ( ) ;
38- await Task . Delay ( 1000 ) ;
39-
40- // Now select a specific window from the list "Checkmarx"
41- var checkmarxOption = _mainWindow . FindFirstDescendant ( cf => cf . ByName ( "Checkmarx" ) ) ;
42- Assert . IsNotNull ( checkmarxOption , "Checkmarx option not found in Other Windows menu" ) ;
43- checkmarxOption . WaitUntilEnabled ( ) . Click ( ) ;
44- break ;
45- }
46- }
47- Assert . IsTrue ( foundOtherWindows , "Other Windows menu item not found" ) ;
36+ foundOtherWindows = true ;
37+ menuItem . WaitUntilEnabled ( ) . Click ( ) ;
38+ await Task . Delay ( 1000 ) ;
4839
40+ // Now select a specific window from the list "Checkmarx"
41+ var checkmarxOption = _mainWindow . FindFirstDescendant ( cf => cf . ByName ( "Checkmarx" ) ) ;
42+ Assert . IsNotNull ( checkmarxOption , "Checkmarx option not found in Other Windows menu" ) ;
43+ checkmarxOption . WaitUntilEnabled ( ) . Click ( ) ;
44+ break ;
45+ }
4946 }
47+ Assert . IsTrue ( foundOtherWindows , "Other Windows menu item not found" ) ;
48+
5049 }
5150 }
52- }
51+ }
0 commit comments