1. CI CD Integration

You are here:
< All Topics

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.

1. Getting the parameter values for TestGrid CI API

    • Login to the TestGrid website.

CI CD Integration step 1 Getting the parameter values

    • Click on TestGrid TestCase Writer and select the Application you want to integrate with Jenkins.

TestGrid TestCase Writer Dashboard

    • Click on the version name of the test cases you want to automate. (i.e. 1.0)

select version name of the test cases

    • Click on the “i” button, and a new tab will open with all the parameter values for TestGrid CI API for that version.

insert CI API parameters

2. Build your CI-CD API URL

    • Download the TestGrid CI-CD Postman collection from here and import it into the postman.
    • Once you import the postman collection you can see 3 APIs under “TG CI CD API” collection

Build your CI-CD API URL

    • Select the API based on the device Operating system and Automation framework.

selecting 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.

filling API parameters and other values in TestGrid Dashboard

    • 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

Jenkins as an example of the CI CD tool

    • Click on your application

Dashboard to choose your application

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

Jenkins application configurations dashboard

    • 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 bundle identifier or IPA/APK file there are following different API calls.

Appium iOS With Bundle Identifier.

      • Syntax:
curl -X POST \
https://www.testgrid.io/ci/ \
-F user_token=Token_For_Registered_User_Account \
-F application_token=Token_For_Registered_Application \
-F version_token=Token_For_Version_Of_TestCases \
-F version_module_id=Id_For_Module_Of_TestCases \
-F process_type=oia \
-F s_device=Device_Token \
-F bundle_identifier=Bundle_Identifier_Of_Application

Appium iOS With IPA file.

      • Syntax:
curl -X POST \
https://www.testgrid.io/ci/ \
-F user_token=Token_For_Registered_User_Account \
-F application_token=Token_For_Registered_Application \
-F version_token=Token_For_Version_Of_TestCases \
-F version_module_id=Id_For_Module_Of_TestCases \
-F process_type=oia \
-F s_device=Device_Token \
-F zip_file=IPA_File

 XCTest iOS With Bundle Identifier.

      • Syntax:
curl -X POST \
https://www.testgrid.io/ci/ \
-F user_token=Token_For_Registered_User_Account \
-F application_token=Token_For_Registered_Application \
-F version_token=Token_For_Version_Of_TestCases \
-F version_module_id=Id_For_Module_Of_TestCases \
-F process_type=oix \
-F s_device=Device_Token \
-F bundle_identifier=Bundle_Identifier_Of_Application

 XCTest iOS With IPA file.

      • Syntax:
curl -X POST \
https://www.testgrid.io/ci/ \
-F user_token=Token_For_Registered_User_Account \
-F application_token=Token_For_Registered_Application \
-F version_token=Token_For_Version_Of_TestCases \
-F version_module_id=Id_For_Module_Of_TestCases \
-F process_type=oix \
-F s_device=Device_Token \
-F zip_file=IPA_File

 Appium Android With Bundle Identifier.

      • Syntax:
curl -X POST \
https://www.testgrid.io/ci/ \
-F user_token=Token_For_Registered_User_Account \
-F application_token=Token_For_Registered_Application \
-F version_token=Token_For_Version_Of_TestCases \
-F version_module_id=Id_For_Module_Of_TestCases \
-F process_type=oaa \
-F s_device=Device_Token \
-F bundle_identifier=Bundle_Identifier_Of_Application

 Appium Android With APK file

      • Syntax:
curl -X POST \
https://www.testgrid.io/ci/ \
-F user_token=Token_For_Registered_User_Account \
-F application_token=Token_For_Registered_Application \
-F version_token=Token_For_Version_Of_TestCases \
-F version_module_id=Id_For_Module_Of_TestCases \
-F process_type=oaa \
-F s_device=Device_Token \
-F zip_file=APK_File

 

 

Table of Contents