Integrate BrowserStack App Automate with Bitrise
Bitrise is a mobile CI/CD Platform as a Service (PaaS) to automate the build and deploy process of your applications. It helps catch failures ahead of the production stage and mitigate them as they occur.
In the guide, you’ll learn how to:
- Add the “App Automate - XCUI” step in Bitrise
- Configure the “App Automate - XCUI” step in Bitrise
- Set up a trigger for XCUI in Bitrise
Prerequisite
- Bitrise account.
- Access to BrowserStack Username and Access key. To obtain your access credentials, sign up for a free trial or purchase a plan.
- Owner or maintainer access of the source repository, which you want to integrate with Bitrise.
- An app added to your Bitrise workspace. Check out the adding your first app section to add an app in Bitrise.
Add BrowserStack App Automate - XCUI step in Bitrise
To add the BrowserStack App Automate step in the workflow pipeline of your app, complete the following steps:
- Go to your Bitrise workspace and navigate to your app’s Build page.
- On the app’s Build page, click Edit workflow.
- On the Workflow Editor page, view the Workflows tab. The default steps are listed in the left pane. Click + to add a new step.
- Add and configure the Xcode Archive & Export for iOS step in your workflow.
This step exports the IPA file in the BITRISE_IPA_PATH output variable, which you can use when setting the IPA file path in BrowserStack’s step. - Click + under the Xcode Archive & Export for iOS step to add the test suite configuration step.
- Add and configure the Xcode Build for testing for iOS steps in your workflow.
This step exports the test suite in the BITRISE_TEST_BUNDLE_PATH output variable, which you can use when setting the test suite path in BrowserStack’s step. - Click + under the Xcode Build for testing for iOS step to add the BrowserStack’s step.
- In the steps pane, search and click BrowserStack App Automate - XCUI.
Ensure that you’ve added the BrowserStack App Automate - XCUI step under the Xcode Archive & Export for iOS and Xcode Build for testing for iOS steps, as shown in the following image:
Configure BrowserStack App Automate - XCUI step in Bitrise
To configure the BrowserStack App Automate - XCUI step in Bitrise, complete the following steps:
- Click the BrowserStack App Automate - XCUI step and view its configuration in the right pane.
- In the Input variables section of the BrowserStack App Automate - XCUI step, set the parameters as explained in the following table, and save it.
Key | Description | Flags | Value |
---|---|---|---|
BrowserStack username | Set your BrowserStack Username | Required | String |
BrowserStack access key | Set your BrowserStack Access Key | Required | String |
iOS app under test | Set the path of the app (.ipa) file. Add $BITRISE_IPA_PATH in the input field if you are using the Xcode Archive & Export for iOS step in the workflow. Else, you can add any other path of the file. |
Required |
Example: $BITRISE_IPA_PATH
|
XCUI test suite | Set the path of the output bundle file that contains your tests. Add $BITRISE_TEST_BUNDLE_PATH in the input field if you are using the Xcode Build for testing for iOS step in your workflow. Else, you can add any other path of the file. |
Required |
Example: $BITRISE_TEST_BUNDLE_PATH
|
Devices | Set to one or more device-OS combinations in a new line. Check out the device-OS combinations list to set this parameter. |
Required |
Example:iPhone 11-13 iPhone XS-15
|
Network logs |
Generate network logs of your XCUI test sessions to capture network traffic, latency, etc. | Optional |
true , false Default: false
|
Device Logs |
Generate device logs during XCUI test execution | Optional |
true , false Default: false
|
Capture screenshots |
Capture the screenshots of the test execution | Optional |
true , false Default: false
|
Project name |
Provide a project name for the tests | Optional | String Note that only letters (A-Z, a-z), digits (0-9), periods (.), colons (:) and underscores (_) are allowed. Any other characters are ignored. |
Test sharding |
Enable test sharding to split test cases into different groups instead of running them sequentially. Set the key-value pairs in the input field to specify the number of shards and configure its behavior. |
Optional |
Examples: Input for only-testing strategy: {"numberOfShards": 2, "mapping": [{"name": "Shard 1", "strategy": "only-testing", "values": ["SampleXCUITestsClass/testAlert", "SampleXCUITestsClass/testText"]}, {"name": "Shard 2", "strategy": "only-testing", "values": ["SampleXCUITestsClass/testLogin"]}]} Input for skip-testing strategy: {"numberOfShards": 2, "mapping": [{"name": "Shard 1", "strategy": "skip-testing", "values": ["SampleXCUITestsClass/testAlert"]}, {"name": "Shard 2", "strategy": "skip-testing", "values": ["SampleXCUITestsClass/testText"]}]}
|
Test capabilities |
Set the key-value pairs of other capabilities provided by BrowserStack in a new line. Check out the Request parameters section of the execute build API request page to learn about supported capabilities. | Optional |
Example: coverage=true geoLocation=CN"
|
To learn more parameters and output variables available in this step, check out the section on the complete list of parameters.
Set up a trigger for XCUI build in Bitrise
Setting up a trigger in Bitrise enables your workflow to run the pipeline when an event, such as a pull request or any commit, occurs in your source repository.
To set up a trigger in your app’s workflow, complete the following steps:
- On the Workflow Editor page, click the Triggers tab.
- In the Triggers section, select either PUSH, PULL REQUEST, or TAG type of trigger, depending on your use case.
- Click + ADD TRIGGER and configure the trigger based on your selection.
Check out the Bitrise triggers page to learn about trigger configurations. - Save the configuration.
You can now make changes in your source repository, and the build is triggered automatically in Bitrise.
Visit your App Automate dashboard and go to your Bitrise build to view the test result.
List of available parameters in App Automate - XCUI step
+The following table lists all parameters that you can configure using the App Automate - XCUI step:
The parameters available in the Input variables section of the BrowserStack App Automate - XCUI step are listed in the following table:
Key | Description | Flags | Default |
---|---|---|---|
BrowserStack username | Set your BrowserStack Username | Required | String |
BrowserStack access key | Set your BrowserStack Access Key | Required | String |
iOS app under test | Set the path of the app (.ipa) file. Add $BITRISE_IPA_PATH in the input field if you are using the Xcode Archive & Export for iOS step in the workflow. Else, you can add any other path of the file. |
Required |
Example: $BITRISE_IPA_PATH
|
XCUI test suite | Set the path of the output bundle file that contains your tests. Add $BITRISE_TEST_BUNDLE_PATH in the input field if you are using the Xcode Build for testing for iOS step in your workflow. Else, you can add any other path of the file. |
Required |
Example: $BITRISE_TEST_BUNDLE_PATH
|
Devices | Set to one or more device-OS combinations in a new line. Check out the device-OS combinations list to set this parameter. |
Required |
Example:iPhone 11-13 iPhone XS-15
|
Instrumentation logs |
Generate instrumentation logs of the test session | N/A | It is set to true , by default, and cannot be disabled |
Network logs |
Generate network logs of your XCUI test sessions to capture network traffic, latency, etc. | Optional |
true , false Default: false
|
Device Logs |
Generate device logs during XCUI test execution | Optional |
true , false Default: false
|
Capture screenshots |
Capture the screenshots of the test execution | Optional |
true , false Default: false
|
Video recording |
Record video of the test execution | Optional |
true , false Default: true
|
Project name |
Provide a project name for the tests | Optional | String Note that only letters (A-Z, a-z), digits (0-9), periods (.), colons (:) and underscores (_) are allowed. Any other characters are ignored. |
Notify project status |
Set a callback URL if you want BrowserStack to notify any third-party service about completion of build under a given project. This parameter requires that the Project name parameter also be set. The third-party service will receive a callback if no new builds are triggered for 5 minutes and all existing builds have completed their execution. |
Optional | URL |
Test sharding |
Enable test sharding to split test cases into different groups instead of running them sequentially. Set the key-value pairs in the input field to specify the number of shards and configure its behavior. |
Optional |
Examples: Input for only-testing strategy: {"numberOfShards": 2, "mapping": [{"name": "Shard 1", "strategy": "only-testing", "values": ["SampleXCUITestsClass/testAlert", "SampleXCUITestsClass/testText"]}, {"name": "Shard 2", "strategy": "only-testing", "values": ["SampleXCUITestsClass/testLogin"]}]} Input for skip-testing strategy: {"numberOfShards": 2, "mapping": [{"name": "Shard 1", "strategy": "skip-testing", "values": ["SampleXCUITestsClass/testAlert"]}, {"name": "Shard 2", "strategy": "skip-testing", "values": ["SampleXCUITestsClass/testText"]}]}
|
Filter test cases | Set a comma-separated list of class or test names followed by the supported filtering strategy name, namely only-testing and skip-testing . |
Optional |
Examples: For only-testing filtering strategy- only-testing SampleXCUITestsClass/testAlert, only-testing SampleXCUITestsClass/testText For skip-testing filtering strategy- skip-testing SampleXCUITestsClass/testAlert, skip-testing SampleXCUITestsClass/testText
|
Run dynamic tests |
Enable to run runtime discoverable tests or dynamic tests | Optional |
true , false Default: false
|
Wait for build results |
Enable to make your pipeline wait for BrowserStack to complete the execution and get the test results | Optional |
true , false Default: true
|
Test capabilities |
Set the key-value pairs of other capabilities provided by BrowserStack in a new line. Check out the Request parameters section of the execute build API request page to learn about supported capabilities. |
Optional |
Example: coverage=true geoLocation=CN"
|
When the build is executed, the BrowserStack App Automate - XCUI step generates output variables as explained in the following table:
Output variable | Description |
---|---|
$BROWSERSTACK_BUILD_URL |
URL of the build in your App Automate dashboard |
$BROWSERSTACK_BUILD_STATUS |
Status of the executed build. Check out the test results guide to learn about available status. |
Related topics
-
Manage your uploaded app or test suite using our upload app REST API and upload test suite REST API.
-
Use the get app API endpoint and list test suites API endpoint to list your recently uploaded apps and test suites.
-
Delete your uploaded app or test suite using the delete app API endpoint and delete test suite API endpoint.
We're sorry to hear that. Please share your feedback so we can do better
Contact our Support team for immediate help while we work on improving our docs.
We're continuously improving our docs. We'd love to know what you liked
We're sorry to hear that. Please share your feedback so we can do better
Contact our Support team for immediate help while we work on improving our docs.
We're continuously improving our docs. We'd love to know what you liked
Thank you for your valuable feedback!