diff options
author | Vadim Rutkovsky <vrutkovs@redhat.com> | 2014-04-11 08:01:20 +0800 |
---|---|---|
committer | Vadim Rutkovsky <vrutkovs@redhat.com> | 2014-04-11 08:04:11 +0800 |
commit | fdaabeb412fa52bda00d6c247804b5910dff9871 (patch) | |
tree | 0a8df8cc0c8f9c3b169f82efbbe6b5e64cf95e89 /tests | |
parent | 53eab69bcfcbaa0e6fe730cebc88d7fce00ec770 (diff) | |
download | gsoc2013-evolution-fdaabeb412fa52bda00d6c247804b5910dff9871.tar gsoc2013-evolution-fdaabeb412fa52bda00d6c247804b5910dff9871.tar.gz gsoc2013-evolution-fdaabeb412fa52bda00d6c247804b5910dff9871.tar.bz2 gsoc2013-evolution-fdaabeb412fa52bda00d6c247804b5910dff9871.tar.lz gsoc2013-evolution-fdaabeb412fa52bda00d6c247804b5910dff9871.tar.xz gsoc2013-evolution-fdaabeb412fa52bda00d6c247804b5910dff9871.tar.zst gsoc2013-evolution-fdaabeb412fa52bda00d6c247804b5910dff9871.zip |
tests: initial setup: rewrite Next/Continue button detection
Diffstat (limited to 'tests')
-rw-r--r-- | tests/steps/initial_setup_steps.py | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/tests/steps/initial_setup_steps.py b/tests/steps/initial_setup_steps.py index 2199c3f618..caecfc62bd 100644 --- a/tests/steps/initial_setup_steps.py +++ b/tests/steps/initial_setup_steps.py @@ -1,7 +1,7 @@ # -*- coding: UTF-8 -*- from behave import step -from common_steps import wait_until, check_for_errors +from common_steps import check_for_errors from dogtail.tree import root from os import system from pyatspi import STATE_SENSITIVE @@ -67,17 +67,12 @@ def wait_for_account_to_be_looked_up(context): def click_next(window): # As initial wizard dialog creates a bunch of 'Next' buttons # We have to click to the visible and enabled one - button = None - for attempt in xrange(0, 10): - btns = window.findChildren(lambda x: x.name == 'Next') - visible_and_enabled = [x for x in btns if x.showing and STATE_SENSITIVE in x.getState().getStates()] - if visible_and_enabled == []: - sleep(0.1) - continue - else: - button = visible_and_enabled[0] - break - button.click() + buttons = window.findChildren(lambda x: x.name == 'Next' and x.showing and + STATE_SENSITIVE in x.getState().getStates()) + if buttons == []: + raise Exception("Enabled Next button was not found") + else: + buttons[0].click() @step(u'Complete {sending_or_receiving} Email dialog of Evolution Account Assistant setting') |