An email is being sent in my case ( 1. When resetting the password, 2. Adding a New member) during both API and UI tests. How can I access these emails without actually logging into my mail manual and accessing the content, so I can add them to the test and verify?
The test is something like the below.
Second test.
Would appreciate any help here.
I have tried to look into the third parties but it seems I need to use their email accounts I was hoping if someone can help me regarding Gmail(accessing the content of emails going to Gmail)
- If your application is running locally and is sending the emails directly through an SMTP server, you can use a temporary local test SMTP server running inside Cypress. Read the blog post "Testing HTML Emails using Cypress" for details.
- If your application is using a 3rd party email service, or you cannot stub the SMTP requests, you can use a test email inbox with an API access. Read the blog post "Full Testing of HTML Emails using SendGrid and Ethereal Accounts" for details.
Taken from the official best practice page at "Verifying sent emails". Read more here.
If you are looking for a free third-party email client (of course with just 100 emails per month) you can use testmail.app
This app is pretty much basic and easy to integrate with cypress.
You can find docs here