From 358faac44b6b3e5820a3acdd927b988f0b1ba313 Mon Sep 17 00:00:00 2001 From: Folker Bernitt Date: Tue, 14 Oct 2014 13:52:29 +0200 Subject: Tried to make part of functional tests more stable. - Waiting for text change is unreliable, instead wait for Send button to disappear when sending mail --- service/test/functional/features/steps/common.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'service/test/functional/features/steps/common.py') diff --git a/service/test/functional/features/steps/common.py b/service/test/functional/features/steps/common.py index 6574d551..4d9ff79c 100644 --- a/service/test/functional/features/steps/common.py +++ b/service/test/functional/features/steps/common.py @@ -24,15 +24,17 @@ def wait_until_element_is_invisible_by_locator(context, locator_tuple): wait = WebDriverWait(context.browser, 10) wait.until(EC.invisibility_of_element_located(locator_tuple)) +def wait_until_element_is_deleted(context, locator_tuple): + wait = WebDriverWait(context.browser, 10) + wait.until(lambda s: len(s.find_elements(locator_tuple[0], locator_tuple[1])) == 0) def wait_for_user_alert_to_disapear(context): wait_until_element_is_invisible_by_locator(context, (By.ID, 'user-alerts')) - def wait_until_element_is_visible_by_locator(context, locator_tuple): wait = WebDriverWait(context.browser, 10) wait.until(EC.visibility_of_element_located(locator_tuple)) - + return context.browser.find_element(locator_tuple[0], locator_tuple[1]) def fill_by_xpath(context, xpath, text): field = context.browser.find_element_by_xpath(xpath) -- cgit v1.2.3