diff options
author | Tiago Ferraz <tiago.ferraz@gmail.com> | 2015-03-09 16:14:50 -0300 |
---|---|---|
committer | Tiago Ferraz <tiago.ferraz@gmail.com> | 2015-03-09 16:14:50 -0300 |
commit | 6b5de66fc5adc3c62a92738e9f317c4b1335f838 (patch) | |
tree | 09ad2b63806e9f72f10fee0c7e6825578ff4cd69 /service/test/functional/features/steps/tag_list.py | |
parent | a9a8a7330756d2fe9b6607dc670841b0ecfa64c5 (diff) |
Refactoring of fuctional tests
The scenarios were updated to follow the conventions of gherkin steps.
Removal of duplicated code.
Diffstat (limited to 'service/test/functional/features/steps/tag_list.py')
-rw-r--r-- | service/test/functional/features/steps/tag_list.py | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/service/test/functional/features/steps/tag_list.py b/service/test/functional/features/steps/tag_list.py index c50387f0..348b121a 100644 --- a/service/test/functional/features/steps/tag_list.py +++ b/service/test/functional/features/steps/tag_list.py @@ -22,27 +22,24 @@ def click_first_element_with_class(context, classname): def is_side_nax_expanded(context): - return context.browser.find_elements_by_class_name('content')[0].get_attribute('class').count(u'move-right') == 1 + e = context.browser.find_elements_by_class_name('content')[0].get_attribute('class').count(u'move-right') == 1 + return e -def ensure_side_nav_is_expanded(context): +def expand_side_nav(context): if is_side_nax_expanded(context): return toggle = context.browser.find_elements_by_class_name('side-nav-toggle')[0] toggle.click() - wait = WebDriverWait(context, 5) - wait.until(is_side_nax_expanded) - @when('I select the tag \'{tag}\'') def impl(context, tag): wait_for_user_alert_to_disapear(context) + expand_side_nav(context) - ensure_side_nav_is_expanded(context) - - wait_until_element_is_visible_by_locator(context, (By.ID, 'tag-%s' % tag.lower()), 20) + wait_until_element_is_visible_by_locator(context, (By.ID, 'tag-%s' % tag), 20) e = find_element_by_id(context, 'tag-%s' % tag.lower()) e.click() |