From 641114a140713fdf75174518b8fae5e0146499cd Mon Sep 17 00:00:00 2001 From: Folker Bernitt Date: Fri, 11 Sep 2015 16:33:29 +0200 Subject: Wait for click handler to become available - Issue #456 --- service/test/functional/features/steps/tag_list.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/service/test/functional/features/steps/tag_list.py b/service/test/functional/features/steps/tag_list.py index a715dc67..6bf50d6d 100644 --- a/service/test/functional/features/steps/tag_list.py +++ b/service/test/functional/features/steps/tag_list.py @@ -33,7 +33,7 @@ def expand_side_nav(context): toggle = find_element_by_class_name(context, 'side-nav-toggle') toggle.click() - context.browser.execute_script('true') # execute something so that page hopefully is rendered + wait_for_browser_javascript_execution(context) @when('I select the tag \'{tag}\'') @@ -43,11 +43,18 @@ def impl(context, tag): 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() + wait_until_element_is_visible_by_locator(context, (By.CSS_SELECTOR, "#mail-list li span a[href*='%s']" % tag), timeout=20) +def wait_for_browser_javascript_execution(context): + context.browser.execute_script('true') # execute something so that page hopefully is rendered + + @when('I am in \'{tag}\'') def impl(context, tag): expand_side_nav(context) -- cgit v1.2.3