Test accounts for a whole team, without stepping on each other

Every API team has one: [email protected], password in a pinned chat message, used by everyone. It works until QA changes its language to German while a developer tests the English emails, a pipeline locks it with too many wrong passwords, and someone rotates the password without telling anyone.

Three kinds of test accounts

Role accounts are for reading and for checking permissions: qa-admin@, qa-member@, qa-viewer@. Tests log in as them but never change their profile, settings or permissions. Everyone can share them because nobody modifies them.

Personal accounts are for anything that changes the account itself: settings, language, notification preferences, 2FA. qa+anna@, qa+ivan@. Each person breaks their own.

Pipeline accounts are for CI: qa+ci-main@, qa+ci-nightly@. A pipeline that locks or changes its account only affects itself, and parallel pipelines don't share sessions.

Anything a test creates (orders, projects, documents) should be created fresh by the run, whatever account it uses. See unique test data.

Where the credentials live

Role and pipeline accounts: secret variables in the shared environment.

VariableStaging
adminEmail[email protected]
adminPassword•••••• (secret)
memberEmail[email protected]
memberPassword•••••• (secret)

Everyone in the workspace gets them automatically, encrypted and masked, and nobody pastes them in chat.

Personal accounts: a local .env file that overrides the shared values for your session:

Output
[email protected]
memberPassword=...

A key without an environment prefix keeps its name and applies whichever environment is selected; prefixed keys such as STAGING_… become lowercase names, so they suit snake_case variables.

Load it with Load .env in the app. See keep API keys out of your collections.

Log in by role

A collection pre-request script that logs in as the role the folder needs keeps requests free of credentials. Set the role on the folder:

JavaScript
// Folder pre-request on "Admin"
pm.variables.set('role', 'admin');

and let the collection script fetch a token for that role once per run (see pre-request script examples for a login script).

Resetting accounts

Shared accounts drift. Someone enables 2FA on qa-member "just to test". Keep a Reset test accounts folder that puts each role account back: name, language, 2FA off, password from the environment. Run it at the start of nightly runs, or whenever something looks off.

Rotating their passwords

When someone leaves, or every few months, rotate the role and pipeline passwords: change them in the API, then update the secret variable once. Every teammate and pipeline picks up the new value on its next run. Manage environments from the terminal shows how to update a secret from a script.