diff options
author | Tulio Casagrande <tcasagra@thoughtworks.com> | 2016-12-14 14:49:23 -0200 |
---|---|---|
committer | Tulio Casagrande <tcasagra@thoughtworks.com> | 2016-12-14 14:57:49 -0200 |
commit | 66a01bde2bd8c54fd830ff94443fc860a549bc3c (patch) | |
tree | 83cb8dd4a6f93f50356b8fb7732f1a4a2ae62c93 /service/test/functional/features/steps/mail_view.py | |
parent | d14cfaa1f970b623c52f0f892980057c4c81308c (diff) |
Move functional tests to find elements with waits
We were using the Selenium native find_element in a few places, which
could raise a TimeoutException. I changed to use our timed out version
and also renamed the internal methods to prevent misuse
Diffstat (limited to 'service/test/functional/features/steps/mail_view.py')
-rw-r--r-- | service/test/functional/features/steps/mail_view.py | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/service/test/functional/features/steps/mail_view.py b/service/test/functional/features/steps/mail_view.py index 88ee5c5a..65959b70 100644 --- a/service/test/functional/features/steps/mail_view.py +++ b/service/test/functional/features/steps/mail_view.py @@ -16,15 +16,13 @@ from behave import then, when from selenium.webdriver.common.keys import Keys -from selenium.webdriver.common.by import By from common import ( click_button, find_element_by_css_selector, find_elements_by_css_selector, reply_subject, - wait_until_button_is_visible, - wait_until_element_is_visible_by_locator) + wait_until_button_is_visible) @then('I see that the subject reads \'{subject}\'') @@ -44,7 +42,7 @@ def impl(context, expected_body): @then('that email has the \'{tag}\' tag') def impl(context, tag): - wait_until_element_is_visible_by_locator(context, (By.CSS_SELECTOR, '#mail-view .tagsArea .tag')) + find_element_by_css_selector(context, '#mail-view .tagsArea .tag') elements = find_elements_by_css_selector(context, '#mail-view .tagsArea .tag') tags = [e.text for e in elements] assert tag in tags @@ -52,13 +50,13 @@ def impl(context, tag): @when('I add the tag \'{tag}\' to that mail') def impl(context, tag): - b = wait_until_element_is_visible_by_locator(context, (By.ID, 'new-tag-button')) + b = find_element_by_css_selector(context, '#new-tag-button') b.click() - e = wait_until_element_is_visible_by_locator(context, (By.ID, 'new-tag-input')) + e = find_element_by_css_selector(context, '#new-tag-input') e.send_keys(tag) e.send_keys(Keys.ENTER) - wait_until_element_is_visible_by_locator(context, (By.CSS_SELECTOR, 'li[data-tag=%s]' % tag)) + find_element_by_css_selector(context, 'li[data-tag=%s]' % tag) @when('I reply to it') |