From 9f673bc5193d41f615619a061fd89f9543f75149 Mon Sep 17 00:00:00 2001 From: Vadim Rutkovsky Date: Mon, 28 Apr 2014 10:06:12 -0400 Subject: tests: add necessary comboboxes in contact editor if needed --- tests/steps/addressbook_steps.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'tests') 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 -- cgit v1.2.3