Skip to content

Writing tests

Variables and secrets

Test accounts, random data and template tokens.

All documentation

Values in steps can contain template tokens that are filled in when the test runs.

TokenValue
{{vars.NAME}}A project variable.
{{secrets.NAME}}An encrypted project secret (Pro and Team). Shown as •••••• in step results, logs and screenshot labels. Screenshots show the page as it is, so do not take one of a field that displays a secret.
{{random.email}}A fresh address such as qa-k2j9x0d1lq@example.com. The same token keeps its value for the whole run.
{{random.string}}, {{random.number}}, {{random.uuid}}Random values, stable within one run.
{{run.id}}, {{now.iso}}, {{now.unix}}, {{env.baseUrl}}The run id, the start time and the environment URL.

Variables

Add variables in the project settings. Names use upper case letters, digits and underscores, such as TEST_EMAIL. A run that references a variable that does not exist fails before the browser starts, with the missing names listed.

Secrets

Secrets are encrypted with AES-256-GCM before they are stored and are never returned by the API or shown in the app again. They are decrypted only inside the run that uses them. Use dedicated test accounts on staging, not personal or production credentials.

json
{
  "type": "fill",
  "target": {
    "by": "label",
    "text": "Password"
  },
  "value": "{{secrets.TEST_PASSWORD}}"
}