TestWatchLog inStart free

Running E2E tests against production, safely

Many small teams test where their customers are. Which flows are safe there, how to mark and delete what a test creates, why test emails bounce in production, and how often to check.

By Vasyl Harastei. . 7-minute read.

A staging site that matches production is a luxury many small teams don’t have. Staging runs a different config, has no real payment provider, and nobody looks at it for weeks. So the question isn’t whether to run end-to-end tests against production, but which tests, and how to stop them from leaving a trail of fake users, bounced emails and stray orders.

Below: how to split flows that are safe in production from flows that aren’t, how to give production its own login, how to mark and delete everything a test creates, and how often to check. Where TestWatch does part of the job, the post says how, and every product value on this page is checked against the code each time we test the site.

Split read flows from write flows

Read flows look but don’t change anything: the home page loads, a search returns results, a signed-in user sees their dashboard, a product page shows a price. These are safe to run in production as often as you like, and they catch the failures staging can’t: a missing environment variable, a broken CDN path, an expired third-party key.

Write flows create something: a signup, a new project, an order, an uploaded file. They can run in production when every value they type is marked, and something deletes what they made. The rest of this post is about those.

Some flows should never run in production, whatever cleanup you have:

  • Pay with a real card. Stripe’s own testing page says it plainly: “The Stripe Services Agreement prohibits testing in live mode using real payment method details.” (Stripe testing docs)
  • Delete or cancel anything real: an account, a subscription, a booking.
  • Message real people: a newsletter, an invite to a real address, a support ticket a person will answer.
  • Change the test account’s own password or 2FA. Every other test that signs in with that login fails until someone fixes it.
  • Start something outside your app that can’t be taken back: a shipment, an invoice in your accounting tool, a public post.

TestWatch tests run on any environment of an app, so keep the split in how you run them. A schedule can pick its tests by tag, and it runs them against one environment: tag the production-safe tests and point that schedule at production. Write tests against staging too: when TestWatch writes a test, its agent explores the environment you choose, signing up and placing orders as it goes.

Give production its own test account

Don’t point production tests at a teammate’s real login. Create a test account for them: an ordinary user in your app, with only the data that user needs.

In TestWatch, a test signs in as a test account by name, or signs in as no one. Each environment then decides what that name means there: the same login as elsewhere, a login of its own, or not used. A test whose account isn’t used on an environment doesn’t run there. Next to other tests it shows as “Not run”, with no verdict, and doesn’t count as a run; a run made only of such tests isn’t started. That gives you a second way to keep a write flow that signs in off production: let it sign in as an account that production doesn’t use.

An account’s own inbox address and 2FA secret belong to its shared login, not to an environment’s own login. If your production test account needs a 2FA code, create an account that only production uses; its shared login is then production’s. Tests that sign in as it can only be written against production, since no other environment uses it, so keep them to read flows.

Production logins get extra guards once an app has two or more environments: only owners and admins can change them, and a production login that is also used on another environment goes to that environment’s preview URLs only if you allow it when you share it. When you create an environment named “production” or “prod”, in any capitalization, it is marked Production; for a name like “live” or “prod-eu”, tick “This is Production”. Renaming it later doesn’t change the mark, and once an app has two or more environments only an admin can set or change it.

Mark everything a test creates

A value you can’t tell apart from a customer’s is a value you can’t delete. So every value a test makes up needs a mark that no customer would type.

TestWatch tests get theirs from fixture helpers. unique('company') returns a value like tw-ra62nwsugj-p7xq2d, testEmail() an address with the same start, inbox() a real receive-only address with the same start, and track(value) records an id your app made, like an order number, which carries no mark. The middle part is the run tag: one letter (r for a run, g for writing a test, and h for fixing a test) and nine characters derived from that run, test writing or fix. Every test, retry and verify pass in it shares the tag. The six characters after the tag in a unique() or testEmail() value are fresh on each call, so a retry never hits “name already taken”.

Writing a test and fixing one count too: both run the test to check it, and those runs create real data under their own tag. While it writes a test, the agent is told to use the same prefix, and the values it types that carry it are listed as well. When TestWatch writes a test, its check rejects data built from the clock, which can’t be found again later, and the agent rewrites it; a test that still has it isn’t marked ready:

Data built from the clock

await page.getByLabel('Company name').fill(`Acme ${Date.now()}`);

What the check returns

builds test data from Date.now() — use unique('<what>') for a unique name / username, testEmail() for an email nobody reads (inbox() when the test reads it); they mint a fresh tw-<run> value every run

Production sends real email

On staging, an email that goes nowhere costs nothing. In production, your app really sends the welcome email, the receipt and the invite, through the same provider as your customers’ mail.

testEmail() addresses end in example.com unless you set a test email domain for the app. That domain is reserved for examples by RFC 2606: “The Internet Assigned Numbers Authority (IANA) also currently has the following second level domain names reserved which can be used as examples.” It also refuses mail. Its DNS has a single MX record, 0 ., which is the “null MX” of RFC 7505: “To indicate that a domain does not accept email, it advertises a single MX RR”. So in production, every email your app sends to one of those addresses fails delivery and comes back to your email provider as a bounce.

Two ways out. For any flow that makes your app send mail, use inbox(): the address really receives mail, and the test can read the link or code in it. When TestWatch writes a signup test, it already uses inbox() for the email field; see testing email verification. For fields nobody emails, testEmail() is fine, or set the app’s test email domain to a subdomain you own, so test users are easy to find and the mail lands somewhere you control.

