From fb8782d3f66b1068153a9948a01864ee52e39b10 Mon Sep 17 00:00:00 2001 From: Duda Dornelles Date: Thu, 9 Oct 2014 15:46:20 +0200 Subject: Making compose_save_draft_and_send feature work --- service/test/functional/features/steps/compose.py | 18 ++++++++++++++---- service/test/functional/features/steps/mail_list.py | 2 +- 2 files changed, 15 insertions(+), 5 deletions(-) (limited to 'service/test/functional/features/steps') diff --git a/service/test/functional/features/steps/compose.py b/service/test/functional/features/steps/compose.py index 5a61a8e5..16c909e7 100644 --- a/service/test/functional/features/steps/compose.py +++ b/service/test/functional/features/steps/compose.py @@ -45,12 +45,14 @@ def choose_impl(context, recipients_field, to_type): browser.find_element_by_css_selector('.tt-dropdown-menu div div').click() +@given("for the '{recipients_field}' field I enter '{to_type}'") +def enter_address_impl(context, recipients_field, to_type): + _enter_recipient(context, recipients_field, to_type + "\n") + + @then("for the '{recipients_field}' field I type '{to_type}' and chose the first contact that shows") def choose_impl(context, recipients_field, to_type): - recipients_field = recipients_field.lower() - browser = context.browser - field = browser.find_element_by_css_selector('#recipients-%s-area .tt-input' % recipients_field) - field.send_keys(to_type) + _enter_recipient(context, recipients_field, to_type) sleep(1) find_element_by_css_selector(context, '.tt-dropdown-menu div div').click() @@ -66,4 +68,12 @@ def send_impl(context): context.execute_steps(u"when I open the first mail in the mail list") assert_that(is_not(page_has_css(context, '#send-button[disabled]'))) click_button(context, 'Send') + sleep(1) element_should_have_content(context, '#user-alerts', 'Your message was sent!') + + +def _enter_recipient(context, recipients_field, to_type): + recipients_field = recipients_field.lower() + browser = context.browser + field = browser.find_element_by_css_selector('#recipients-%s-area .tt-input' % recipients_field) + field.send_keys(to_type) diff --git a/service/test/functional/features/steps/mail_list.py b/service/test/functional/features/steps/mail_list.py index 2d57099b..c642b4bd 100644 --- a/service/test/functional/features/steps/mail_list.py +++ b/service/test/functional/features/steps/mail_list.py @@ -34,7 +34,7 @@ def open_current_mail(context): @then('I see that mail under the \'{tag}\' tag') def impl(context, tag): context.execute_steps("when I select the tag '%s'" % tag) - check_current_mail_is_visible(context) + context.execute_steps(u'When I open the first mail in the mail list') @when('I open that mail') -- cgit v1.2.3