MailFlatDocs
Documentation/Languages/All languages

Email testing in every language

The same four steps everywhere: open an inbox, let your app mail it, read the one-time code, clean up. Pick your language and copy the working example.

Start from a working project

Rather than copying a page into an empty folder: this writes a project with a smoke test that runs green on your first key, a signup test to edit, and a gitignored .env. Playwright, Vitest or pytest.
Shell
npm create mailflat@latest

Test frameworks and CI

Where the inbox belongs in the lifecycle of your runner: fixtures, hooks, config and teardown, with one complete working example each.
Playwright

Give every Playwright test its own real inbox, read the verification code your app actually sent, and finish the signup flow end to end.

@mailflat/sdk
Cypress

Read real verification emails from a Cypress test by moving the API calls into a Node task, where network access belongs.

@mailflat/sdk
Selenium

Fill a signup form with a real address, then type the code that really arrived — in Java or Python, next to the WebDriver calls you already have.

mailflat-sdks · mailflat
pytest

A conftest fixture that gives every test its own inbox and cleans up afterwards, whether the test passed or not.

mailflat
Jest

Open an inbox in beforeEach, delete it in afterEach, and give Jest a timeout long enough for real mail to arrive.

@mailflat/sdk
Vitest

The same flow as Jest with typed fixtures: Vitest picks up the client's TypeScript types with no extra setup.

@mailflat/sdk
Cucumber

Keep the mailbox out of the feature file: the scenario says a user signs up and enters the code, the step definitions do the work.

@mailflat/sdk
Robot Framework

Wrap the Python client in a small keyword library and your suites get New Inbox and Wait For Otp as ordinary Robot keywords.

mailflat
WebdriverIO

Hooks in wdio.conf.js open and close the inbox; the spec just reads the address off the global.

@mailflat/sdk
TestCafe

TestCafe fixtures map cleanly onto inbox lifecycle: beforeEach opens one, afterEach deletes it.

@mailflat/sdk
Postman

Chain three requests — create an inbox, trigger your flow, read the code — with the address carried between them in a collection variable.

REST
GitHub Actions

Give every workflow run its own inbox, pass the address to the suite as an environment variable, and sweep it up even when the job fails.

REST
GitLab CI

The same per-run inbox pattern in .gitlab-ci.yml, with the key stored as a masked CI/CD variable and teardown in after_script.

REST

AI agents and assistants