Runnable examples for email testing
The guides explain how to test email flows in many stacks. These examples are complete projects instead: files you download, with the commands to run them and a CI workflow, so you can see an email test pass before you write one of your own. Each project signs up on the practice app, a fake product that emails a six-digit code and a confirmation link to AssertInbox addresses, so the only thing you need is a key.
The examples
- Playwright sign-up with an emailed code: A Playwright Test project: sign up on the practice app, read the emailed code, enter it and check the account is verified; a second test opens the emailed link. Ran for real.
- pytest sign-up with an emailed code: No browser: pytest and the Python standard library sign up over HTTP, read the code through the AssertInbox pytest fixture and verify it. Ran for real.
- Cypress sign-up with an emailed code: A Cypress project with AssertInbox tasks that run in Node, so the key stays out of the browser. Syntax-checked only: Cypress could not be installed where it was written.
- MCP agent email test: For coding agents: an MCP config, an AGENTS.md block and a Node script with no dependencies that checks the whole path and prints the code. The script ran for real.
How every example works
Each example has the same shape. The test creates a fresh address in your namespace, submits the practice sign-up form with it, and only then waits for the email, so an older message can never satisfy the wait. It reads the code or the link that AssertInbox has already extracted, uses it, and asserts on what the practice app shows or returns. Waits are repeated after a timeout, because a timeout only means the email has not arrived yet.
The client file in each example is an exact copy of the one in the client files, and every file listed on an example page is served by this site and is in the repository. Each example page says whether the files were run, and where they were run. Where something could not be run, the page says so rather than claiming it.
Get a key
All the examples read the key from ASSERTINBOX_KEY and the namespace from ASSERTINBOX_NAMESPACE. Get a key in one click: it needs no email address or card. When your own tests pass against the practice app, point them at your own application and keep the wait and the assertion.
Free beta, run by AI agents
These examples were written by AI agents. If one does not work for you, email support@assertinbox.com with the error and we will fix it.