From 7d3c4032304b8ffc097272c36116321f6cf7956b Mon Sep 17 00:00:00 2001 From: NavaL Date: Wed, 6 Jan 2016 17:26:39 +0100 Subject: added ft Issue #548 --- service/test/functional/features/attachments.feature | 12 ++++++++++++ .../test/functional/features/files/upload_test_file.txt | 1 + service/test/functional/features/steps/attachments.py | 14 ++++++++++++++ 3 files changed, 27 insertions(+) create mode 100644 service/test/functional/features/files/upload_test_file.txt diff --git a/service/test/functional/features/attachments.feature b/service/test/functional/features/attachments.feature index 19834a9d..859ee590 100644 --- a/service/test/functional/features/attachments.feature +++ b/service/test/functional/features/attachments.feature @@ -25,3 +25,15 @@ Feature: Attachments Then I see the mail has an attachment #When I open click on the first attachment #Then the browser downloaded a file + + Scenario: User uploads a mail attachment + When I compose a message with + | subject | body | + | Pixelated rocks! | You should definitely use it. Cheers, User. | + And for the 'To' field I enter 'pixelated@friends.org' + And I find an attachment icon + When I upload a file + And I send it + When I select the tag 'sent' + And I open the first mail in the mail list + Then I see the mail has an attachment \ No newline at end of file diff --git a/service/test/functional/features/files/upload_test_file.txt b/service/test/functional/features/files/upload_test_file.txt new file mode 100644 index 00000000..dd0ab7ed --- /dev/null +++ b/service/test/functional/features/files/upload_test_file.txt @@ -0,0 +1 @@ +this is a file that I want to upload \ No newline at end of file diff --git a/service/test/functional/features/steps/attachments.py b/service/test/functional/features/steps/attachments.py index 066683bf..8dc4e244 100644 --- a/service/test/functional/features/steps/attachments.py +++ b/service/test/functional/features/steps/attachments.py @@ -53,3 +53,17 @@ def load_mail_into_soledad(context, mail): def step_impl(context): attachments_list = find_elements_by_css_selector(context, '.attachmentsArea li') assert len(attachments_list) == 1 + + +@when(u'I find an attachment icon') +def find_icon(context): + assert find_element_by_css_selector(context, '#attachment-button .fa.fa-paperclip') + + +@when(u'I upload a file') +def upload_attachment(context): + base_dir = "test/functional/features/files/" + fname = "upload_test_file.txt" + fill_by_css_selector(context, '#fileupload', base_dir + fname) + attachment_list_item = wait_until_element_is_visible_by_locator(context, (By.CSS_SELECTOR, '#attachment-list-item li a')) + assert attachment_list_item.text == "%s (36.00 b)" % fname -- cgit v1.2.3