diff options
author | Folker Bernitt <fbernitt@thoughtworks.com> | 2014-08-20 17:21:20 +0200 |
---|---|---|
committer | Folker Bernitt <fbernitt@thoughtworks.com> | 2014-08-20 17:45:12 +0200 |
commit | ae6f773d4abc42dcc0eaa1c70f8af14b091f8d47 (patch) | |
tree | 15e5df69a6d1b774042dfd29372115a1baf4136f /py-fake-service/features/step_definitions/compose.rb | |
parent | a3ea808b6290a7c756b28099df9fa8574c94055e (diff) |
Translated cucumber tests to behave.
Diffstat (limited to 'py-fake-service/features/step_definitions/compose.rb')
-rw-r--r-- | py-fake-service/features/step_definitions/compose.rb | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/py-fake-service/features/step_definitions/compose.rb b/py-fake-service/features/step_definitions/compose.rb new file mode 100644 index 00000000..e92d16f6 --- /dev/null +++ b/py-fake-service/features/step_definitions/compose.rb @@ -0,0 +1,27 @@ +Given /^I compose a message with$/ do |table| + find('#compose-mails-trigger').click + data = table.hashes.first + fill_in('Subject', with: data['subject']) + fill_in('Body', with: data['body']) +end + +Given /^for the '(.*)' field I type '(.*)' and chose the first contact that shows$/ do |recipients_field, to_type| + recipients_field.downcase! + within("#recipients-#{recipients_field}-area") do + find('.tt-input').native.send_keys(to_type) + sleep 1 + first('.tt-dropdown-menu div div').click + end +end + +Given /^I save the draft$/ do + click_button("Save Draft") +end + +When /^I open the saved draft and send it$/ do + step "I select the tag 'drafts'" + step "I open the first mail in the mail list" + page.should_not have_css("#send-button[disabled]") + click_button('Send') + find('#user-alerts').should have_content("Your message was sent!") +end |