Clean up after every run

Marking data is half the job; deleting it is the other half. TestWatch doesn’t delete anything in your app. It tells your backend what to delete.

Add one cleanup webhook per app. After a run closes, or writing or fixing a test ends, and only if something was created, TestWatch sends one signed test_data.created request with its prefix and the list of values. This is its shape for a scheduled production run that created a company, a billing email and an order (the ids are made up; the shape is what the real code sends):

{
  "type": "test_data.created",
  "timestamp": "2026-11-09T06:00:12.000Z",
  "data": {
    "workspaceId": "ws_example",
    "app": { "id": "app_example", "name": "Shop" },
    "source": "run",
    "sourceId": "run_example",
    "runTag": "ra62nwsugj",
    "targetUrl": "https://shop.example.com",
    "run": {
      "id": "run_example",
      "trigger": "scheduled",
      "environment": "Production",
      "url": "https://app.testwatch.dev/apps/app_example/runs/run_example"
    },
    "generation": null,
    "heal": null,
    "items": [
      {
        "kind": "unique",
        "value": "tw-ra62nwsugj-p7xq2d",
        "label": "company",
        "testCaseId": "tc_example",
        "testName": "Create a company and place an order",
        "resultId": "res_example",
        "attempt": 1,
        "createdAt": "2026-11-09T06:00:04.000Z"
      },
      {
        "kind": "email",
        "value": "tw-ra62nwsugj-h4ce9w@example.com",
        "label": "billing",
        "testCaseId": "tc_example",
        "testName": "Create a company and place an order",
        "resultId": "res_example",
        "attempt": 1,
        "createdAt": "2026-11-09T06:00:04.000Z"
      },
      {
        "kind": "tracked",
        "value": "SO-104882",
        "label": "order",
        "testCaseId": "tc_example",
        "testName": "Create a company and place an order",
        "resultId": "res_example",
        "attempt": 1,
        "createdAt": "2026-11-09T06:00:09.000Z"
      }
    ],
    "prefix": "tw-ra62nwsugj",
    "totalItems": 3,
    "truncated": false
  }
}

Three rules for the handler. Delete by the exact prefix, never by a bare tw-, which would also hit other runs. Check a tracked value belongs to test data before you delete it: it is an id your app made and carries no prefix. And compact values from unique('x', { compact: true }) have no dash after tw, so use the listed values for those. The webhook is on every plan; a handler you can copy and the retry rules are on clean up the data your tests create.

Keep production pages out of the evidence

A run saves a screenshot after every top-level test step, the console and network logs, and a video when it fails, so you can see why. In production those screenshots show whatever the test account can see. Known secrets, auth headers, cookies and tokens are scrubbed from stored evidence, and query values in network logs are masked. Images can’t be scrubbed, so each app can turn screenshots and video off entirely; steps, console and network logs are still kept. The switch is per app, so it applies to that app’s staging runs too.

Passing runs make no AI calls. When a run fails, its scrubbed error text and a snapshot of the page go to AI models to work out why and propose a fix. A test account that sees only its own data keeps customer data out of both. How long evidence is kept, and where, is on the security page.

How often to check production

Read flows can run often; write flows usually once or a few times a day. Every device a test runs on counts as a run. On a schedule, the shortest gap depends on the plan:

PlanAs often asRuns included a monthOne flow, one device, at that gap
Freedaily50030 runs a month
Starterhourly2,500720 runs a month
Teamevery 15 minutes20,0002,880 runs a month

So on Starter, 3 flows checked hourly on one device fit in the included runs; on Team, 6 flows checked every 15 minutes. Going over is never billed. On Free, a failed scheduled run emails the workspace owner; paid plans add Slack and email alert rules. The full list of limits is on pricing.

What this doesn’t cover

Scheduled tests aren’t monitoring: they check at the times you set, not every second, and a flow that breaks between two runs stays broken until the next one. They aren’t a load test either. TestWatch doesn’t delete anything in your app, and an id your app made is listed only if the test called track() on it. If your production sits behind bot protection or a CAPTCHA, a run that hits it stops with a clear reason instead of getting past it; your own firewall rule can let through requests that carry a custom header you set as the environment’s protection. TestWatch sends it only to your own origin, with the limits listed there, so a challenge served from another host never sees it, and a redirect doesn’t carry it either. And none of this replaces a staging site for the flows on the never list above.

Questions

Is it safe to run signup tests in production?

Yes, if three things hold: the email address can receive mail (so your app’s verification email doesn’t bounce), every value the test makes up carries a prefix you can find, and something deletes those accounts after the run. Without cleanup, every run leaves one more real account in your database.

Will test runs show up in my analytics?

Usually, yes. The test drives a real browser that loads your pages and runs your scripts like any visitor. Filter test users out the same way your cleanup finds them: by the values a run lists, by the tw- prefix on names and email addresses (compact values start with tw and no dash), or by your test email domain.

Can I test production on the free plan?

Yes. Free includes 1 schedule, which can run daily, 500 runs a month, the cleanup webhook and a failure email to the workspace owner. Shorter gaps and Slack alerts come with paid plans. Plans and limits.

Try it on your own app

Describe a user flow in plain English and TestWatch writes a Playwright test you can read and export. Passing runs make no AI calls.

Start freeSee plans and pricing

Free: 5 tests, 500 runs a month, 2 apps and one daily schedule. Unlimited teammates, no card.