CI CD Integration

You are here:
< All Topics

CI CD Integration

CI CD Integration is one of the crucial processes for DevOps. Continuous integration (CI) is an efficient automation process for developers. When the CI is successful, it refers to the fact that any new code updates or additions to your app are regularly created, tested, and integrated into a shared hub. This method is especially helpful when you need to deliver apps regularly to clients, where you can automate the various stages of app development. So, with Continuous Integration, continuous delivery (CD) helps software development professionals deliver apps fast through the pipeline.

TestGrid platform helps you with smoother integration and delivery through an automated scriptless method.

To integrate TestGrid test case execution with any CI tool, we have to follow the 3 step process:

    1.  Get the parameter values for the CI API call.
    2.  Build your CI CD API URL
    3.  Call the TestGrid CI API from CI CD tools, i.e. Jenkins, etc.

 

1. Getting the parameter values for TestGrid CI API

  •  Go to the Dashboard and then click on “Codeless.”.

 

 

  • Click on “Test Case Writer” and then click on “Versions (TDP here as per the below screen). On the same screen, look for the “i” button in the upper right corner. Click on the “i” button icon.

 

 

  • You will be able to see keys like user tokens, application tokens, etc. You need to choose ‘process_type’ as appropriate for your web or mobile for the CI CD API, which we will discuss below.

 

2. Build your CI-CD API URL

      • Download the TestGrid CI-CD Postman collection from TestGrid API Collection and import it into Postman.
      • Once you import the Postman collection, you can see 3 APIs under the “TestGrid – CI Main” collection

 

    •   Select the API based on the device Operating system and Automation framework.
    • Fill all the values for the API parameters with the values we got from the previous step. Click on the Send button to test the API. Make sure you need to pass the POST URL as per the server on which you are testing.

 API parameters in TestGrid Automation Testing tool

    • Verify the response status and message for successful build execution on the TestGrid server.

3. Call the TestGrid CI API from CI CD tools

We can take Jenkins as an example of the CI CD tool.

    • Login into the Jenkins web console

    • Click on your application

Jenkins dashboard

    • Click on the Configure button to go to the Jenkins application configurations.

Jenkins application configurations

    • Scroll to the Build section. In the build step, add the TestGrid CI integration API call. Based on your test case automation platform type, device operating system type, and launching the application with a bundle identifier or IPA/APK file, there are the following different API calls:

Selenium Web With Website URL.

      • Syntax:
curl --location 'http://{your_domain}.testgrid.io/ci/app_build_run' \
--form 'user_token="{{Enter_Your_UserToken}}"' \
--form 'app_build_id="{{Enter_Your_app_build_id}}"' \
--form 'version_module_id="{{Enter_Your_version_module_id}}"' \
--form 's_device="{{Enter_Your_s_device}}"' \
--form 'process_type="OW"' \
--form 'application_token="{{Enter_Your_ApplicationToken}}"' \
--form 'version_token="{{Enter_Your_VersionToken}}"'

Appium iOS With Bundle Identifier.

      • Syntax:
curl --location 'https://{your_domain}.testgrid.io/ci/app_build_run' \
--form 'application_token='{{Enter_Your_ApplicationToken}}'' \
--form 'user_token='{{Enter_Your_UserToken}}'' \
--form 'version_token='{{Enter_Your_VersionToken}}'' \
--form 'version_module_id='{{Enter_Your_version_module_id}}'' \
--form 's_device='{{Enter_Your_s_device}}'' \
--form 'process_type='oia'' \
--form 'app_build_id='{{Enter_Your_app_build_id}}'' \
--form 'bundle_identifier="Your_Bundle_id"' \

Appium iOS with App Build ID.

      • Syntax:
curl --location 'https://{your_domain}.testgrid.io/ci/app_build_run' \
--form 'user_token="{{Enter_Your_UserToken}}"' \ 
--form 'application_token="{{Enter_Your_ApplicationToken}}"' \ 
--form 'version_token="{{Enter_Your_VersionToken}}"' \ 
--form 'version_module_id="{{Enter_Your_version_module_id}}"' \ 
--form 'process_type="oia"' \ 
--form 's_device="{{Enter_Your_s_device}}"' \
--form 'bundle_identifier="Your_Bundle_id"'\ 
--form 'app_build_id="{{Enter_Your_app_build_id}}"' \

 Appium Android With Bundle Identifier.

      • Syntax:
curl --location 'https://{your_domain}.testgrid.io/ci/app_build_run' \
--form 'application_token='{{Enter_Your_ApplicationToken}}'' \
--form 'user_token='{{Enter_Your_UserToken}}'' \
--form 'version_token='{{Enter_Your_VersionToken}}'' \
--form 'version_module_id='{{Enter_Your_version_module_id}}'' \
--form 's_device='{{Enter_Your_s_device}}'' \
--form 'process_type='oaa'' \
--form 'app_build_id="{{Enter_Your_app_build_id}}"' \
--form 'bundle_identifier='Your_Bundle_id'' \

 Appium Android With App Build ID.

      • Syntax:
curl --location 'https://{your_domain}.testgrid.io/ci/app_build_run' \
--form 'user_token="{{Enter_Your_UserToken}}"' \
--form 'application_token="{{Enter_Your_ApplicationToken}}"' \ 
--form 'version_token="{{Enter_Your_VersionToken}}"' \
--form 'version_module_id="{{Enter_Your_version_module_id}}"' \ 
--form 'process_type="oaa"' \
--form 's_device="{{Enter_Your_s_device}}"' \
--form 'bundle_identifier="Your_Bundle_id"'\ 
--form 'app_build_id="{{Enter_Your_app_build_id}}"' \


Hint: You can get the desired curl for this API from the Postman Collection as well to implement in your automation scripts.

 

Table of Contents