3 Ways Subtests Can Improve Your API Monitoring and Testing

综合技术 2016-12-13

Have you ever wished you could reuse a set of tests and avoid that pesky duplication? Well, with the addition of Subtest Steps , now you can and it's as easy as pie!

Subtest Steps

For starters, let's take a look at the most common use cases for using subtests:

  • Reuse Common Functionality

Need to generate a refresh token on each test run? Now you can create a test to generate a token and use that test as a step in other tests. When the token generation process changes, you only need to update it in one place .

  • Setup/Teardown Steps

If your tests need to set up data before running, or clean up after themselves, subtests can group the required API calls for setup and teardown into a single, reusable step.

  • Organize Your Tests into Suites

Running a set of related tests as a group is now possible. Create suites of related tests and run them all together as a unit, with notifications for the result of the whole suite.

You can find the Subtest Step option in your Test Editor under "+Add Step":

And this is what it will look like:

You can specify the test's Bucket , Name , and Environment to be used as a subtest, and you can position it anywhere in your Steps workflow.

Subtests are a powerful tool to help you create a more robust set of tests, while also simplifying your workflow. To make things even better, you can also pass dynamic data from other steps to subtests , and extract data from the result to use in subsequent steps.

In the next weeks, we'll be showing a few use cases for how you can use subtests to improve your API tests workflow. If there's anything specific you would like to see, please let us know by reaching out to us on Twitter @Runscope , or email us athelp@runscope.com.

If you're new to API testing, learn more about Runscope's cloud-based API testing solution and sign up for your free trial account .

Related Resources

Categories:announcements, product

Runscope Blog

责编内容by:Runscope Blog (源链)。感谢您的支持!

您可能感兴趣的

What I want from a logging API This is intended as an Experience Report about logging in Go. There are many like it but this one i...
An Image-Diff Is Worth 1,000 Words An Image-Diff Is Worth 1,000 Words In 2016 we released ourJavaScript SDK, which brought Button’s...
Kubernetes: Prevent Container from accessing Clust... I’ve recently been playing with Kubernetes as way to efficiently host my microservices. It’s great a...
Learning About API Design With Resources That Matt... I have been helping my partner in crime Audrey Watters ( @audreywatters ) evolve her data work...
MAAS 2.3.0 beta 1 released This originally appeared on Andres Rodriguez’ blog New Features & Improvements Hardwa...