Skip to content

Test accounts and shared data

Reliable reruns depend on knowing which account and test data a journey exercises. Use named random.* generators and Mailbox inboxes to keep stable identities across plans, applies, and partial reruns, paired with your application’s own seed or cleanup commands.

What the journey needsWhere to start
A signup address, email code, or magic linkMailbox plugin
Your application’s seed or cleanup commandLocalBash or DockerUbuntu
A database check or explicitly enabled setup writeSQL: PostgreSQL and ClickHouse
A repeatable random name, number, or expressionGenerated values

The Mailbox plugin authenticates through your reflow login, so it requires no separate binding (Mailbox setup). For CI or a separate team credential, store the token in a private binding and always use the address returned by inbox.address.

Capture the inbox cursor and trigger the email in the same step so stale messages from prior attempts are excluded:

---
name: Sign in with an email code
url: https://your-app.example.com
providers:
ui: {use: Browser, binding: site}
inbox: Mailbox
---
### Choose the account
```rfl
inbox.address name="signup" -> email
```
### Request and enter verification code
```rfl
open /login
fill label="Email" ${email}
inbox.cursor name="signup" -> before
click role=button name="Send code"
inbox.capture name="signup" after=${before} from="noreply@" subject="Sign-in code" timeout=30 -> email_body
inbox.extract text=${email_body} pattern="code is ([0-9]{6})" group=1 -> code
fill label="Verification code" ${code}
click role=button name="Verify"
expect page url~="/account"
```

See the Mailbox plugin guide for magic links, token bindings, and concurrent inbox names.

Export an address or generated identifier from a producer flow and read it through needs and references in consumers (producer and consumer example).

Named generated values and mailbox identities belong to the selected execution group and its current test-data generation. Shared groups agree across devices while device groups stay isolated. Selecting another target in the same group keeps its named data—give each distinct environment its own group. Use distinct Mailbox names for parallel email journeys.

Terminal window
reflow reset
reflow plan
reflow apply
CommandNamed random.* & Mailbox addressesStep reuseYour application DB
reflow plan / apply (unchanged)PreservedReuses retained passing evidenceUnchanged
reflow taint <flow>Preserved (same email & IDs)Reruns tainted flow + dependentsUnchanged
reflow resetRotated (new generation; old inboxes stop receiving mail)Reruns generator & plugin steps + dependents (read-only non-plugin steps stay reusable)Unchanged (run your own cleanup/seed)

reflow reset preserves execution history and refuses an owned group or unresolved uncertain outcomes until inspected and reconciled (recover a blocked reset). Changing a generator’s options requires either a new capture name or an explicit reset.

If a reset reply is interrupted, repeat reflow reset to reconcile its retained request identity. If another device has already rotated the group, inspect reflow status --json and pass both --expected-epoch <target.testDataEpoch> and a fresh --idempotency-key <uuid> to rotate again intentionally.

The browser-run mailbox path (${MAILBOX}) has a separate run-scoped lifecycle; see Browser-run mailboxes before mixing it with named plan/apply inboxes.

Seeded accounts and third-party authentication

Section titled “Seeded accounts and third-party authentication”

Use your application’s fixture or idempotent setup flow for pre-seeded accounts, keeping credentials in private bindings or input files. Browser context isolation never resets backend records. Third-party OAuth providers can trigger bot detection—a first-party email/password, magic-link, or OTP flow is usually simpler and more reliable in test environments.