Urgent.News

What's breaking now, across thousands of outlets.

Tech

Playwright Email Testing: A Real End-to-End Tutorial (No Mocks)

Most "email testing" advice ends at stubbing the send call. You assert that your app tried to send a message, and the test goes green. That leaves the interesting half untested: whether the message actually left your infrastructure, whether the template rendered, and whether the six-digit code inside it matches the one your backend is willing to accept. This walks through the other approach —…

Verification-email tests have four key components: a unique address for each test run, the browser flow that triggers the send, a method to read the message arriving, code extraction, and the assertion. Steps 1 and 3 are commonly misunderstood, as they often involve sharing a single mailbox among all tests. To avoid this, each test should have its own dedicated inbox that is created and discarded after the test is complete.

MoeMail provides an open-source disposable-inbox API with a REST interface, making it suitable for CI suites. To use the service, simply replace the base URL and authentication header if you opt for a different provider. The inbox function creates an inbox with a specified expiration time in milliseconds and returns an object containing the inbox ID and email address.

Playwright fixtures can be used to simplify the integration of this functionality. By extending Playwright's test function with the inbox object, every test automatically receives a fresh inbox address without having to manually manage it. This allows the focus to remain on the test behavior rather than the underlying email infrastructure.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

Debian and the sirens

  • Author left Debian in 2005 due to rigidity
  • LLMs could make Debian overly rigid and dependent
  • Author reflects on 18 years of helping Debian mature

curl your own homepage. That is all ChatGPT sees.

Run this against your site right now: curl -s https://yoursite.com | grep -o "<h1[^>]*>.*</h1>" If nothing comes back, or you get an empty <div id="root"> , then large parts of the internet cannot…

  • curl command reveals if search engines can read website
  • Major parts of internet may not read site without JavaScript
  • Fix by ensuring important content in first HTML response

More from Saturday 29 August →