https://github.com/browserstack/browserstack-bitrise-espresso-step
The official Browserstack Espresso Bitrise Step, using which users can integrate their Bitrise CI/CD pipelines with Browserstack
https://github.com/browserstack/browserstack-bitrise-espresso-step
Last synced: 17 days ago
JSON representation
The official Browserstack Espresso Bitrise Step, using which users can integrate their Bitrise CI/CD pipelines with Browserstack
- Host: GitHub
- URL: https://github.com/browserstack/browserstack-bitrise-espresso-step
- Owner: browserstack
- Created: 2022-06-21T08:47:14.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2023-11-06T08:54:25.000Z (over 2 years ago)
- Last Synced: 2026-02-16T05:58:34.020Z (about 1 month ago)
- Language: Go
- Size: 70.3 KB
- Stars: 1
- Watchers: 5
- Forks: 5
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Codeowners: CODEOWNERS
Awesome Lists containing this project
README
# BrowserStack App Automate - Espresso
## 🧩 Get started
Add this step directly to your workflow in the [Bitrise Workflow Editor](https://devcenter.bitrise.io/en/steps-and-workflows/introduction-to-workflows.html).
## Run Espresso tests on BrowserStack
Description
Run your Espresso tests on BrowserStack App Automate. This step collects the built APK from `$BITRISE_APK_PATH` and test apk from `$BITRISE_TEST_APK_PATH` environment variables.
## Configure the Step
To add and configure the "BrowserStack App Automate - Espresso" step in Bitrise, complete the following steps:
1. Open the Workflow you want to use in the Workflow Editor.
2. Before adding this step, add the [Android Build for UI testing](https://www.bitrise.io/integrations/steps/android-build-for-ui-testing) Step to your Workflow & configure it.
4. Add the **BrowserStack App Automate - Espresso** step right after the **Android Build for UI testing** step.
5. Add your BrowserStack Username and Access Key in the **Authentication** step input.
6. For **App & Test Suite** step inputs, the **Android Build for UI Testing** step exports an APK and a test APK, and their paths get automatically set in the APK path and Test APK path input fields. If you are not using **Android Build for UI Testing** step, make sure the **App path** input points to the path of the APK or AAB file of your app and test suite.
7. Add one or more devices in the **Devices** step input.
8. Configure additional step inputs like **Debug logs** and **Test Configurations** and start your build.
## ⚙️ Configuration
Inputs
| Key | Description | Flags | Default |
| --- | --- | --- | --- |
| `Android app under test` | Path of the app (.apk) file. | required | |
| `Espresso test suite` | Path of the test suite (.apk) file . | required | |
| `Devices` | Name of one or more device-OS combination in new line. For example:
`Samsung Galaxy S9 Plus-9.0`
`Google Pixel 3a-9.0` | required | |
| `instrumentation_logs` | Generate instrumentation logs of the test session | | `true` |
| `Network logs` | Generate network logs of your Espresso test sessions to capture network traffic, latency, etc. | | `false` |
| `Android logcat logs` | Generate device logs (Android logcat) | | `false` |
| `Capture Screenshots` | Capture the screenshots of the test execution| | `false` |
| `Video recording` | Record video of the test execution | | `true` |
| `Project name` | Project name of the tests | | |
| `Notify project status` | A callback URL to enable BrowserStack notify about completion of build under a given project. | | |
| `Local testing` | Enable local testing to retrieve app data hosted on local/private servers | | `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 auto strategy**:
```{"numberOfShards": 2}, "devices": ["Google Pixel 3-9.0"]```
**Input for package strategy**:```{"numberOfShards": 2, "mapping": [{"name": "Shard 1", "strategy": "package", "values": ["com.foo.login", "com.foo.logout"]}, {"name": "Shard 2", "strategy": "package", "values": ["com.foo.dashboard"]}]}``` **Input for class strategy**: ```{"numberOfShards": 2, "mapping": [{"name": "Shard 1", "strategy": "class", "values": ["com.foo.login.user", "com.foo.login.admin"]}, {"name": "Shard 2", "strategy": "class", "values": ["com.foo.logout.user"]}]}```| | |
| `Clear app data` | Enable to clear app data after every test run| | `false` |
| `Filter tests` | Key-value pairs of filters to run tests from supported test filtering strategies: class, package, annotation, size
Examples: **For class filtering strategy**: `class com.android.foo.ClassA, class com.android.foo.ClassB,class com.android.foo.ClassC`
**For package filtering strategy**: `package com.android.foo`
**For annotation filtering strategy**: `size small`,`size medium`,`size large` | | |
| `Single runner invocation` | Enable to run all tests in a single instrumentation process to reduce overall build time. | | `false` |
| `Mock server` | Enable to mock a web server in your espresso tests to mock your API responses. Learn more. | | `false` |
| `Build Status` | Wait for BrowserStack to complete the execution and get the test results | | `true` |
| `Test capabilities` |"New line separated variables, key and value seperated by `=` For example: `coverage=true`
`geoLocation=CN"` | | |
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/espresso/view-test-results) to learn about available status |
## Troubleshooting
For internal troubleshooting, we would recommend that you start from [here](https://devcenter.bitrise.io/en/builds/build-data-and-troubleshooting.html).
If you are still unable to figure out the problem, please feel free to create an [issue](https://github.com/browserstack/browserstack-bitrise-espresso-step/issues), we will look into it ASAP.
## Contribution Guidelines
1. Fork this [repository](https://github.com/browserstack/browserstack-bitrise-espresso-step)
2. Add your changes
3. Test your changes
4. Raise a PR against this [repository](https://github.com/browserstack/browserstack-bitrise-espresso-step)
5. Work on comments, if any
6. Once approved by our maintainers, we will merge the PR
7. We will mention your name when we publish our [release](https://github.com/browserstack/browserstack-bitrise-espresso-step/releases) with your contribution. :slightly_smiling_face: