BrowserStack App Automate - XCUI
𧩠Get started
Add this step directly to your workflow in the Bitrise Workflow Editor.
Run XCUI tests on BrowserStack
Description
Run your XCUI tests on BrowserStack App Automate. This step collects the built IPA from `$BITRISE_IPA_PATH` and the output bundle file from `$BITRISE_TEST_BUNDLE_PATH` environment variables.
## Configure the Step
Complete the following steps to configure BrowserStack's XCUI step in Bitrise:
1. Open the Workflow you want to use in the Workflow Editor.
β
2. Add the [Xcode Archive & Export for iOS](https://www.bitrise.io/integrations/steps/xcode-archive) and [Xcode Build for testing for iOS](https://www.bitrise.io/integrations/steps/xcode-build-for-test) steps to your workflow and configure them.
β
3. Add the **BrowserStack App Automate - XCUI** step below the **Xcode Archive & Export for iOS** and **Xcode Build for testing for iOS** steps.
β
4. Add your BrowserStack Username and Access Key in the **Authentication** step input.
β
5. For the **iOS app under test** input, the **BITRISE_IPA_PATH** output variable from the **Xcode Archive & Export for iOS** step exports the IPA file. Add `$BITRISE_IPA_PATH` to the **iOS app under test** input.
For the **XCUI test suite** input, the **BITRISE_TEST_BUNDLE_PATH** output variable from the **Xcode Build for testing for iOS step** exports the test suite. Add `$BITRISE_TEST_BUNDLE_PATH` to the **iOS app under test** input.
If you are not using **Xcode Archive & Export for iOS** and **Xcode Build for testing for iOS** steps, ensure that the **iOS app under test** input points to the path of your app (`.ipa` file). Also, ensure that the **XCUI test suite** input points to the test suite runner file. In the case of the runner app, it should be in the `/Debug-iphoneos` directory if you are providing an absolute path.
β
6. Add one or more devices in the **Devices** step input.
β
7. Configure additional step inputs like **Debug logs** and **Test Configurations** and start your build.
βοΈ Configuration
Inputs
| Key | Description | Flags | Default |
| --- | --- | --- | --- |
| `iOS app` | Set the path of the app (.ipa) file. | Required | N/A |
| `XCUI test suite` | Set the path of the output bundle file. | Required | N/A |
| `Devices` | Provide one or more device-OS combination in a new line. For example:
`iPhone 11-13`
`iPhone XS-15` | Required | N/A |
| `Instrumentation logs` | Generate instrumentation logs of the test session | Optional | `true` |
| `Network logs` | Generate network logs of your test sessions to capture network traffic, latency, etc. | Optional | `false` |
| `Device Logs` | Generate device logs | Optional | `false` |
| `Capture screenshots` | Capture the screenshots of the test execution| Optional | `false` |
| `Video recording` | Record video of the test execution | Optional | `true` |
| `Project name` | Project name of the tests | Optional | N/A |
| `Notify project status` | A callback URL to enable BrowserStack notify about completion of build under a given project. | Optional | N/A |
| `Local testing` | Enable local testing to retrieve app data hosted on local/private servers | Optional | `false` |
| `Test sharding` | Enable test sharding to split tests cases into different groups instead of running them sequentially.
Add the sharding value json here.
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"]}]}```| Optional | N/A |
| `Filter test cases` | Provide comma-separated list of classes followed by the supported filtering strategy name `only-testing` and `skip-testing`.
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` | Optional | N/A |
| `Run dynamic tests` | Enable to run runtime discoverable tests or dynamic tests | Optional | `false` |
| `Wait for build results` | Let pipeline wait for BrowserStack to complete the execution and get the test results | Optional | `true` |
| `Test capabilities` | Enter capabilities in a key-value pair format on a new line.
**For example**:
`coverage=true`
`geoLocation=CN"` | Optional | N/A |
Outputs
| Environment Variable | Description |
| --- | --- |
| `$BROWSERSTACK_BUILD_URL` |BrowserStack Dashboard url for the executed build|
| `$BROWSERSTACK_BUILD_STATUS`| Status of the executed build. Check out the [test results guide](https://www.browserstack.com/docs/app-automate/xcuitest/view-test-results) to learn about available status |
Troubleshooting
For internal troubleshooting, we would recommend that you start with the troubleshooting guide.
If you are still unable to figure out the problem, please feel free to create an issue, we will look into it ASAP.
Contribution Guidelines
- Fork this repository.
- Add your changes.
- Test your changes.
- Raise a PR against this repository
- Work on comments, if any.
- Once approved by our maintainers, we will merge the PR.
- We will mention your name when we publish our release with your contribution. :slightly_smiling_face: