Considering the following cases for "todo.ly" app:
- Verify that a confirmation email is sent after creating a new user
- Verify a change-password email is sent after user's request it
How to easily automate those test cases?
-
Third party applications (gmail, outlook, etc.)
- Need to automate UI steps
- Emails considered as spam or email banned
-
Setup a dedicated mail server
- Additional effort/time invested
- Some IT restrictions (have a dedicated machine/vm, enable ports and others)
Let's try it out!
Following end-points are available:
- https://api.mailinator.com/api/inbox?to=bob&token=...
- https://api.mailinator.com/api/email?id=1373143878-0-test22&token=...
Limitations: we need to pay!
Fortunately, we found these public resources:
- https://www.mailinator.com/fetch_inbox?zone=public&to=bob
- https://www.mailinator.com/fetch_email?msgid=1373143878-0-test22&zone=public
var emailName = 'share.knowledge';
request
.get('https://www.mailinator.com/fetch_inbox?zone=public&to=' + emailName)
.end(function(err, res){
var inbox = res.body;
console.log('*** User\'s inbox: ', inbox);
});