Access Emails During A Test Flow
How to use Moropo to dynamically access emails sent as part of an app testing flow
Last updated
How to use Moropo to dynamically access emails sent as part of an app testing flow
Last updated
Note: this functionality currently only supports email addresses that Moropo dynamically generates during the flow. If you require support for access to pre-existing email addresses then please add your use case as a comment on the Canny post
This guide will show you how to access emails on the simulator as part of a Moropo test run.
Moropo will automatically generate and populate this variable with a valid email address. It will be in the format of queue-123@parse.moropo.com
In script mode:
In step mode:
For example, press a button to trigger email validation or issue a password reset link
Moropo will automatically generate and populate this variable with a valid URL pointing to a secure webpage on Moropo's server.
In script mode:
In step mode:
Moropo will check that the email has arrived every 10 seconds. If the email has not arrived then a no email yet message will be displayed. In your test, you should wait to assert that this is not visible before attempting to read the email contents using the step below. Note: Moropo will automatically refresh, there is no need to manually refresh the browser.
In script mode:
In step mode:
Once the email has been rendered, you can use any command to copy, assert or do anything else with the data in the email.
In the example above, we used the copyTextFrom
command with regex to copy the 6-digit verification code using the following command:
You can paste this into an text input using:
If you need to back to your app, then you can use the following commands.
iOS:
Android:
Yes. Although we do encourage you to only use test accounts and non-sensitive data when using the Moropo platform.
We render the email using a secure endpoint that is authenticated using a unique authentication token that is valid only for the duration of the test run.
There is no limit on the number of emails you can send to the address during a test run. However, Moropo will only render the most recent email.
If you are sending multiple emails during a test run, you may see your previous email whilst Moropo waits for the new email to arrive. In this case, you should modify your extendedWaitUntil
logic to ensure you are reading the correct email.
No. This functionality is email only. If you require SMS then please raise a feature request.