Rayrun
← Back to Discord Forum

Reading email content in playwright

Hello, I have a register test that requires accessing the email and copying a code, then going back to the register form and validate it. What is the easiest approach on this manner? any links/resources will help.

I am aware of mailosaur, but I was curious about other approaches (mainly free ones). Cheers!

This thread is trying to answer question "What is the easiest approach to access and copy a code from an email for a register test in playwright?"

3 replies

Hello @iamrv, once you reach the register scenario that sent the code, you can navigate the current page (or open a new one) to the email front end, login,... look for the email,... get hold of the email body, and code, go back to the page of your app, and use the code...

Though doing that you are bound to many "moving parts", eg the mail server, mail front end... each with their own latency and reliability issues.

The register + verification code scenario would be better suited as API tests

Ideally your back end has something like swagger definitions to declare the API and schema, so the team can auto generate the API code and test it before the front end consumes a new version.

Related Discord Threads

TwitterGitHubLinkedIn
AboutQuestionsDiscord ForumBrowser ExtensionTagsQA Jobs

Rayrun is a community for QA engineers. I am constantly looking for new ways to add value to people learning Playwright and other browser automation frameworks. If you have feedback, email luc@ray.run.