Skip to content

Environments

The environment option tags each run with the target it ran against — any string you like: "staging", "production", "pr-preview", and so on. The dashboard then offers an environment filter so you can scope runs (and flakiness) to one target.

Most teams wire it to an env var so each pipeline reports its own target:

playwright.config.ts
reporter: [
['@nijam/pw-reporter', {
apiKey: process.env.NIJAM_API_KEY,
projectId: '<your-project-uuid>',
environment: process.env.DEPLOY_ENV, // or "staging", process.env.NODE_ENV, etc.
}],
],

It’s free-form — Nijam doesn’t validate it against a fixed set. Pick a convention and stick to it so the filter stays tidy.

Runs reported without an environment are grouped under Unset in the dashboard. That’s a feature, not an error — you can always tell which runs carried no environment info, and filter them out.

A test that’s “flaky everywhere” and one that’s “flaky only on staging” are different problems. Tagging environments lets Nijam — and you — separate the two when reading a test’s history. See Flakiness.