From 0e7041e60629f31e1c72210d7b59c4437d17a292 Mon Sep 17 00:00:00 2001 From: Vadim Rutkovsky Date: Wed, 11 Jun 2014 13:01:18 +0200 Subject: tests: correctly detect if contact editor section needs expanding --- tests/steps/addressbook_steps.py | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'tests') diff --git a/tests/steps/addressbook_steps.py b/tests/steps/addressbook_steps.py index 64bfc5a673..00198286af 100644 --- a/tests/steps/addressbook_steps.py +++ b/tests/steps/addressbook_steps.py @@ -237,16 +237,7 @@ def get_combobox_textbox_object(contact_editor, section, scroll_to_bottom=True): panel = lbl.findAncestor(GenericPredicate(roleName='panel')) textboxes = panel.findChildren(GenericPredicate(roleName='text')) - # Expand section if button exists - button = panel.findChild( - GenericPredicate(roleName='push button', name=section), - retry=False, requireResult=False) - # Expand button if any of textboxes is not visible - if button and (False in [x.showing for x in textboxes]): - button.click() - # Scroll to the bottom of the page if needed - pagetab = panel.findAncestor(GenericPredicate(roleName='page tab')) for scroll in pagetab.findChildren(lambda x: x.roleName == 'scroll bar'): if scroll_to_bottom: @@ -254,6 +245,14 @@ def get_combobox_textbox_object(contact_editor, section, scroll_to_bottom=True): else: scroll.value = 0 + # Expand section if button exists + button = panel.findChild( + GenericPredicate(roleName='push button', name=section), + retry=False, requireResult=False) + # Expand button if any of textboxes is not visible + if button and (False in [x.showing for x in textboxes]): + button.click() + comboboxes = panel.findChildren(GenericPredicate(roleName='combo box')) # Rearrange comboboxes and textboxes according to their position -- cgit v1.2.3