Building the Future: Crafting a Customizable API Testing Framework in Just 100 Hours

Posted on : 14 Feb, 10:00 PM

API Testing Framework


Imagine using API automation testing tools that save you and your team as much as 90% of your testing time. Let's say your team spends 10 hours per week testing. That's about 36 hours every month or 468 hours per year your team could be putting effort in elsewhere.


That's what a customizable API test automation framework can do for you. It can give you back time and resources to improve your project or your business. It will also give you better peace of mind allowing your product to run smoothly and efficiently.


This modular API test automation framework took our team of two engineers just 100 hours to build. While we've built many projects over the years, this one was significant. Soon after developing this API automation framework, we were able to configure it for one of our customers--a San Diego-based biotechnology firm--in just 60 hours. They used this framework for their cancer treatment diagnostics software.


Right out of the gate, we knew we were building a tool that could truly help change the world. The API testing framework would directly impact the quality of our customer's diagnostic software and provide them with better information for cancer patients and their families to make the most informed treatment decisions.


This article digs into the "nuts and bolts" behind the custom, modular API testing framework we built, why we made it the way we did, how it works, and the benefits it provides.


Achieving Consistency and Collaboration in an Evolving API Testing Environment

API Automation Testing Tools

In the ever-changing world of software development, with different teams building and testing different code segments at any given time, developing a standard test environment that everyone can agree on is essential.


When developers are assigned to different components of an application, such as an underlying framework or APIs, they will implement API testing best practices known as unit tests.


Unit tests are pieces of code that claim how parts of an application--its libraries, frameworks, APIs, and so on--will behave under certain conditions. Developers use these tests to determine when a change in one unit interferes with the functionality of another.


This is where the importance of an API automation testing framework comes into play. An API automation framework is a set of guidelines, best practices, tools, and rules for creating and designing test cases so QA professionals can test their code more efficiently.


There are millions of applications on the market, and they all serve a particular need or solve a specific business problem. But what if your application connects cancer patients to their targeted therapies?

What if you had the chance to build a diagnostics API testing software that allows doctors and researchers to understand, based on blood samples, the types of cancer treatments that will be most effective before any treatment administration. 


This would considerably impact the quality and comfort of cancer patient care.


Unveiling Our API Automation Framework Technology Stack

In building our API test automation framework, we chose four primary technologies.

 

Node.js

We developed our API testing software in Node.js and JavaScript to run our framework in any test environment; these technologies are ubiquitous and cross-platform.

 

TypeScript

We wrote the actual code in TypeScript, a syntactical superset of JavaScript. The advantage is that TypeScript provides more structure and decreases the chances of breaking the core code. 


Also, TypeScript compiles JavaScript in the runtime, so we were able to run our API testing framework on top of Node.js. This means we are genuinely a cross-platform framework that runs anytime, anywhere.

 

Mocha

For our testing environment, we used Mocha. Mocha is a feature-rich JavaScript API testing framework for Node.js programs, featuring browser support, asynchronous testing, test coverage reports, and the use of any assertion library.

 

InversifyJS

We also used InversifyJS, a lightweight inversion of control (IoC) container that can be used with TypeScript and JavaScript systems. The advantage of InversifyJS is that it serves as a mechanism for automatically creating the class dependencies in TypeScript, saving time, and improving accuracy.



The Reason Behind Building Our Custom Modular API Test Automation Framework

 

After researching ready-made test automation frameworks on the market, we soon realized that we needed more than the out-of-the-box solutions to give us everything we wanted in terms of customizability, maintainability, ease of use, and more. 


Our Technical Architect and senior-most Quality Engineer took to the task of building Integrant's own API test automation framework, completing the framework itself in just 100 hours.


Our API testing framework combines all the powerful and most compelling features of ready-made frameworks from around the web into one easy-to-use platform. We have complete control over its functionality and can easily perform basic REST operations and validations on the status code, message, headers, and response body.


API Test Automation Framework Benefits


Below are some immediate benefits we've seen from designing and developing our customized, modular API test automation framework, including best practices.

 

1- Ease of Use


One of the goals for designing this platform was that it should function like plug-and-play devices. In other words, quality assurance (QA) team members should be able to use an API automation testing framework even if they need help understanding how it works.


Our framework requires no additional coding because it uses English-like syntax, and you only need to remember one command to execute any or all test cases.


2- Traceability

 

Our API testing framework needed a robust and transparent reporting mechanism, so our QA engineers could provide details on each test case and how many were executed, failed, and passed.


3- Traceability

 

We wanted our API test automation framework to cover most test cases and scenarios without requiring extra development. We designed it so that new APIs could be tested on the fly simply by creating a new YAML file without writing a single line of code.


4- Maintainability

 

One of the key features we built into this API testing framework was maintainability. This means that:

 

● Changes and modifications in the API are applied within the API file.

● Test data is also easily changed.

● Codes are maintainable and can quickly adapt to any changes.

● Test cases do not need to be rewritten to be retested.

● Only one command can be used to rerun the tests.


5- Reusability

 

The ability to reuse our custom API test automation framework for multiple projects was a critical design decision in going with a custom solution. Not only does reusability make testing quicker, but it also lowers maintenance costs by simplifying processes for both developers and end-users alike.

 

Extending the code or framework, reconfiguring aspects, and setting up other test cases become much more manageable when reusability is built into the core structure.


6- Compatibility

 

We needed to ensure our API testing framework would support all major applications, platforms, and operating systems. Technology stacks and digital ecosystems constantly change, so we wanted to guarantee our platform is forward and backward-compatible with all major systems.


Exploring How an API Test Automation Framework Works

 

Several features and steps describe the "nuts and bolts" of how our modular API testing framework operates.

 

YAML Test Scenarios

The test scenarios for our modular API test automation framework  are written in accessible, human-readable YAML files. The custom framework executes the YAML files and analyzes the test scenarios.

 

Because YAML files use plain text and parse all testing scenarios, minimal development effort is needed to execute the API testing software. In other words, this framework can do most API automation testing in plain text format without requiring engineers to write or add extra codes.

 

An example of a YAML test file is shown here:


API Test Automation Framework

 


The YAML files also make the test framework extendable and allow it to complete more sophisticated, business-driven test scenarios.


File Executables

After the framework runs the test scenarios, two files are generated. One is an HTML report that includes the number of passed and failed test cases and the comparison of expected versus actual results achieved.

API Automation Framework


The second file generated is a log file that can be used by QA teams and engineers for further debugging or logging.  

 

Modifications can be easily made within this framework. You apply changes to the targeted test case and re-execute the desired scenarios and test cases with no code modifications needed.

 

Developers can write their own JavaScript code into the YAML file. The framework will digest the JavaScript in the YAML file and execute it. This methodology allows developers to extend the testing scope and add functionality without modifying the source code.

 

API Automation Framework Core Features

Our customized API test automation framework supports multiple features to ensure that all test scenarios run as effectively as possible.

 

API Automation Testing

1. Method Call (API Token)

 

The before-each and after-each features are used to run a method before or after each test case. There are two benefits to this:

It saves engineers the hassle of having to write the API every time.

We created a robust but flexible dataset; attributes can easily be turned off and on, and it's easy to enter additional products into the dataset.  

The intense customization of this dataset and website helped our client's sales team discover products and sell products they didn't even know they had in their own catalogs.

 

API Testing Software

2. Data-Driven Testing

 

A second feature of the API testing framework is that it supports data-driven testing. This means that:

The same test scenario can be run on multiple test data by configuring numerous test data sets.

A list of variables can be added, and the framework will run it as many times as the number of variables listed.

Write it once, and then run as much as you want.

 

API Testing Best Practices

3. Extensible Frameworks

 

The main class functions of the API test automation framework are easily accessible, which enables developers and engineers to extend the framework without writing any code. The API testing framework can be extended through API tasks, then used to create a scenario that can be integrated with multiple systems. This construction has the following advantages:


The Total Build and Timeframe It Took Us to Develop Our API Testing Framework 

 

Using best practices, we've learned through extensive testing experience that our API testing software team spent 100 hours building and then 60 hours customizing a modular API test automation framework.

 

Maintaining and Modifying the Stack

 

In looking back on the life cycle for our API automation framework, we determined that we would implement two significant changes in the future.

 

Indemnify JavaScript

 

Sometimes a client will ask for specific customizations that need to be done by writing the move files or indemnifying the JavaScript. In these cases, we need the ability to touch the code to customize it for a particular file type.

 

API Testing Framework Customization

 

The second change we would implement is to make adding a standard functionality in our API test automation framework easier, such as telling the system to force out "verbs" from the test scenarios. We also needed to cover batch testing of our test scripts.


What is API Automation


We Want to Help You

 

In the case of one biotechnology partner, our test automation framework covered 23 APIs and 460 test cases. As a result of our work, our customer was able to save as much as 90% of their time with this automated framework.


Ease of use and maintainability made our custom API testing framework particularly attractive. Adding test cases is as easy as opening a new document in Microsoft Word.


The tradeoff is clear: Our partners can significantly boost their productivity by saving time with automated software testing. Instead of focusing on software testing issues, you focus more energy on continuing to build effective, innovative solutions in your field, whether in cancer diagnostics, manufacturing, or more.


Do you want to see what our API test automation framework can do for you and your team? Schedule a demo with one of our test automation experts today!

Building the Future: Crafting a Customizable API Testing Framework in Just 100 Hours

Posted on : 14 Feb, 10:00 PM

API Testing Framework


Imagine using API automation testing tools that save you and your team as much as 90% of your testing time. Let's say your team spends 10 hours per week testing. That's about 36 hours every month or 468 hours per year your team could be putting effort in elsewhere.


That's what a customizable API test automation framework can do for you. It can give you back time and resources to improve your project or your business. It will also give you better peace of mind allowing your product to run smoothly and efficiently.


This modular API test automation framework took our team of two engineers just 100 hours to build. While we've built many projects over the years, this one was significant. Soon after developing this API automation framework, we were able to configure it for one of our customers--a San Diego-based biotechnology firm--in just 60 hours. They used this framework for their cancer treatment diagnostics software.


Right out of the gate, we knew we were building a tool that could truly help change the world. The API testing framework would directly impact the quality of our customer's diagnostic software and provide them with better information for cancer patients and their families to make the most informed treatment decisions.


This article digs into the "nuts and bolts" behind the custom, modular API testing framework we built, why we made it the way we did, how it works, and the benefits it provides.


Achieving Consistency and Collaboration in an Evolving API Testing Environment

API Automation Testing Tools

In the ever-changing world of software development, with different teams building and testing different code segments at any given time, developing a standard test environment that everyone can agree on is essential.


When developers are assigned to different components of an application, such as an underlying framework or APIs, they will implement API testing best practices known as unit tests.


Unit tests are pieces of code that claim how parts of an application--its libraries, frameworks, APIs, and so on--will behave under certain conditions. Developers use these tests to determine when a change in one unit interferes with the functionality of another.


This is where the importance of an API automation testing framework comes into play. An API automation framework is a set of guidelines, best practices, tools, and rules for creating and designing test cases so QA professionals can test their code more efficiently.


There are millions of applications on the market, and they all serve a particular need or solve a specific business problem. But what if your application connects cancer patients to their targeted therapies?

What if you had the chance to build a diagnostics API testing software that allows doctors and researchers to understand, based on blood samples, the types of cancer treatments that will be most effective before any treatment administration. 


This would considerably impact the quality and comfort of cancer patient care.


Unveiling Our API Automation Framework Technology Stack

In building our API test automation framework, we chose four primary technologies.

 

Node.js

We developed our API testing software in Node.js and JavaScript to run our framework in any test environment; these technologies are ubiquitous and cross-platform.

 

TypeScript

We wrote the actual code in TypeScript, a syntactical superset of JavaScript. The advantage is that TypeScript provides more structure and decreases the chances of breaking the core code. 


Also, TypeScript compiles JavaScript in the runtime, so we were able to run our API testing framework on top of Node.js. This means we are genuinely a cross-platform framework that runs anytime, anywhere.

 

Mocha

For our testing environment, we used Mocha. Mocha is a feature-rich JavaScript API testing framework for Node.js programs, featuring browser support, asynchronous testing, test coverage reports, and the use of any assertion library.

 

InversifyJS

We also used InversifyJS, a lightweight inversion of control (IoC) container that can be used with TypeScript and JavaScript systems. The advantage of InversifyJS is that it serves as a mechanism for automatically creating the class dependencies in TypeScript, saving time, and improving accuracy.



The Reason Behind Building Our Custom Modular API Test Automation Framework

 

After researching ready-made test automation frameworks on the market, we soon realized that we needed more than the out-of-the-box solutions to give us everything we wanted in terms of customizability, maintainability, ease of use, and more. 


Our Technical Architect and senior-most Quality Engineer took to the task of building Integrant's own API test automation framework, completing the framework itself in just 100 hours.


Our API testing framework combines all the powerful and most compelling features of ready-made frameworks from around the web into one easy-to-use platform. We have complete control over its functionality and can easily perform basic REST operations and validations on the status code, message, headers, and response body.


API Test Automation Framework Benefits


Below are some immediate benefits we've seen from designing and developing our customized, modular API test automation framework, including best practices.

 

1- Ease of Use


One of the goals for designing this platform was that it should function like plug-and-play devices. In other words, quality assurance (QA) team members should be able to use an API automation testing framework even if they need help understanding how it works.


Our framework requires no additional coding because it uses English-like syntax, and you only need to remember one command to execute any or all test cases.


2- Traceability

 

Our API testing framework needed a robust and transparent reporting mechanism, so our QA engineers could provide details on each test case and how many were executed, failed, and passed.


3- Traceability

 

We wanted our API test automation framework to cover most test cases and scenarios without requiring extra development. We designed it so that new APIs could be tested on the fly simply by creating a new YAML file without writing a single line of code.


4- Maintainability

 

One of the key features we built into this API testing framework was maintainability. This means that:

 

● Changes and modifications in the API are applied within the API file.

● Test data is also easily changed.

