r/softwaretesting • u/justneardy • Jun 27 '26
One thing that surprised me after working with hundreds of engineering teams...
As a Solutions Engineer at one of the largest testing platforms, I've spent the last few years helping teams build and scale their test automation.
I've seen teams run thousands of browser tests in parallel, build sophisticated CI/CD pipelines, and automate incredibly complex user journeys.
Yet one problem keeps showing up over and over again: Testing email workflows.
Something as basic as:
- Account verification
- OTP authentication
- Password resets
- Magic links
- User invitations
often becomes the weakest part of an otherwise mature E2E testing strategy.
The common workarounds seem to be:
- Skipping email validation entirely
- Mocking the email provider
- Sharing a single inbox across tests like Gmail and polling their API in a shared inbox
- Building custom smtp servers and maintaining them
What's interesting is that these flows are often among the most critical user journeys in the application, yet they're frequently the least tested.
After seeing this problem repeatedly across customers, I started digging into why testing email workflows is still so painful compared to testing APIs, databases, payments, or browsers.
I'm curious how everyone here approaches it.
How does your team test email-dependent workflows today?
Do you mock them, use tools like MailHog/Mailpit/Mailosaur/Mailinator, use a hosted service, or have an internal solution?
3
u/bonit0flakes Jun 27 '26
We poll the graph api for Outlook and get the token. It works most of the cases.
1
u/strangelyoffensive Jun 27 '26
Aws workmail address with aliases (automated+test1_uuid@host.com)
Every test generates their own uuid every run, so no collisions. Nightly the mailbox is emptied.
1
u/MaleficentSubject514 Jun 27 '26
I'd love to hear people's thoughts on this as I am currently putting together a testing plan for this exact scenario
1
u/LazyWimp Jun 27 '26
Following
1
u/tryingto_doitright Jun 27 '26
Following
1
u/FabasTI Jun 27 '26
Just for context, I'm not an automation QA, but for me, the logic looks as follows:
But yes, most of the email providers have their own databases and you can't connect an external one (as far as I know from my previous experience), so you always face a risk of sending email to the real user instead of a test account (for example invitations, we had an issue when instead of sending invitations only to test accounts, the job has created thousands of invitations to non test accounts and we had to fix it manually revoking access)
So after that, we had to create a separate billable account for the test environment, and its usage was very limited and expensive, but it fully emulated the production environment, and we had no more issues with it
1
u/Important_Trainer725 Jun 28 '26
MSGraph API + SMS2Mail proxies for OTP