[evolution] tests: correctly detect if contact editor section needs expanding



commit 0e7041e60629f31e1c72210d7b59c4437d17a292
Author: Vadim Rutkovsky <vrutkovs redhat com>
Date:   Wed Jun 11 13:01:18 2014 +0200

    tests: correctly detect if contact editor section needs expanding

 tests/steps/addressbook_steps.py |   17 ++++++++---------
 1 files changed, 8 insertions(+), 9 deletions(-)
---
diff --git a/tests/steps/addressbook_steps.py b/tests/steps/addressbook_steps.py
index 64bfc5a..0019828 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


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]