Home > OS >  How to confirm email after registration in cypress?
How to confirm email after registration in cypress?

Time:09-27

In my case, it is impossible to log into the account if the mail is not confirmed after registration.

How can this be implemented? I want to reproduce the real behavior of the user in the tests, so I need to do this, because the fact that the registration was successful is not enough, for example: what if the user, after registering and confirming the mail, cannot login into the account

CodePudding user response:

Now let’s integrate email addresses into our test using MailSlurp. MailSlurp requires an API key but it’s free for personal use so sign up to get one.

Once you’ve signed up we can extend Cypress with a command to create new email addresses when we need them.

Now let’s set up a command called new email address inside commands.js that calls MailSlurp and creates an email address on demand.

  • Related