summaryrefslogtreecommitdiff
path: root/service/test/functional/features/steps/tag_list.py
diff options
context:
space:
mode:
authorFolker Bernitt <fbernitt@thoughtworks.com>2015-09-11 17:22:02 +0200
committerFolker Bernitt <fbernitt@thoughtworks.com>2015-09-11 17:22:02 +0200
commitcf9cc7f7ca0cf882056d8dff506f2c1edf824bfe (patch)
treee7508cc457d0e4de13b5ecf4b8ace9dccffa9f2d /service/test/functional/features/steps/tag_list.py
parent641114a140713fdf75174518b8fae5e0146499cd (diff)
Another attempt to make side nav more reliable
- Issue #456 - Also added action chain for search
Diffstat (limited to 'service/test/functional/features/steps/tag_list.py')
-rw-r--r--service/test/functional/features/steps/tag_list.py26
1 files changed, 15 insertions, 11 deletions
diff --git a/service/test/functional/features/steps/tag_list.py b/service/test/functional/features/steps/tag_list.py
index 6bf50d6d..a3315835 100644
--- a/service/test/functional/features/steps/tag_list.py
+++ b/service/test/functional/features/steps/tag_list.py
@@ -33,26 +33,30 @@ def expand_side_nav(context):
toggle = find_element_by_class_name(context, 'side-nav-toggle')
toggle.click()
- wait_for_browser_javascript_execution(context)
-
@when('I select the tag \'{tag}\'')
def impl(context, tag):
wait_for_user_alert_to_disapear(context)
expand_side_nav(context)
- wait_until_element_is_visible_by_locator(context, (By.ID, 'tag-%s' % tag), timeout=20)
-
- wait_for_browser_javascript_execution(context)
-
- e = find_element_by_id(context, 'tag-%s' % tag)
- e.click()
+ # try this multiple times as there are some race conditions
+ try_again = 2
+ success = False
+ while (not success) and (try_again > 0):
+ try:
+ wait_until_element_is_visible_by_locator(context, (By.ID, 'tag-%s' % tag), timeout=20)
- wait_until_element_is_visible_by_locator(context, (By.CSS_SELECTOR, "#mail-list li span a[href*='%s']" % tag), timeout=20)
+ e = find_element_by_id(context, 'tag-%s' % tag)
+ e.click()
+ wait_until_element_is_visible_by_locator(context, (By.CSS_SELECTOR, "#mail-list li span a[href*='%s']" % tag), timeout=20)
+ success = True
+ except TimeoutException:
+ pass
+ finally:
+ try_again -= 1
-def wait_for_browser_javascript_execution(context):
- context.browser.execute_script('true') # execute something so that page hopefully is rendered
+ assert success
@when('I am in \'{tag}\'')