Reflect Docs

Email Testing

Test end-to-end workflows that include validating that emails are sent, or extracting values out of an email to use elsewhere in the test.

Note: Email Testing is available only to customers within our Enterprise tier. For more information or to see a demo, please contact us at support@reflect.run.

Web and Email Workflows

It’s not uncommon for workflows to include more than just actions taken on your web application. Scenarios like new user registration, two-factor authentication, inviting additional users, and placing an order will often involve emails sent to the user. In cases like order confirmations, the user need not interact with the email, whereas in sign-up workflows or two-factor authentication it is required that the user interact with the email in order to complete the workflow.

Within Reflect, you can create tests that span both web and email interactions, enabling you to get test coverage for full end-to-end scenarios like the examples above.

Receiving Emails

An Email Inbox is provisioned for you as part of your Reflect account. This Inbox is special in that you can access it directly within the Reflect web app, and any email sent to the subdomain we’ve created for you will appear in this Inbox. For example, if your subdomain is example.email.reflect.run, then any emails send to an address that ends in @example.email.reflect.run will appear in your Inbox. This is handy because you may want to you use unique email address for every test. In fact, it’s often useful to use entirely random email addresses in scenarios like sign-up flows where you can only register with a given email address once.

Your Inbox can be accessed via either the dropdown shown when hovering over your avatar on the top-right of the page, or by clicking View Inbox when creating or re-recording a test.

Assigning Email Content to Variables

Once you’ve initiated an action within your test recording that generates an email to your subdomain, click on the ‘View Inbox’ button to access the email. On this screen, you may optionally filter the Inbox by recipient and select your desired email on the list on the left to view it.

Reflect converts all HTML emails into plain text so that it’s easy for you to extract information from the email. Links will be converted to both a URL and text, and visual media like images will be removed. Typically when you’re interacting with an email you’ll want to extract a value to be used later in the test. This could be a verification code in a two-factor authentication scenario, or a confirmation link in new user registration scenario. To extract the value, simply hover over the paragraph of interest and click and drag to select your desired value from the paragraph. You can associate this value to either an existing variable (if for example you want to validate it matches a known value) or to a new variable (if, like in the verification code or confirmation link scenario, you want to use it in a subsequent test step).

Using Variables as URLs

Once you’ve extracted a value from your email, click Save and you’ll once again see the website under test. If you want to navigate to a URL that you’ve already extracted into a Variable, click on the address bar within the recording experience and then you’ll see an option to select the Variable that contains the URL you want to navigate to.

Using Variables as Input

If you’ve extracted a verification code or something you otherwise want to input, first go through the steps manually within the test to input your value, then click on the Input step and associate the Input value to the Variable that contains the value from the email.

Copyright © 2020 Reflect Software Inc. All Rights Reserved.