1. Using Variables (${variable})
Section titled “1. Using Variables (${variable})”Use variables to reuse test values across your steps:
id: tc_searchtitle: Search Test
variables: searchQuery: Wireless Headphones userName: Alex
steps: - navigate: / - act: Type '${searchQuery}' into the Search bar - act: Click 'Search' - validate: Verify '${searchQuery}' results are displayed2. Managing Secrets (${secret.KEY})
Section titled “2. Managing Secrets (${secret.KEY})”Never write real passwords or sensitive API tokens directly into your test files. Instead, use secret placeholders:
steps: - navigate: /login - act: Type 'admin@example.com' into 'Email' - act: Type '${secret.ADMIN_PASSWORD}' into 'Password' - act: Click 'Sign In'3. Storing Secrets
Section titled “3. Storing Secrets”Create a file named secrets.yaml in your project root (and add it to .gitignore):
secrets: ADMIN_PASSWORD: superSecretPassword123 PAYMENT_TOKEN: tok_test_12345You can also use a flat format without the secrets: wrapper — both work the same way:
ADMIN_PASSWORD: superSecretPassword123PAYMENT_TOKEN: tok_test_12345Alternative File Names
Section titled “Alternative File Names”ZeniTest also recognizes credentials.yaml as an alternative name. Both .yaml and .yml extensions are supported.
Where ZeniTest Looks for Secrets
Section titled “Where ZeniTest Looks for Secrets”The CLI searches for secrets files in this order:
- Inside your test directory (e.g.
zenitests/secrets.yaml) - In your project root (e.g.
./secrets.yamlor./credentials.yaml) - In your home folder at
~/.zenitest/secrets.yaml
If secrets are found in multiple locations, they are merged together. This means you can keep shared secrets in ~/.zenitest/ and project-specific ones in your project root.
ZeniTest automatically substitutes ${secret.ADMIN_PASSWORD} at runtime without exposing the value in test files or logs.