Company
Date Published
Author
Gleb Bahmutov
Word count
2516
Language
English
Hacker News points
None

Summary

This blog post by Gleb Bahmutov explains the process of visually verifying emails sent through third-party services like SendGrid using dynamic templates to ensure that the emails maintain their intended style and contain the necessary information. It addresses the challenges posed by dynamic email markup and offers a solution using the Cypress testing framework in combination with the free Ethereal email service for capturing emails. The post details the method of setting up visual tests for both the registration form and the HTML emails themselves using the Percy visual testing service, which helps ensure consistent visual snapshots by handling dynamic data such as confirmation codes. The article covers setting up an email account with nodemailer, integrating Cypress to automate email testing, and using Percy to visually confirm that the emails and related web pages appear as expected, while also addressing the challenges of dynamic data in visual testing.