● Codes are maintainable and can quickly adapt to any changes.

● Test cases do not need to be rewritten to be retested.

● Only one command can be used to rerun the tests.


5- Reusability

 

The ability to reuse our custom API test automation framework for multiple projects was a critical design decision in going with a custom solution. Not only does reusability make testing quicker, but it also lowers maintenance costs by simplifying processes for both developers and end-users alike.

 

Extending the code or framework, reconfiguring aspects, and setting up other test cases become much more manageable when reusability is built into the core structure.


6- Compatibility

 

We needed to ensure our API testing framework would support all major applications, platforms, and operating systems. Technology stacks and digital ecosystems constantly change, so we wanted to guarantee our platform is forward and backward-compatible with all major systems.


Exploring How an API Test Automation Framework Works

 

Several features and steps describe the "nuts and bolts" of how our modular API testing framework operates.

 

YAML Test Scenarios

The test scenarios for our modular API test automation framework  are written in accessible, human-readable YAML files. The custom framework executes the YAML files and analyzes the test scenarios.

 

Because YAML files use plain text and parse all testing scenarios, minimal development effort is needed to execute the API testing software. In other words, this framework can do most API automation testing in plain text format without requiring engineers to write or add extra codes.

 

An example of a YAML test file is shown here:


API Test Automation Framework

 


The YAML files also make the test framework extendable and allow it to complete more sophisticated, business-driven test scenarios.


File Executables

After the framework runs the test scenarios, two files are generated. One is an HTML report that includes the number of passed and failed test cases and the comparison of expected versus actual results achieved.

API Automation Framework


The second file generated is a log file that can be used by QA teams and engineers for further debugging or logging.  

 

Modifications can be easily made within this framework. You apply changes to the targeted test case and re-execute the desired scenarios and test cases with no code modifications needed.

 

Developers can write their own JavaScript code into the YAML file. The framework will digest the JavaScript in the YAML file and execute it. This methodology allows developers to extend the testing scope and add functionality without modifying the source code.

 

API Automation Framework Core Features

Our customized API test automation framework supports multiple features to ensure that all test scenarios run as effectively as possible.

 

API Automation Testing

1. Method Call (API Token)

 

The before-each and after-each features are used to run a method before or after each test case. There are two benefits to this:

It saves engineers the hassle of having to write the API every time.

We created a robust but flexible dataset; attributes can easily be turned off and on, and it's easy to enter additional products into the dataset.  

The intense customization of this dataset and website helped our client's sales team discover products and sell products they didn't even know they had in their own catalogs.

 

API Testing Software

2. Data-Driven Testing

 

A second feature of the API testing framework is that it supports data-driven testing. This means that:

The same test scenario can be run on multiple test data by configuring numerous test data sets.

A list of variables can be added, and the framework will run it as many times as the number of variables listed.

Write it once, and then run as much as you want.

 

API Testing Best Practices

3. Extensible Frameworks

 

The main class functions of the API test automation framework are easily accessible, which enables developers and engineers to extend the framework without writing any code. The API testing framework can be extended through API tasks, then used to create a scenario that can be integrated with multiple systems. This construction has the following advantages:


The Total Build and Timeframe It Took Us to Develop Our API Testing Framework 

 

Using best practices, we've learned through extensive testing experience that our API testing software team spent 100 hours building and then 60 hours customizing a modular API test automation framework.

 

Maintaining and Modifying the Stack

 

In looking back on the life cycle for our API automation framework, we determined that we would implement two significant changes in the future.

 

Indemnify JavaScript

 

Sometimes a client will ask for specific customizations that need to be done by writing the move files or indemnifying the JavaScript. In these cases, we need the ability to touch the code to customize it for a particular file type.

 

API Testing Framework Customization

 

The second change we would implement is to make adding a standard functionality in our API test automation framework easier, such as telling the system to force out "verbs" from the test scenarios. We also needed to cover batch testing of our test scripts.


What is API Automation


We Want to Help You

 

In the case of one biotechnology partner, our test automation framework covered 23 APIs and 460 test cases. As a result of our work, our customer was able to save as much as 90% of their time with this automated framework.


Ease of use and maintainability made our custom API testing framework particularly attractive. Adding test cases is as easy as opening a new document in Microsoft Word.


The tradeoff is clear: Our partners can significantly boost their productivity by saving time with automated software testing. Instead of focusing on software testing issues, you focus more energy on continuing to build effective, innovative solutions in your field, whether in cancer diagnostics, manufacturing, or more.


Do you want to see what our API test automation framework can do for you and your team? Schedule a demo with one of our test automation experts today!


footer-img

Integrant’s Vision is to transform the software development lifecycle through predictable results.

Subscribe

To get our newsletter & stay updated

© 2024 Integrant, Inc. All Rights Reserved | Privacy