Skip to content

Commit

Permalink
unittests: stabilize TaskbarTestCases.testClickVisibleIcon
Browse files Browse the repository at this point in the history
  • Loading branch information
airelil committed Jan 17, 2020
1 parent 3352a63 commit 977f0a0
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pywinauto/unittests/test_taskbar.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,12 @@ def testClickVisibleIcon(self):
def _show_popup_menu():
taskbar.explorer_app.wait_cpu_usage_lower(threshold=5, timeout=self.tm)
taskbar.RightClickSystemTrayIcon('MFCTrayDemo')
menu = self.app.top_window().children()[0]
children = self.app.top_window().children()
if not children:
# Somehow, we ended up with a dialog - parent of the menu
menu = self.app.windows(visible=True)[0].children()[0]
else:
menu = children[0]
res = isinstance(menu, ToolbarWrapper) and menu.is_visible()
menu_window[0] = menu
return res
Expand Down

0 comments on commit 977f0a0

Please sign in to comment.