The application I am testing is sending out a OTP if the user has MFA enabled. I am required to create an E2E test for that functionality. What tool can I use where I can read the incoming messages inside my cypress tests and enter the OTP while logging in?
I know there's a paid service Mailosaur which allows this but I am looking for cheap/free solutions.
If you add otplib to your project, you can side-step email packages altogether.
Add a task to
cypress.config.js, then callcy.task('getOTPToken', secret)and use the returned token in your app (instead of the emailed token).