Reflect Docs

Email / SMS Testing

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

Note: Email Testing and SMS Testing are enhanced features and are charged as separate add-ons to your subscription. 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. In scenarios like new user registration, user invite workflows, and placing an order on a web storefront, validating that an email is sent, and interacting with that email is often essential to truly verify the workflow is working end-to-end.

Similarly, SMS messaging can also be a critical component for testing workflows like two-factor authentication.

Within Reflect, you can create tests that span web, email, and SMS interactions.

Receiving Emails and SMS Messages

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 Email/SMS Inbox when creating or re-recording a test.

When executing an Email step, we will attempt to match it against any emails that are sent during the course of the test run. You can configure the Email step to match on at least one the following criteria:

Note: Recipient emails can be configured to match on a Variable instead of a static email address.

SMS Numbers

In addition to displaying emails, the Reflect Inbox will also display any SMS messages associated with your Reflect account. SMS numbers are unique to your account, and can be provisioned by contacting Reflect Support.

Assigning Content to Variables

Once you’ve initiated an action within your test recording that generates an email to your subdomain, click on the View Email/SMS 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, first click on the paragraph of interest. This will create a new Email test step. Next, highlight the value you wish to extract from the paragraph you selected, such as a verification code or confirmation link. In the context menu that’s displayed, you can either associate this value to an existing variable (if, for example, you want to validate it matches a known value) or assign it to new variable (if, like in the verification code or confirmation link scenario, you want to use it in a subsequent test step).

To add a step to your test that waits for an SMS message, from the recording view, click the View Email/SMS Inbox button and select the relevant SMS message. Click the section of the message you want to capture to create a new SMS test step. Next, highlight the text you wish to extract, such as a verification code or URL, choose the Assign to Variable option, and finally give the Variable a name.

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, click the Input step on the left sidebar to view the step details, and replace the static input value with the value from the SMS step by highlighting the input text and selecting the Replace with Variable option. In the context menu, choose the Variable that contains the verification code from the SMS step.

Get started with Reflect today

Create your first test in 2 minutes, no installation or setup required. Accelerate your testing efforts with fast and maintainable test suites without writing a line of code.

Copyright © Reflect Software Inc. All Rights Reserved.