Request a demo
Use case

Use case: one suite, three environments and four roles for a SaaS product team

A worked example with a made-up HR software company: per-environment URLs and logins, personas with their own credentials, secrets kept as variable names, and running the same plan as every role.

November 6, 2026 · 8 min read · All articles

A SaaS product rarely has one environment and one kind of user. It has staging, a user-acceptance environment that customers' admins try releases in, a demo tenant for sales, and roles that see very different screens. A suite that only runs as one admin on one URL tests a fraction of the product. This example shows how InsightTestBench keeps one set of plans and runs it everywhere, as everyone.

Example · a made-up HR software company

Larkspur's people platform

Larkspur (a fictional company) sells an HR platform: employees request time off and update their details, managers approve requests, HR admins run payroll exports and configure policies, and a read-only auditor role can view but not change anything. Dev, the QA engineer, has to sign off each release on staging and then on UAT, where some customers' admins sign in through a test SSO page.

One configuration, keyed by environment

A project's configuration is JSON. Any setting that differs between environments can be given a _by_env form; settings that do not differ stay flat. When a run starts, the bench resolves each key for that run's environment in a fixed order.

Dev's configuration, abridged:

{
  "default_env": "staging",
  "base_url_by_env": {
    "staging": "https://app.staging.larkspur.example.test",
    "uat":     "https://app.uat.larkspur.example.test",
    "demo":    "https://demo.larkspur.example.test"
  },
  "login_url_by_env": { "staging": "/login", "uat": "/sso/test-login", "demo": "/login" },
  "post_login_wait_selector": "[data-testid=home-feed]",
  "secrets": {
    "hr_admin": {
      "staging": { "username_env": "LH_ADMIN_USER_STG", "password_env": "LH_ADMIN_PASS_STG" },
      "uat":     { "username_env": "LH_ADMIN_USER_UAT", "password_env": "LH_ADMIN_PASS_UAT" }
    },
    "manager":  { "username_env": "LH_MANAGER_USER", "password_env": "LH_MANAGER_PASS" },
    "employee": { "username_env": "LH_EMPLOYEE_USER", "password_env": "LH_EMPLOYEE_PASS" }
  }
}

UAT signs in on a different path, so login_url_by_env has three entries; the post-login selector is the same everywhere, so it stays flat. The admin has separate test users per environment; the other roles use the same variable names everywhere. Older, flat configurations (one login_url, secrets[persona] without environments) still work: the resolver detects the shape per persona.

Project settings with the configuration JSON and the per-environment guidance
A project's settings: the configuration JSON (here for the made-up claims portal used elsewhere in this blog) and the bench's own note on per-environment keys.

Secrets are names, not values

Nothing in the project, the database or the UI holds a password. The configuration names environment variables, your deployment sets them on the bench host, and at dispatch the bench resolves the project's secrets and adds them to the worker process's environment only; the run's live log lists the variable names it injected, never the values. The persona and environment of the run decide which pair of names the executor uses to sign in. Today the env source is the one implemented; the configuration format already has slots for AWS Secrets Manager, Vault and file sources, which are stubs for now.

Personas, and running as all of them

Each persona is a role with a name, a description, the variables it needs and a note on how it signs in. Cases name the persona they run as; a plan's run dialog picks the persona and the environment, or ticks Run for all personas to dispatch one run per persona at once. Each persona's run is compared with that persona's own baseline, so an employee's run is never compared with an admin's.

Run plan dialog with run-for-all-personas, persona and target environment
Starting a run: one persona and environment, or one run per persona.

How Dev signs off a release

  1. Run the regression suite on staging for all four personas. Every regression gets a look before anything moves on.
  2. Run the same suite on UAT as the HR admin and the employee, the two roles customers' admins actually test.
  3. Run the permission cases as the auditor on both: every write action should be refused.
  4. Keep a nightly schedule per environment for the employee persona, the largest population, notifying on regressions only.

Things to decide up front

  • Which environments are first-class. Every _by_env map should list all of them, or set a default_env.
  • Which roles need their own test users per environment. Shared names are simpler; separate ones keep a UAT password out of staging.
  • Who owns the variables. They live in your deployment's secret store and reach the bench host as environment variables.
  • Which personas each schedule runs as. One schedule is one persona and one environment; add schedules rather than widening one.
About this example. Larkspur, its people and its URLs are made up (the .example.test domain cannot resolve). The screenshots show the made-up claims-portal project used elsewhere in this blog, from InsightTestBench running locally with example data.