From 9b8d8c46326a6d381f0440c37f7e8a91deec49c6 Mon Sep 17 00:00:00 2001 From: Felix Hammerl Date: Wed, 23 Mar 2016 13:55:25 +0100 Subject: Issue #648: Refactor mail-list --- service/test/functional/features/steps/common.py | 2 +- service/test/functional/features/steps/mail_list.py | 10 +++++----- service/test/functional/features/steps/tag_list.py | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) (limited to 'service') diff --git a/service/test/functional/features/steps/common.py b/service/test/functional/features/steps/common.py index 21794eb7..ccad842c 100644 --- a/service/test/functional/features/steps/common.py +++ b/service/test/functional/features/steps/common.py @@ -168,7 +168,7 @@ def click_button(context, title, element='button'): def mail_list_with_subject_exists(context, subject): - return find_element_by_xpath(context, "//*[@class='subject' and contains(.,'%s')]" % subject) + return find_element_by_xpath(context, "//*[@class='mail-list-entry__item-subject' and contains(.,'%s')]" % subject) def mail_subject(context): diff --git a/service/test/functional/features/steps/mail_list.py b/service/test/functional/features/steps/mail_list.py index d19de6cd..82faa7af 100644 --- a/service/test/functional/features/steps/mail_list.py +++ b/service/test/functional/features/steps/mail_list.py @@ -32,7 +32,7 @@ def open_current_mail(context): def get_first_email(context): - return wait_until_elements_are_visible_by_locator(context, (By.CSS_SELECTOR, '#mail-list li span a'))[0] + return wait_until_elements_are_visible_by_locator(context, (By.CSS_SELECTOR, '.mail-list-entry__item'))[0] @then('I see that mail under the \'{tag}\' tag') @@ -78,13 +78,13 @@ def impl(context): @given('I have mails') @then(u'I have mails') def impl(context): - emails = wait_until_elements_are_visible_by_locator(context, (By.CSS_SELECTOR, '#mail-list li span a')) + emails = wait_until_elements_are_visible_by_locator(context, (By.CSS_SELECTOR, '.mail-list-entry__item')) assert len(emails) > 0 @when('I mark the first unread email as read') def impl(context): - emails = wait_until_elements_are_visible_by_locator(context, (By.CSS_SELECTOR, '#mail-list li')) + emails = wait_until_elements_are_visible_by_locator(context, (By.CSS_SELECTOR, '.mail-list-entry')) for email in emails: if 'status-read' not in email.get_attribute('class'): @@ -98,7 +98,7 @@ def impl(context): @when('I delete the email') def impl(context): def last_email(): - return wait_until_element_is_visible_by_locator(context, (By.CSS_SELECTOR, '#mail-list li')) + return wait_until_element_is_visible_by_locator(context, (By.CSS_SELECTOR, '.mail-list-entry')) mail = last_email() context.current_mail_id = mail.get_attribute('id') mail.find_element_by_tag_name('input').click() @@ -112,7 +112,7 @@ def _wait_for_mail_list_to_be_empty(context): def mail_list_is_empty(_): with ImplicitWait(context, timeout=0.1): try: - return 0 == len(context.browser.find_elements_by_css_selector('#mail-list li')) + return 0 == len(context.browser.find_elements_by_css_selector('.mail-list-entry')) except TimeoutException: return False diff --git a/service/test/functional/features/steps/tag_list.py b/service/test/functional/features/steps/tag_list.py index a3315835..8550a886 100644 --- a/service/test/functional/features/steps/tag_list.py +++ b/service/test/functional/features/steps/tag_list.py @@ -49,7 +49,7 @@ def impl(context, tag): 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) + wait_until_element_is_visible_by_locator(context, (By.CSS_SELECTOR, ".mail-list-entry__item[href*='%s']" % tag), timeout=20) success = True except TimeoutException: pass -- cgit v1.2.3