diff options
author | NavaL <mnandri@thoughtworks.com> | 2016-01-06 17:26:39 +0100 |
---|---|---|
committer | NavaL <mnandri@thoughtworks.com> | 2016-01-06 17:32:36 +0100 |
commit | 7d3c4032304b8ffc097272c36116321f6cf7956b (patch) | |
tree | 998c613b7dfd0a9fc9c5bfe853b46449c0bb529f /service/test/functional/features | |
parent | 9db569e3f5170efd852322d428b9b0282c7bb114 (diff) |
added ft
Issue #548
Diffstat (limited to 'service/test/functional/features')
3 files changed, 27 insertions, 0 deletions
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 |