Variables
Are a set of predefined keys that can be used throughout a configuration file.
- environment variables
- base urls
- filenames
- ports
- usernames
Note you can also use our managed variables and encrypted secrets system if you would like to optionally host them on our backend.
Defining Varibles
To define a variable create a variables
block under global
, the variables section accepts an array of key value pairs.
Variables can reference any environment variables that are available.
Usage
name: login-api
global:
variables:
ENV_1: production
ENV_2: a|env::ENVIRONMENT|
Using Variables
You can access a variable in a configuration file anywhere by following the below syntax.
a|var::<VARIABLE_NAME>|
name: login-api
global:
variables:
ENV_1: production
ENV_2: a|env::ENVIRONMENT|
interface:
user/login:
output: http
method: POST
actions:
- name: LoginBody
input: a|body
hide_data_on_success: true
hide_data_on_error: true
assert:
tests:
- value: email
is_not_null: true
- value: a|var::ENV_1|
is_not_null: true