-
-
Notifications
You must be signed in to change notification settings - Fork 192
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for testing emails sent from Drupal #195
Comments
As discussed here: https://forum.civicrm.org/index.php?topic=36633.0 |
I have forked the drupal extension, created an email Branch, and written an "emails.feature" that is a test defining by examples all the steps/syntax I'd like to have: The steps to implement are:
|
This has been merged. Thanks all! |
Following on from https://www.drupal.org/node/1935598, planning for adding the ability to test emails sent by Drupal.
jhedstrom commented there: "The new steps should go into a dedicated context so it can be enabled as needed. I think some changes will be necessary to the Drupal Drivers too."
Currently I'm aware of 5 fleshed out available code samples on this subject, which show different approaches:
I want to suggest the following approach:
Currently used step definitions are ...
douggreen:
@then /^I (?:(?:do|should) )?receive mail (titled )?"(?P[^"])"$/
@then /^I (?:do|should) not receive mail (titled )?"(?P[^"])"$/
@when /^I click "(?P[^"])" in mail(?: (?:titled )?"(?P[^"])")?$/
Berdir:
@then /^an email was sent to "([^"])"$/
@then /^no email has been sent$/
@given /^the mail subject is "([^"])"$/
larowlan:
@then /^the email to "([^"])" should contain
@given /^the email should contain "([^"])"$/
jamesharv:
@then /^(\d+) emails? should be sent:$/i
(which allows for a table with columns from, to, reply-to, subject and body
I propose (roughly):
The text was updated successfully, but these errors were encountered: