According to a recent Nordic APIs statistics roundup, over 90% of developers are using APIs, and they spend nearly 30% of their time coding APIs. This clearly illustrates how important APIs have become for businesses but also how much impact they have on the workload of IT professionals. Many of those professionals will be familiar with Postman’s API Testing platform. They use it either to discover how third-party APIs work or to test the API they are developing themselves.
In this post, I will dig into some of the API Testing features that Postman offers and how you can use them in your API development process with webMethods API Management.
If you do not feel like reading, here is a demonstration.
Where do API Testing tools fit in?
This post is part of a series of technical posts that I announced in New API tools are transforming API Management . In that introduction, I used this simple representation of the API life cycle.
Looking at this simple representation, you would - logically - assume that API Testing fits into the testing phase of the lifecycle. However, in today’s modern software development processes, testing is no longer isolated to the validation of software that was written or changed. Test cases are used as design specifications, logic validation and even documentation.
The API life cycle is a high-level abstraction of the actual delivery process for APIs. Ultimately APIs are software, and our industry has well-established practices like DevOps and CI/CD for software delivery. The next diagram illustrates how the API life cycle can be mapped to different stakeholders.
It is safe to say that API Testing tools can deliver value at all stages and for all stakeholders. The API Product Manager will specify expected behavior with test cases. The developer will validate business logic with those same test cases. The API consumer uses those same test cases - provided as part of the API documentation - to discover how the API works and behave. Test cases are used at different stage of the lifecycle in different ways, which is why it is so important to automate testing within your CICD pipeline.
Automating API Testing with Postman
It is not my intent to explain how to use Postman in this post. You can find plenty of information on that on their website. I will explain how you can use both Postman and webMethods API Management together in an automated CICD pipeline. I will use GitHub Actions for implementing the pipeline.
Postman Collections provide a mechanism for organizing and collaborating on API test cases. They can be used as the vehicle for sharing test cases across all stages of the API lifecycle. Collections can also be used for automating API tests using Postman’s Newman command-line tool, which can easily be integrated into the GitHub Actions pipeline.
In this demonstration, I will show you:
- How you can use Postman Collections manually.
- How you can execute Postman Collections from within your CICD pipeline.
- How you can inspect the outcomes of the tests that were performed as part of your CICD pipeline.
What’s next?
If you’d like to learn more about the Postman platform, you can create a free account and try it out.
If you’d like to learn more about CICD with GitHub Actions for webMethods API Management, check out this article .