07/03/2017 Changelog Christopher Reichert

Many different API testing use-cases rely on some form of static data fixtures to test various instances of an application. For example, it's common to use seeded data when testing pre-production API environments like staging or qa. It's also common to have set of test users in production systems specifically for automated testing.

Assertible's new environment level variables feature makes it easier and faster to write reliable tests using these static data fixtures, no matter where your web service is deployed.

Assertible environment variable configuration

Environment variables are great for:

  • Representing seed data fixtures in pre-production and production environments.
  • Avoiding superfluous setup and teardown steps, making tests more robust and less flaky.
  • Reducing duplication of variables between tests
  • Reducing test maintenance by sharing common data

Setting up environment variables for your API tests

There are 3 places you can configure variables in Assertible:

Similar to environment auth, variables have an established precedence to make it easier to override variables on specific tests. The precedence is as follows:

  1. Test variables (highest precedence)
  2. Dynamic variables
  3. Environment variables (lowest precedence)

For example, if you have a variable named default-username in your environment, but create a new test and manually create a test variable with the same name, the test variable will be used and NOT the environment variable.

Furthermore, if you create a setup step which defines a default-username dynamic variable, it will override both the test variable and environment variable with the same key.

Next steps

These new features are available today for all accounts. To get started, check out the documentation for environments. If you have any questions or comments, contact us any time - we'd love to hear from you!

This is just the start of many improvements we plan on making to Assertible. Have an idea for how we can improve the API testing experience? Shoot me a message on Twitter or reach out directly and let's chat!

Start testing your API for free

:: Christopher Reichert

Categories

The easiest way to test and
monitor your web services

Define and test your web service with Assertible Track and test API deployments across environments Schedule API monitoring and failure alerts

Reduce bugs in web applications by using Assertible to create an automated QA pipeline that helps you catch failures & ship code faster.

Sign up for free