Environments
Environments, not to be mistaken with Environment Variables in other platforms, enable our users to work with APIs that are available in different deployment environments. (e.g. Dev, Staging, Production)
Oftentimes Testfully users have access to or work with APIs in different deployed environments. It's an industry standard to name these deployed environments with something that reflects their nature. For example, Dev
refers to an environment in which developers can test their code. Environments in Testfully are no different: a way to name your deployed API environments and use them later.
Features
Feature | Description | Status |
---|---|---|
Variables | Define variables and use them in requests | Available |
Authorization | Ability to set authorization settings for all requests | Available |
SSL Ceritificate Verification | Disable or enable SSL verification for a request | Available |
Timeout | Set a gloval timeout for all requests | Available |
Create a New Environment
- Navigate to the Environments section.
- Click on + (New Environment).
- Enter a name for your new environment (e.g.,
Dev
,Prod
). - Add variables as needed. Variables can be added later as well.
Add Variables to an Environment
- Open an existing environment.
- Add a new variable by entering its name and value.
- Click on Save to save the changes.
SSL Verification
Testfully verifies SSL certificates by default with the option to disable this feature explicitly when needed. To disable SSL verification for all requests that are sent against an environment,
- Open an environment
- Click on the Settings tab
- Select "Do Not Verify" as the value of the "SSL Verification" field.
Timeout
Testfully sets a default timeout of 30 seconds for all requests. You can apply a global timeout using an environment. The global timeout will be used when the environment is selected when sending requests. You can change this value by following the steps below:
- Open an environment
- Click on the Settings tab
- Enter a new value for the "Timeout" field.
Example
Let's say you're working with two instances of the same API in Dev
and Prod
environments. Your goal is to use Testfully for sending requests to both APIs without changing the Request definition. For a scenario like the above, the base URL for API endpoints will be different for Dev and Prod environments. Let's leverage the Environments feature of Testfully to tackle this challenge.
- Start by adding two new Environments:
Dev
andProd
. - Open
Dev
andProd
environments, add theapi_base_url
variable for both environments, then click on the "Save" button. - Open any of your requests and use
{{api_base_url}}
to load the value of Base Url. For example, I could use{{api_base_url}}/v1/users
for configuring the endpoint URL for the/v1/users
endpoint.
Let's test the solution:
- Head to the API Client UI, open one of the updated requests
- Select
Dev
environment from the dropdown, and click on theSend
button again. The request should be sent to theDev
API.