Conf.js
How to read OTP from gmail. I tried but am not able to and also am not getting any error.
You can use a few mail listener approaches for a cleaner solution, inbucket and mail-listener2 are two popular solutions for email reading purposes in e2e testing.
I would personally recommend inbucket for its simple implementation. You can run it as a docker container with a simple command mentioned here, and then consume the exposed APIs using this Javascript Client.
You can also use mail-listener2, it also offers the same functionality but requires a few configuration in the .conf
file.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With