A simple trick to reuse your Email IDs
Unit testing is the most important aspect of any project life cycle. After writing a huge amount of code, the developer needs to spent time on testing to make that code work. Login/Signup forms are the basic component of any web app and testing these login/signup forms can be very painful when your app is connected to the server and start giving “Email already exists” after each submits you make for testing purpose. In this article, I am going to tell you some tricks by which you can ease your pain of testing features where multiple emails required. You can move on to the next article if you never feel this difficulty.
Reuse your personal Gmail ID
The first and very important trick is to convert your personal Gmail ID into millions of unique Ids. For this, you just need to add a +
sign and add some numbers to make it unique. See this example.
//My personal gmail ID
prateek@gmail.com//Create infinte email Ids
prateek+1@gmail.com
prateek+2@gmail.com
prateek+3@gmail.com
prateek+4@gmail.com
prateek+5@gmail.com
...........................
Now you are wondering about the confirmation email which will be sent on the email id you are submitting in the form. No need to worry my friend, Gmail sends every single email sent to “prateek+1@gmail.com” to “prateek@gmail.com” and your problem is solved. It isn’t cool?? You can also use this method on some other websites to create a new account without creating a new email ID.
Some sites put this validation so Users can’t bypass the registration process by this trick.
Auto confirmation of emails
We solved the problem of generating new email IDs every time for testing purposes. But there is one more problem left where we struggle a lot, “Clicking on the confirmation link”. If you want to test your registration form which creates an account but makes that account active only when you click on the confirmation link sent to your registered email, you need to open your mail account again and again for verifying the link. Let’s make that easy for you.
“mailnesia.com” is open for all website which can auto verify the confirmation link sent to it. You can use any keyword before the domain name and a new email id created automatically. For example:
abc@mailnesia.com
prateek1134@mailnesia.com
js@mailnesia.com
When some email delivered to this account, it will be auto verified by the script of “mailnesia.com” and make your testing faster and smoother. There are some other free email service providers also, but they don’t give this auto verification of confirmation link functionality. For example:
yopmail.com, mailinator.com, etc.
If you find this article informative, please share it with your friends and tap on the clap button. Follow me for more interesting tricks and tips on medium.
Thanks For Reading
Happy Coding!