Skip to content

Add test accounts

Most of an application lives behind the login. Give the test an account for each role and it signs in, tests behind the login and plays the roles against each other.

How many roles you can add

Any order includes one role per hostname. With the multiple-roles option on a full test you can add up to four roles per hostname. The test then takes each ordered pair of roles and attempts what only the first should reach while signed in as the second. Four roles make twelve pairs.

Use accounts created for testing. A good set is an admin, a standard user and a user in a second tenant.

Add an account that signs in with a password

  1. In the portal, open the hostname and choose Add a test account so the test runs signed in.
  2. Role: a name you will recognize in the results, for example Admin, Standard user or Tenant B manager. Up to 60 characters, and each role name is used once per hostname.
  3. Signs in with: choose Username and password.
  4. Login page: the full address of the login page. It has to be an https address on the same hostname, for example https://app.yourcompany.com/login.
  5. Username or email, and Password.
  6. Authenticator setup key, if this account uses 2-step codes (optional): paste the setup key behind the QR code, or the otpauth:// link. The test generates the codes itself.
  7. Login steps, in plain English (optional): for example: Click Log in with email, enter the email and password, click Sign in.
  8. You are signed in when (optional): what a successful login looks like, for example: the page shows Dashboard and the account menu.
  9. Press Save test account.

Add an account that uses an API key

  1. Choose Add a test account so the test runs signed in, or Add another role.
  2. Signs in with: choose API key or bearer token.
  3. Header name: the header the key travels in, for example Authorization or X-Api-Key.
  4. Header value: the key itself, or the full value such as Bearer followed by the token.
  5. An address that only answers with this key (the login check calls it): an https address on the same hostname, for example https://app.yourcompany.com/api/me.
  6. Notes for the tester (optional): what the key may do and which tenant or account it belongs to.
  7. Press Save test account.

Check that the login works

A login check proves the account works before a test depends on it.

  1. Next to the account, press Test login.
  2. Wait while the chip reads Checking the login, a minute or two. The test runner is signing in.
  3. Read the result: Login works, or Login failed with a short reason. Fix the account or the steps and check again.
  • Login checks open once the hostname is verified, signed for and on a paid order, because a check sends traffic to your site.
  • Each hostname has ten login checks a day.
  • Saving a change to an account clears its last result. It reads Login not checked yet until you press Test login again.

How your secrets are protected

Passwords, authenticator keys and API keys are encrypted in your browser before they leave it. The key that opens them is held only by the test runner, which uses them to sign in during a test. Grapefruit's website and database store the sealed text and cannot read it.

Each sealed value is bound to its hostname, so it cannot be moved to another hostname and still open. The role name, username, login page and your notes are stored as ordinary text so the portal can show them to you.

Edit or delete an account

  1. Press Edit next to the account, change it and press Save changes. Leave the password or key blank to keep the saved one.
  2. Press Delete to remove the account and its sealed secrets at once.
  • Test accounts are also deleted automatically 30 days after the last test of that hostname.
  • If you rotate a test password in your application, edit the account and enter the new one before the next scheduled test.
  • An account that uses an API key also lets a retest of a finding sign in again. See the retest article.