Integrate Testsigma with AWS Lambda


With AWS Lambda, you can run code for virtually any application or backend service. CodeCommit is a trigger for AWS Lambda execution. This article discusses how you can integrate AWS Lambda with Testsigma.


How to Add an Execution Step in AWS Lambda:

  1. Go to the functions option under AWS Lambda and click on Create Functions. create function button in AWS Lambda
  2. Fill in the basic information for creating a function and click on Create Function. enter basic information to create function in AWS Lambda
  3. Once the function is created, you can scroll down to Basic Settings to check the Handler file information along with the basic timeout details.

    In the screenshot below, you can see that hello.handler is your handler file. handler information for Testsigma integration in AWS Lambda

  4. You can check the hello.handler file if you scroll up.

    In the screenshot below, you can see that the hello.handler file contains the aws-testsigma.sh file. This aws-testsigma.sh file will contain all the information of the test plan. function code for Testsigma integration in AWS Lambda

  5. The aws-testsigma.sh should contain the below information of the Test Plan ID and API Key which you need to trigger:

    #********START USER_INPUTS ********
    
    TESTSIGMA_USER_NAME=<Username>
    TESTSIGMA_PASSWORD=<Password>
    TESTSIGMA_TEST_PLAN_RUN_URL=<Test Plan URL containing the unique Test Plan id>
    MAX_WAIT_TIME_FOR_SCRIPT_TO_EXIT=180
    JSON_OUTPUT_REPORTS_DIR=.
    
    #********END USER_INPUTS***********

    aws-testsigma.sh information in AWS Lambda

The URL details for the test plan can be taken from REST API call to start Test Plan section in Testsigma. Get Test Plan ID

  1. Click on TEST at the top right corner to trigger the Test Plan. test Testsigma integration in AWS Lambda

    execution results of Testsigma integration in AWS Lambda

That's all we need to automate Test Execution when a successful build is triggered using the AWS Lambda.

Source: https://aws.amazon.com/lambda/