Did you know that in Rainforest there's a {{ random.inbox }} to go along with the {{ random.email }} step variable? Read on to learn how to test email-based functions using Rainforest.

{{random.email}}

This step variable gives each of your testers a globally unique email address. It's great for testing signup flows and the like. What's super awesome about it though, is that any emails sent to the address that {{ random.email }} generates will be shown in {{ random.inbox }}.

{{random.inbox}}

This is a temporary, web-based email inbox (similar to Mailinator) that corresponds to the {{ random.email }} we talked about above. It looks like this:

Testing sent and received emails:

Inject the step variable {{ random.email }} wherever testers are required to enter an email in your product (like the signup flow). When you need them to check whether an email was successfully sent by your product (a classic use case being a welcome / verification email after signup), you can direct them to open the {{ random.inbox }} associated with{{ random.email }}, and check for the existence of that email.

The only thing to note is that emails typically take ~20 seconds to display, so make sure to tell your tester to wait a little while if they do not see the email arrive immediately.

Testers can also reply to emails through the inbox view (once per email). To instruct a tester to reply to an email, say something along the lines of 'Reply to the email with the message "Hello"'.

Please note any emails that were sent > 30 days ago will be cleared by default.

Lastly, you can instruct the test to clear the inboxes in your test case. To do so instruct the tester to open up the {{ random.inbox }} and select the clear inbox button. 

Did this answer your question?