Skip to main content

Bitrise Integration with TestGrid

Overview

Bitrise is a continuous integration and continuous delivery (CI/CD) platform designed for mobile app development. It automates the build, test, and deployment processes for iOS and Android applications, making it easier for development teams to deliver high-quality mobile apps quickly and efficiently. Bitrise offers a cloud-based platform with a variety of integrations and a user-friendly interface, enabling developers to streamline their workflows, collaborate effectively, and ensure the reliability of their mobile applications throughout the development lifecycle.

Integrating TestGrid with Bitrise

Step 1: Sign in to your Bitrise account.

Image

 

  • You can select the app in which you like to integrate TestGrid build execution.

Step 2: Select an Application for TestGrid integration. Click on the Workflows button

Image

 

Step 3: Click on the Create Workflows button.

 

Image

 

Step 4: Click on the Add (+) button.

Image

 

Step 5: Enter the workflow name and select the Based on option as ‘Empty workflow’.

Image

 

Step 6: Click on Done button.

Image

 

Step 7: Click on Add step (+) button.

Image

 

Step 8: Search for ‘Script’ in the Search option.

Image

 

Step 9: Click on ‘Script’ option.

Image

 

Step 10: Scroll to the ‘Script content’ section.

Image

 

 

Step 11: You will see the sample script which we can use for calling curl command that triggers test cases on TestGrid Server.

Image

 

Step 12: Log into your TestGrid account using your valid credentials to get API parameters for Testcase.

  • Select the TestCase writer from the TestGrid dashboard, then select any of the applications.
  • When you click on the version, you will see the ‘i’ button on the right top corner of the screen. The continuous integration document window appears when you click the ‘i’ icon.

 

Image

 

You can then copy the required parameters and use them in the Script in the curl command.

 

Image

 

 

Here are the curl command syntax for different platforms

Selenium Web Syntax:

curl --location 'https://{your_domain}.testgrid.io/ci/app_build_run' \
--form 'application_token='a46e4ad3e18e880a4bcss50c05df66ef3c'' \
--form 'user_token='ochskrxwei4ujsssverxb8w5jfxj1bgnlsw'' \
--form 'version_token='34c4511734ed6a1bf7fe1a642deass0115'' \
--form 'version_module_id='15'' \
--form 's_device='QF37N5A'' \
--form 'process_type='ow'' \
--form 'test_website_url='https://www.google.com''

 

  • The syntax for Mobile with Build_id:
curl --location 'https://{your_domain}.testgrid.io/ci/app_build_run' \
--form 'application_token='a46e4ad3se18e880a4bc50aac05df66ef3c'' \
--form 'user_token='ochskrxwei4ujssverxb8w5jfxj1bgnlsw'' \
--form 'version_token='34sc4511734ed6a1bf7fe1ass642dea0115'' \
--form 'version_module_id='16'' \
--form 's_device='QF38N5U'' \
--form 'process_type='oaa'' \
--form 'app_build_id='27'' \

 

  • Syntax for Mobile with Bundle Identifier:
curl --location 'https://{your_domain}.testgrid.io/ci/app_build_run' \
--form 'application_token='a46e4ad3se18e880a4bc50aac05df66ef3c'' \
--form 'user_token='ochskrxwei4ujssverxb8w5jfxj1bgnlsw'' \
--form 'version_token='34sc4511734ed6a1bf7fe1ass642dea0115'' \
--form 'version_module_id='16'' \
--form 's_device='QF38N5U'' \
--form 'process_type='oaa'' \
--form 'bundle_identifier='Your_Bundle_id''

 

For the Mobile syntax “process_type” parameter we can pass “oaa” for Android and “oia” for Android.

 

Step 13: Once you copy the curl command use it into your Script.

  • Coming back to the Bitrise, we need to add the curl command to the script file.
  • Add the curl command in the script and click on Save button

Image

 

Step 14: Verify the script changes are saved. You can see the Saved button disabled.

Image

 

Step 15: Click on the ‘Run Workflow’ button.

Image

 

 

Step 16: Provide the name of the Branch and click on ‘Run Workflow’ button.

Image

 

Step 17: Wait for the build execution to get finished.

Image

 

Step 18: You can see the curl command response in logs and see the Build id and build version of the Run on TestGrid server.

Image

 

Step 19: You can navigate to the build id on the TestGrid portal to view the execution.

Image

 

Step 20: Verify the test execution results.

Image

 

You could even perform a single test in several browsers/Mobile at the same time.

 

Happy Testing!!😇

Table of Contents