1. CI CD Integration
To integrate TestGrid test case execution with any CI tool, we have to follow the 3 step process:
-
- Get the parameter values for the CI API call.
- Build your CI CD API URL
- 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.
-
- Click on TestGrid TestCase Writer and select the Application you want to integrate with Jenkins.
-
- Click on the version name of the test cases you want to automate. (i.e. 1.0)
-
- Click on the “i” button, and a new tab will open with all the parameter values for TestGrid CI API for that version.
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
-
- 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.
-
- 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
-
- Click on the Configure button to go to the 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 bundle identifier or IPA/APK file there are following different API calls.
- 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