Introduction
Most probably, your staging and production APIs respond to most requests with 200 OK. Having a shared set of validations between multiple environments is handy as you can set 200 OK once and have it validated against all of environments. What about response time? Does your staging API respond to login requests as fast as your production API does? Probably not and that’s OK because for test environment, the response time is not that important. How would you set the “Response Time” validation for a scenario like this? Up until today, there wasn’t an easy way to set these kind of validations but that’s not the case anymore.
Apart from shared validations, Testfully also allows you to define a set of validations specific to an environment. Moreover, you can mix and match both features together and have a set of validations (for example, Response Code) shared between all environments and have Response Time per environment.
How It Works
The Validations tab in Test Editor continues to be the place to set validations. We have updated this section so that it accepts a set of validations for all environments and a set per environment that is added to your workspace. Click on the environment names to expand and collapse the validations form for that environment.
We’re very excited to see how this feature improves your development workflow and would love to hear what you think about this feature. Also, we have put together some FAQs for you and highly recommend to go through them, it won’t take much of your time.
Frequently Asked Questions
We got an answer for your questions
-
What’s going to happen to my existing test cases?
Your existing test cases will continue to work as you expect. The validations appear under the “All Environments” section.
-
Do I need to set validations for all environments?
Do I need to set validations for all environments?
-
What would happen if I set a common Response Time validation of 200 milliseconds and 250 milliseconds for my staging API?
When running your test against staging API, Testfully takes the 250 milliseconds as that’s what you have set explicitly for the staging API. For any other environment you might have (for example, Production), Testfully will use 200 milliseconds as the expected Response Time.
-
What would happen if I set shared Response Body and a Response Body for my production API?
When it’s time to validate Response Body of your test against the production API, Testfully will merge the expected “Response Body” for Production API into the shared Response Body and uses the result as the expected response body. This is also same for Response Headers.