aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVadim Rutkovsky <vrutkovs@redhat.com>2014-04-28 22:06:12 +0800
committerVadim Rutkovsky <vrutkovs@redhat.com>2014-04-29 00:47:00 +0800
commit9f673bc5193d41f615619a061fd89f9543f75149 (patch)
tree7837ecf57c307eab18df578999c61f4f887eafd1
parentade48aafc32c291fb80f46a67cc0fdcb7c523d5c (diff)
downloadgsoc2013-evolution-9f673bc5193d41f615619a061fd89f9543f75149.tar
gsoc2013-evolution-9f673bc5193d41f615619a061fd89f9543f75149.tar.gz
gsoc2013-evolution-9f673bc5193d41f615619a061fd89f9543f75149.tar.bz2
gsoc2013-evolution-9f673bc5193d41f615619a061fd89f9543f75149.tar.lz
gsoc2013-evolution-9f673bc5193d41f615619a061fd89f9543f75149.tar.xz
gsoc2013-evolution-9f673bc5193d41f615619a061fd89f9543f75149.tar.zst
gsoc2013-evolution-9f673bc5193d41f615619a061fd89f9543f75149.zip
tests: add necessary comboboxes in contact editor if needed
-rw-r--r--tests/steps/addressbook_steps.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/tests/steps/addressbook_steps.py b/tests/steps/addressbook_steps.py
index 3249d3cff4..d515be5da5 100644
--- a/tests/steps/addressbook_steps.py
+++ b/tests/steps/addressbook_steps.py
@@ -255,8 +255,8 @@ def get_combobox_textbox_object(contact_editor, section):
correct_textbox = min(matching_textboxes, key=lambda x: x.position[0])
result.append((combo, correct_textbox))
- comboboxes = [x[0] for x in result]
- textboxes = [x[1] for x in result]
+ comboboxes = [x[0] for x in result][::-1]
+ textboxes = [x[1] for x in result][::-1]
return (textboxes, comboboxes)
@@ -271,6 +271,12 @@ def set_contact_emails_to_value(context, section):
textbox.text = ""
for index, row in enumerate(context.table.rows):
+ # Check that we have sufficient amount of textboxes
+ # If not - click plus buttons until we have enough
+ if index == len(textboxes):
+ textboxes[0].parent.child(roleName="push button").click()
+ (textboxes, comboboxes) = get_combobox_textbox_object(
+ context.app.contact_editor, section)
textboxes[index].text = row['Value']
if comboboxes[index].combovalue != row['Field']:
comboboxes[index].combovalue = row['Field']
@@ -368,4 +374,4 @@ def set_field_in_section_to_value(context, field_name, section, field_value):
if element.roleName == "text":
element.text = field_value
elif element.roleName == "combo box":
- element.combovalue = field_value \ No newline at end of file
+ element.combovalue = field_value