Run iOS XCUItests on devices
Description
Run iOS XCUItests on physical devices with Google's Firebase Test Lab. You do not have to set up and register your own devices and you don't need your own Firebase account.
We'll go over the most important configuration information for the Step. For more information, check out our detailed guide.
To use the Step, you need to build an IPA file with Xcode's build-for-testing
action. You can use our dedicated Step:
-
Add the Xcode Build for testing for iOS Step to your Workflow.
The Step exports a .zip file that contains your test directory (by default, it’s
Debug-iphoneos
) and the xctestrun file. -
Add the iOS Device Testing Step to the Workflow.
-
In the Test devices input field, specify the devices on which you want to test the app.
-
Optionally, you can set a test timeout and configure file download in the Debug input group. The path to the downloaded files will be exported as an Environment Variable and it can be used by subsequent Steps.
-
Make sure you have the Deploy to Bitrise.io Step in your Workflow, with version 1.4.1 or newer. With the older versions of the Step, you won’t be able to check your results on the Test Reports page!
Please note you should not change the value of the API token and the Test API's base URL input.
If you get the Build already exists error, it is because you have more than one instance of the Step in your Workflow. This doesn't work as Bitrise sends the build slug to Firebase and having the Step more than once in the same Workflow results in sending the same build slug multiple times.
Add this step directly to your workflow in the Bitrise Workflow Editor.
You can also run this step directly with Bitrise CLI.
Inputs
Key | Description | Flags | Default |
---|---|---|---|
zip_path |
Open finder, and navigate to the directory you designated for Derived Data output. Open the folder for your project, then the Build/Products folders inside it. You should see a folder Debug-iphoneos and PROJECT_NAME_iphoneos_DEVELOPMENT_TARGET-arm64.xctestrun. Select them both, then right-click on one of them and select Compress 2 items. | required | $BITRISE_TEST_BUNDLE_ZIP_PATH |
test_devices |
Format: One device configuration per line and the parameters are separated with , in the order of: deviceID,version,language,orientation For example: iphone8,14.7,en,portrait iphone8,14.7,en,landscape Available devices and its versions: ┌─────────────┬───────────────────────┬─────────────────────┬─────────────────────────────────┐ │ MODEL_ID │ NAME │ OS_VERSION_IDS │ TAGS │ ├─────────────┼───────────────────────┼─────────────────────┼─────────────────────────────────┤ │ ipad5 │ iPad (5th generation) │ 15.4 │ reduced_stability=15.4 │ │ ipadmini4 │ iPad mini 4 │ 15.4 │ │ │ iphone11pro │ iPhone 11 Pro │ 14.7,16.5,16.6 │ deprecated=16.5 │ │ iphone12pro │ iPhone 12 Pro │ 14.8 │ │ │ iphone13pro │ iPhone 13 Pro │ 15.2,15.7 │ reduced_stability=15.2, default │ │ iphone14pro │ iPhone 14 Pro │ 16.5,16.6 │ deprecated=16.5 │ │ iphone8 │ iPhone 8 │ 14.7,15.7,16.5,16.6 │ deprecated=16.5 │ └─────────────┴───────────────────────┴─────────────────────┴─────────────────────────────────┘ Device and OS Capacity: ┌─────────────┬───────────────────────┬───────────────┬─────────────────┐ │ MODEL_ID │ MODEL_NAME │ OS_VERSION_ID │ DEVICE_CAPACITY │ ├─────────────┼───────────────────────┼───────────────┼─────────────────┤ │ ipad5 │ iPad (5th generation) │ 15.4 │ Low │ │ ipadmini4 │ iPad mini 4 │ 15.4 │ Low │ │ iphone11pro │ iPhone 11 Pro │ 14.7 │ Medium │ │ iphone11pro │ iPhone 11 Pro │ 16.5 │ High │ │ iphone11pro │ iPhone 11 Pro │ 16.6 │ Medium │ │ iphone12pro │ iPhone 12 Pro │ 14.8 │ Medium │ │ iphone13pro │ iPhone 13 Pro │ 15.2 │ Low │ │ iphone13pro │ iPhone 13 Pro │ 15.7 │ High │ │ iphone14pro │ iPhone 14 Pro │ 16.5 │ High │ │ iphone14pro │ iPhone 14 Pro │ 16.6 │ Low │ │ iphone8 │ iPhone 8 │ 14.7 │ Medium │ │ iphone8 │ iPhone 8 │ 15.7 │ Medium │ │ iphone8 │ iPhone 8 │ 16.5 │ High │ │ iphone8 │ iPhone 8 │ 16.6 │ Medium │ └─────────────┴───────────────────────┴───────────────┴─────────────────┘ |
required | iphone8,14.7,en,portrait |
test_timeout |
Max time a test execution is allowed to run before it is automatically canceled. The default value is 900 (15 min). Duration in seconds with up to nine fractional digits. Example: "3.5". | 900 |
|
download_test_results |
If this input is set to true all files generated in the test run will be downloaded. Otherwise, no any file will be downloaded. |
required | false |
api_base_url |
The URL where test API is accessible. | required | https://vdt.bitrise.io/test |
api_token |
The token required to authenticate with the API. | required, sensitive | $ADDON_VDTESTING_API_TOKEN |
Outputs
Environment Variable | Description |
---|---|
VDTESTING_DOWNLOADED_FILES_DIR |
The directory containing the downloaded files if you have set download_test_results inputs above. |
We welcome pull requests and issues against this repository.
For pull requests, work on your changes in a forked repository and use the Bitrise CLI to run step tests locally.
Learn more about developing steps: