image NDepend – Use query language to generate dependency reports image .NET IConfiguration pipeline viewer

QAToolKit part 2 – Swagger library

Welcome to part 2 of the QAToolKit series, where I focus on the QAToolKit Swagger library.

QA Toolkit is a collection of libraries, tools, and scripts for running automated jobs for assuring smooth development, general and QA testing, and running fitness functions for your applications.

Now let’s focus on the Swagger library.

If you are developing HTTP APIs, you are probably using Swagger to document, test, and share those APIs with your consumers or other developers. Those developers can use Swagger files to see what your APIs are doing and what the contracts are. They can also generate a client code in many languages from Swagger files and then consume your services.

Now that we know what Swagger files are, we can check what the QAToolKit Swagger library can do for us. The whole story about QAToolkit revolves around performing fitness functions, high-level testing, or End-2-End testing if you like. And Swagger library is a data source for performing those actions. We can import a Swagger file and generate a list of requests, which we can use to perform service tests, integration tests, load tests, etc.

The swagger library gives you an abstraction and useful functions over the Swagger file. Here is code that captures the essence of the library:

If we look at the code above, we first create a SwaggerUrlSource and add a request filter. The filter will collect only GET requests (GET HTTP Method). Then, we load 2 Swagger URL source files and get a list of requests back (only GET methods).

This on its own is not very useful, but by connecting those request results with other QAToolKit libraries or your own code, you can create something useful. You could pipe the results to the QAToolkit Bombardier or HttpTester libraries and perform the meaningful tests.

There is good documentation on Github, which you can check out in the library source repository.

If you like watching educational videos on YouTube, I invite you to go to my channel and check out the Swagger library’s two videos.

I hope you find QAToolKit useful, and let me know if you have any comments and suggestions. Go to a discord channel or Github page to get in touch!


About Miha
I've always been fascinated by computers. I am happy that I can work in this creative field of software development, where I can solve problems. I am also an avid cyclist :) and I love to learn...a lot!
Related Posts
  • All
  • By Author
  • By Category
  • By Tag

Leave a Reply