Commit 0e7041e6 authored by Vadim Rutkovsky's avatar Vadim Rutkovsky

tests: correctly detect if contact editor section needs expanding

parent 6576094f
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment