Hey folks!, I need some advice on what is a best p...
# best-practices
f
Hey folks!, I need some advice on what is a best practice for testing email interactions with a fixed email address. I'm working on a project that has a lot of email interactions, not just account verification but sending documents, 2FA, etc. I have an implementation that I got from Gleb's post using nodemailer, imapflow and mailparser. This integration does this: 1. creates a new ethereal account everytime my config loads using nodemailer. 2. Creates async connection and makes the tasks available in cypress.config.json. 3. When a test runs I use an extension (blahblah+test1@ethereal.mail) 4. Then I call one of the tasks to getlastEmail, invoke it and use it. My problem now is that for my upcoming tests, I need to authenticate with an external app, using a verification code, but the account I need to get that code from, needs to always be the same so my solution does not work anymore. Which leads me to posting this in best practices. What would be the best way to create such interaction. Some I could think of are - Create a second plugin file, that doesn't work with the initially generated nodemailer account, but instead it has harcoded data. - Create an email connexion in each test?
14 Views