EveryRole

Test accounts for each role, kept safe

Test accounts for QA: one per kind of user, made for testing, never a real person’s, with the least rights that do the job.

Good test accounts for QA follow four rules. One account per kind of user. Made for testing, never borrowed from a real person. The least rights that kind of user has, and no more. And the login kept somewhere a leak can’t reach: a password manager or your pipeline’s masked variables, never the repository or a chat.

The setup to replace is one test account, an admin, with its password in a wiki page. Here is what to have instead.

Five rows. A visitor has no account and is tested signed out. A viewer account proves what a read-only user is refused. An editor account runs the main journeys. A second editor account proves one editor can't open another's things. An admin account is used on staging, and on production only if you decide so.
For an app with a viewer, an editor and an admin: four accounts, and the visitor, who needs none.

One test user per kind of user

List the kinds of people who use your app: a visitor, a free user, a paying one, an editor, a viewer, an admin. Each needs an account of its own, because each of them sees a different app.

Then add one more: a second account of the kind that owns things. Two editors, or two customers. It is the only way to test that one person can’t open what belongs to another by typing its address. We wrote that test up as the IDOR check, and it needs exactly this account.

Some states need an account kept in them. If your plans have limits, keep one account at its limit, and one on the paid plan, so “what does a full account see” and “what does a paying user get” can be checked without setting it up each time.

What you don’t need is five accounts per kind. One each. More accounts means more passwords to keep and more data to explain.

Made for testing, never a real person’s

Do not test with your own account, a colleague’s, or a customer’s who said it was fine.

  • Your own account is the wrong kind. It is an admin with a year of data. It proves the app works for the person least like your users.
  • A real person’s account has real data. A test that creates, edits and deletes will do that to something that mattered.
  • A real person changes. They leave, change their password, turn on a second factor, get promoted to admin. Your tests break, or worse, start passing with rights they shouldn’t have.

Name test accounts so anyone can recognise them in a user list: qa-viewer, qa-editor, qa-editor-2. Give them an address on a mailbox you control, so reset and confirmation emails arrive somewhere.

The least rights that do the job

A test account is a way into your app that isn’t tied to a person. Treat it that way.

  • Give the viewer account a viewer’s rights. Don’t “make it admin for now”.
  • Keep admin test accounts on staging where you can. An admin on production can change what real customers see, and a test that goes wrong with that account goes wrong for everyone.
  • Tell your tests what they must never press. A test account can still reach “Delete account”, “Pay” and “Send to all”.
EveryRole's setting "what EveryRole will never do": a list of words it never clicks while exploring and in every test, among them Delete, Remove, Sign out, Unsubscribe, Cancel subscription, Close account, Pay, Buy and Checkout.
The words EveryRole never clicks on our practice app. You can add your own.

Where test accounts for QA keep their logins

Keep each login in a password manager shared with the people who need it, or in your pipeline’s masked variables for tests in CI, never in the repository, a wiki, a chat or a log. Better still, some apps can hand a test user a one-time sign-in link, so no password exists. Where the secret lives in CI, and the places it leaks, are in test credentials in CI.

Test accounts in production

Testing on the live app is worth it. It is the only place where your real configuration, real data sizes and real third parties are. The accounts just need a few extra rules:

  • Mark them. A flag or a naming rule, so they can be left out of revenue numbers, user counts and marketing emails.
  • Keep their data small and known. Three items with names you chose beat three hundred left by old runs.
  • Clean up after each run. Delete what the test made, and only that. See test data cleanup.
  • Protect them from your own clean-up scripts. The job that removes inactive accounts will find them one day.
  • Never use a production test account’s password anywhere else.

A second factor on a test account is a real trade. Switching it off makes the account weaker. Leaving it on means the test needs the code. If your app can issue a one-time sign-in link for a named test user, that settles it without a password or a code.

How EveryRole handles test logins

EveryRole starts without any. It explores your app signed out, as a visitor, from the address alone. Signed-in kinds of user come after, when you add them, each with a test account you made for it.

EveryRole's "Who uses" page for the practice app. The visitor row says no login is needed. The editor row is marked Signed in and has a field for the name of this kind of user and a switch "This kind of user is an admin".
Kinds of user in EveryRole: the visitor needs no login, and each signed-in kind is named and marked admin or not.

A kind of user can be marked as an admin, and by default an admin kind is explored and tested only on staging or previews, never on your live app.

There are three ways to sign it in, from least to most shared. Your app can hand it a one-time sign-in link for the test user on each run. Or the tests run in your own CI, where the logins live in your pipeline’s masked variables. Or you give it the test account’s password, which it keeps encrypted. In every case the password is never sent to an AI model.

It cleans up what a run made, and only that, and says so when it couldn’t. The accounts themselves are yours to make. It can’t know which kinds of user your app has until you tell it.

Keep reading

Roles and permissions

IDOR testing: open another user’s item by its URL

IDOR testing in one move. Log in as a second user, type the address of the first user’s item, and the app must answer not found. How to run it on every deploy.

6 min read

Roles and permissions

Role-based testing: your app is several apps

Role based testing means running each journey as every kind of user, each with its own expected result. One suite run as admin tests one of your apps.

5 min read