Search code examples
javascriptjestjstddpuppeteeremail

How to automated test a user sign-Up when the signUp is a email-only-sign-In


I am trying to write a test for a webApp that has only an email-only-signIn. That means the user hacks in the email and clicks on the link he receives in an email.

In order to test a user signUp I was wondering what you think I could do to solve the problem?

I test with Jest and Puppeteer.

My app is made only of Html, CSS and JS.

Many thanks ahead, Alex


Solution

  • I would see some way, you could :

    1. Open the web app, sign up.
    2. In another page (browser.newPage()), you open your classic email provider. You have to instrument the whole email connection, and then open the last email and clikc on the embedded link.

    Now it can be complicated, especially for the email instrumentation part.

    Perpahs the best way could to use a temporary email : https://temp-mail.org/en/

    This way, you still have to open two different pages (one for the temp email, one for your app) but then it's easier to fetch the email received (and you're sure it's this one and not another one) and you can click on it to confirm the sign-up on your app.