Email QA Automation
Run Email test scenarios using the Crank BDD framework.
Who cares if your email is pixel-perfect when the program that sends it is misfiring? Automatically QA your welcome, confirmation, nurture, and drip campaigns.
Email Onboarding Program QA
Make sure your onboarding program gets kicked off immediately.
- step: ...And I enter {{some.email}} into input[name=Email]
- step: When I submit the form by clicking button[value=Start Trial]
- step: Then there should be 1 email in mailgun for {{some.email}}
Email Personalization QA
Make sure your template tokens get replaced correctly.
- step: When I enroll the {{test}} Hubspot contact into workflow Welcome Email Send
- step: Then the subject of the 1st mailgun email for {{test}} should be Welcome, Test Name
What is Crank?
Crank is a BDD test automation framework for SaaS-based business technology.
Developer Getting StartedHosted QA Automation for Business UsersInstalling and Authenticating this Cog
Once you've successfully installed Crank you can install this Cog by running the following:
$ crank cog:install automatoninc/inbox-mailgun
You will be asked for the following authentication details on installation. To avoid prompts in a CI/CD context, you can provide the same details as environment variables.
Field | Install-Time Environment Variable | Description |
---|---|---|
apiKey * | CRANK_AUTOMATONINC_INBOX_MAILGUN__APIKEY | Mailgun API Key |
domain * | CRANK_AUTOMATONINC_INBOX_MAILGUN__DOMAIN | Email Domain |
endpoint * | CRANK_AUTOMATONINC_INBOX_MAILGUN__ENDPOINT | Mailgun API Endpoint |
You can always re-authenticate by running the following command.
$ crank cog:auth automatoninc/inbox-mailgun
Email Test Steps
Check that no link in an email is broken Assertion
Use this step in a Scenario file like this:
- step: Then the {{position}} mailgun email for {{email}} should not contain broken links
ID | Type | Description |
---|---|---|
email * | Email Address | The inbox's email address |
position * | Number | The nth message to check from the email's inbox |
Token | Type | Description |
---|---|---|
{{inbox-mailgun.messages.0.#}} | Number | Email receipt order number |
{{inbox-mailgun.messages.0.Subject}} | String | Email subject line |
{{inbox-mailgun.messages.0.From}} | String | Email from line |
{{inbox-mailgun.messages.0.To}} | String | Email to line |
{{inbox-mailgun.links.0.Type}} | String | Link Found In (e.g. HTML or Plain-Text) |
{{inbox-mailgun.links.0.Url}} | URL | Link URL |
{{inbox-mailgun.links.0.StatusCode}} | Number | HTTP Status code when the link was checked (e.g. 404 or 200) |
Check the content of an email Assertion
Use this step in a Scenario file like this:
- step: Then the {{field}}) of the {{position}} mailgun email for {{email}} {{operator}}) {{expectation}}
ID | Type | Description |
---|---|---|
email * | Email Address | The inbox's email address |
position * | Number | The nth message to check from the email's inbox |
field * | String | Field name to check |
operator * | String | The operator to use when performing the validation. Current supported values are: should contain, should not contain, and should be |
expectation * | Any Scalar | Expected field value |
Check the number of emails received Assertion
Use this step in a Scenario file like this:
- step: Then there should be {{count}} emails in mailgun for {{email}}
ID | Type | Description |
---|---|---|
email * | Email Address | The inbox's email address |
count * | Number | The number received |
Token | Type | Description |
---|---|---|
{{inbox-mailgun.messages.0.#}} | Number | Email receipt order number |
{{inbox-mailgun.messages.0.Subject}} | String | Email subject line |
{{inbox-mailgun.messages.0.From}} | String | Email from line |
{{inbox-mailgun.messages.0.To}} | String | Email to line |
Missing a Step You Need?
This Cog is open source! Your contributions are welcome and encouraged.
Contribute on GitHubJoin the Crank Spectrum Community