API Testing Automation in AWS

 

API stands for Application Programming Language, API testing mainly focuses on testing themselves on API directly and also used as a part of integration testing to check the compatibility, security and to verify functional paths, functionality and reliability between two different applications. The whole new generation prefers API instead of GUI testing because it is considered as the most stable interface to do the system under test. API automation can help to increase efficiency and expedite the testing.

Here we emphasize, how to automate the API test using serverless technologies, including AWS CodePipeline and AWS CodeBuild, along with Postman.

AWS CodePipeline

AWS CodePipeline is one of the Amazon Web Services Product, Which is fully managed continuous delivery service you can use to model, visualize, and automate your release pipelines / Software. Whenever the code has been changed, AWS CodePipeline will automatically make changes such as build, test, and launches the applications, depends upon this code change. In this case, GUI is a part of the development team to make a workflow configurations model for the release process within the pipeline.

One of the benefits is, it can be easily integrated with third party services such as GitHub or Jenkins, and your own customized plugins.

A sample working image of AWS CodePipeline is shown below.

AWS CodeBuild

AWS CodeBuild is a fully managed continuous integration service in the cloud, can compile the source code, run the test and provides the source packages which are ready to deploy on the build. The key point of using AWS CodeBuild is, it will never make your build project to wait in the queue, it keeps continuously processing your submitted builds and also allows you to run the separate builds concurrently.

Regarding the security concerns, the AWS CodeBuild will encrypt your artefacts/projects with client-specific keys and which are managed and maintained by AWS Key Management Service (KMS). In both the AWS CodeBuild and CodePipeline, they are integrated with IAM (AWS Identity and Access Management), so you can mention and assign which users can have the permission to access your project.

The following diagram shows how CodeBuild works;

  1. As for Input, you just need to share the CodeBuild with your build project and it must contain all kinds of information like the source code, commands to run, where to store the output and which build environment to use.
  2. Once they get this information, the CodeBuild will develop the environment with the use of a Build Project.
  3. To this created environment, the CodeBuild will download the source code and then use the build specification (collection of build commands and settings in YAML format) provided in the Build Project.
  4. Build environment has the ability to perform the task you specified in the build specification and it will upload the output to S3 bucket.
  5. While the build is running, the build environments will send information to CodeBuild and Amazon CloudWatch Logs and at the same time, you can use the Codebuild console and AWS CLI to get summarized information from CodeBuild.

Postman

Postman is an API development tool which helps to test, build, and modify the APIs which are created by others or the test, ones you made yourself. Postman has the ability to convert the API to code for various languages, saving environments for later use and make various HTTP requests.

0. It’s Free and Easy to Start

1. Wide support for all APIs and Schemas

2. It’s Extensible

3. Support and Community

Continuous Integration helps improve software quality. Thus you can incorporate AWS Services like CodeBuild and CodePipeline with Postman, implement Continuous Integration and DevOps best practices into your API development process.

Leave a Reply