Checking Email within Tests

Access and interact with email triggered during your tests

Search our documentation:

Toggle Documentation Menu

Checking Email within Tests

It's common for websites and applications to send emails when certain actions are triggered. In some cases, you may want access to those emails during your test(s) to confirm their delivery, check their contents, or extract data for use within your test. While Ghost Inspector can often access 3rd party webmail clients, it's often challenging and not recommended. Instead, Ghost Inspector includes a built-in email service that can be used to seemlessly access triggered emails during your browser tests.

To use our built-in email service, simply send your email(s) to any "<username>@email.ghostinspector.com" email address. For instance, "example@email.ghostinspector.com". Once delivered, your email will be immediately accessible without login via our email service. Two different URLs can be used for accessing it.

https://email.ghostinspector.com/<username> — This URL will provide a simple "Inbox" view of all emails send to this address within the last hour.

Email service inbox

https://email.ghostinspector.com/<username>/latest — This URL will display the latest email sent to this address within the last hour (provided that one exists).

Sample email message

To use this service in your tests, simply assign an "<username>@email.ghostinspector.com" email address, add a 30 second "Pause" step after the email is triggered to allow for delivery, then navigate to the email service's public URL within your test and interact with the email.

Email steps - Static email

In many cases, it's going to be useful or necessary to use a unique email address (for instance, when testing your applications sign up process). We suggest using our built-in {{TIMESTAMP}} variable for this.

Email steps - Dynamic email
Note: Please keep in mind that all emails sent to this service are public and can be publically accessed by anyone. While using a unique <username> may provide some level of privacy, we insist that inclusion of sensitive data in your emails be absolutely avoided. Emails are purged on an hourly basis.